protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { //新增 int indexUser, indexRole; ASPxGridLookup gridLookupUser = ASPxGridView1.FindEditFormTemplateControl("GridLookupUser") as ASPxGridLookup; ASPxGridLookup gridLookupRole = ASPxGridView1.FindEditFormTemplateControl("GridLookupRole") as ASPxGridLookup; List <object> Users = gridLookupUser.GridView.GetSelectedFieldValues("USER_ID"); List <object> Roles = gridLookupRole.GridView.GetSelectedFieldValues("ROLE_CODE"); for (indexUser = 0; indexUser < Users.Count; indexUser++) { for (indexRole = 0; indexRole < Roles.Count; indexRole++) { MW_MODIFY_USER_ROLE sp = new MW_MODIFY_USER_ROLE() { THEFUNCTION1 = "ADD", THECOMPANYCODE1 = theCompanyCode, THEUSERID1 = Users[indexUser].ToString(), THEROLECODE1 = Roles[indexRole].ToString() }; Rmes.DA.Base.Procedure.run(sp); //dataConn theDataConn = new dataConn(); //theDataConn.theComd.CommandType = CommandType.StoredProcedure; //theDataConn.theComd.CommandText = "MW_MODIFY_USER_ROLE"; //theDataConn.theComd.Parameters.Add("THEFUNCTION1", OracleDbType.Varchar2).Value = "ADD"; //theDataConn.theComd.Parameters.Add("THEFUNCTION1", OracleDbType.Varchar2).Direction = ParameterDirection.Input; //theDataConn.theComd.Parameters.Add("THECOMPANYCODE1", OracleDbType.Varchar2).Value = theCompanyCode; //theDataConn.theComd.Parameters.Add("THECOMPANYCODE1", OracleDbType.Varchar2).Direction = ParameterDirection.Input; //theDataConn.theComd.Parameters.Add("THEUSERID1", OracleDbType.Varchar2).Value = Users[indexUser].ToString(); //theDataConn.theComd.Parameters.Add("THEUSERID1", OracleDbType.Varchar2).Direction = ParameterDirection.Input; //theDataConn.theComd.Parameters.Add("THEROLECODE1", OracleDbType.Varchar2).Value = Roles[indexRole].ToString(); //theDataConn.theComd.Parameters.Add("THEROLECODE1", OracleDbType.Varchar2).Direction = ParameterDirection.Input; //theDataConn.OpenConn(); //theDataConn.theComd.ExecuteNonQuery(); //theDataConn.CloseConn(); } } setCondition(); e.Cancel = true; ASPxGridView1.CancelEdit(); }
protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //删除 //调用存储过程进行处理 MW_MODIFY_USER_ROLE sp = new MW_MODIFY_USER_ROLE() { THEFUNCTION1 = "DELETE", THECOMPANYCODE1 = theCompanyCode, THEUSERID1 = e.Keys["USER_ID"].ToString(), THEROLECODE1 = e.Values["ROLE_CODE"].ToString() }; Rmes.DA.Base.Procedure.run(sp); //dataConn theDataConn = new dataConn(); //theDataConn.theComd.CommandType = CommandType.StoredProcedure; //theDataConn.theComd.CommandText = "MW_MODIFY_USER_ROLE"; //theDataConn.theComd.Parameters.Add("THEFUNCTION1", OracleDbType.Varchar2).Value = "DELETE"; //theDataConn.theComd.Parameters.Add("THEFUNCTION1", OracleDbType.Varchar2).Direction = ParameterDirection.Input; //theDataConn.theComd.Parameters.Add("THECOMPANYCODE1", OracleDbType.Varchar2).Value = theCompanyCode; //theDataConn.theComd.Parameters.Add("THECOMPANYCODE1", OracleDbType.Varchar2).Direction = ParameterDirection.Input; //theDataConn.theComd.Parameters.Add("THEUSERID1", OracleDbType.Varchar2).Value = e.Keys["USER_ID"].ToString(); //theDataConn.theComd.Parameters.Add("THEUSERID1", OracleDbType.Varchar2).Direction = ParameterDirection.Input; //theDataConn.theComd.Parameters.Add("THEROLECODE1", OracleDbType.Varchar2).Value = e.Values["ROLE_CODE"].ToString(); //theDataConn.theComd.Parameters.Add("THEROLECODE1", OracleDbType.Varchar2).Direction = ParameterDirection.Input; //theDataConn.OpenConn(); //theDataConn.theComd.ExecuteNonQuery(); //theDataConn.CloseConn(); setCondition(); e.Cancel = true; }