Execute two SQL statements privatevoidtoTop (intpEC_TempID) {intmEC_TempID0; reset (true, 0, EC_TempID, ElectronCards_temp, VendorVendorID]. ToString () + andWebSiteType
Set the top backend to execute two SQL statements: private void toTop (int pEC_TempID) {int mEC_TempID = 0; object oEC_TempID = myShare. getAObject (true, 0, "EC_TempID", "ElectronCards_temp", "VendorID =" + ViewState ["VendorID"]. toString () + "and WebSiteType =
Stick to the background and execute two SQL statements
Private void toTop (int pEC_TempID) {int mEC_TempID = 0; object oEC_TempID = myShare. getAObject (true, 0, "EC_TempID", "ElectronCards_temp", "VendorID =" + ViewState ["VendorID"]. toString () + "and WebSiteType =" + ViewState ["WebSiteTypeID"]. toString (); if (oEC_TempID! = Null) {mEC_TempID = int. parse (oEC_TempID.ToString ();} SqlConnection con = null; bool flag = false; try {con = new SqlConnection (ConfigurationManager. appSettings ["ConnectionString"]); string sql1 = "update ElecProducts_Temp set DisplayOrder = case when DisplayOrder = 255 then DisplayOrder else DisplayOrder + 1 end where EC_TempID =" + mEC_TempID; string sql2 = "update ElecProducts_Temp set DisplayOrder = 1 wh Ere EP_TempID = "+ pEC_TempID; con. Open (); SqlCommand com = new SqlCommand (sql1, con); flag = com. ExecuteNonQuery ()> 0? True: false; SqlCommand com2 = new SqlCommand (sql2, con); flag = com2.ExecuteNonQuery ()> 0? True: false; con. close ();} catch (SqlException se) {} finally {con. close () ;}if (flag) {myShare. webMessageBox (this. page, "topped successfully! "); Int mECP_TempID = Convert. toInt32 (myShare. getAObject (true, 0, "EC_TempID", "ElectronCards_temp", "VendorID =" + ViewState ["VendorID"]. toString () + "and WebSiteType =" + ViewState ["WebSiteTypeID"]. toString (); BindToDataList (mECP_TempID);} else {myShare. webMessageBox (this. page, "An error occurred while setting the top information. Please try again! ");}}
Posted on
Copyright©2013 porray Powered By: blog Park template: Hujiang blog
,