protected void Cause_Inserting(object sender, ASPxDataInsertingEventArgs e) { string desc = e.NewValues[0].ToString(); string seq = e.NewValues[1].ToString(); string qry = "INSERT INTO TBLSYSTEM_TEMPLATE(OBID, SYS_NAME, CLASS_NAME, SEQ, PARENT_OBID, DESCRIPTION, PRJ_NAME) "; qry = qry + "VALUES(NEWID(), '" + sys_name + "', 'Cause', '" + seq + "', '" + sys_name + "', '" + desc + "', '" + fgm_moduler.func_Class.project_Name + "')"; SqlCommand cmd; cmd = new SqlCommand(qry, fgm_moduler.func_Class.conn); cmd.ExecuteNonQuery(); e.Cancel = true; CauseGrid.CancelEdit(); }
public void Cause_Deleting(object sender, ASPxDataDeletingEventArgs e) { SqlCommand cmd; ASPxGridView detailGridView = (ASPxGridView)sender; string Selected_OBID = e.Keys[CauseGrid.KeyFieldName].ToString(); string qry = " UPDATE TBLSYSTEM_TEMPLATE SET N1TERMINATIONDATE = REPLACE(REPLACE(CONVERT(varchar(23), GETDATE(), 121), '-','/'),' ', '-'), "; qry = qry + "N1TERMINATIONID = '" + SessionInfo.UserID + "' "; qry = qry + "WHERE OBID = '" + Selected_OBID + "' "; cmd = new SqlCommand(qry, fgm_moduler.func_Class.conn); cmd.ExecuteNonQuery(); string qry2 = " UPDATE TBLSYSTEM_TEMPLATE SET N1TERMINATIONDATE = REPLACE(REPLACE(CONVERT(varchar(23), GETDATE(), 121), '-','/'),' ', '-'), "; qry2 = qry2 + "N1TERMINATIONID = '" + SessionInfo.UserID + "' "; qry2 = qry2 + "WHERE PARENT_OBID = '" + Selected_OBID + "' "; cmd = new SqlCommand(qry2, fgm_moduler.func_Class.conn); cmd.ExecuteNonQuery(); e.Cancel = true; CauseGrid.CancelEdit(); }