protected void gridDocs_OnRowUpdating(object sender, ASPxDataUpdatingEventArgs e) { var x = e; bool results_docVers = DxDbOps.BuildUpdateSqlCode(e, "tblDocVers", "backend"); OrderedDictionary oldvals = e.OldValues; OrderedDictionary newvals = e.NewValues; OrderedDictionary keys = new OrderedDictionary(); keys.Add("DocID", oldvals["DocID"]); bool results_doc = DxDbOps.BuildUpdateSqlCode(keys, newvals, oldvals, "tblDoc", "backend"); int measureID = Convert.ToInt32(Request.QueryString["mID"]); LoadDocs(measureID); e.Cancel = true; gridDocs.CancelEdit(); // gridDocs.EndUpdate(); }
protected void dxgrid_OnRowUpdating(object sender, ASPxDataUpdatingEventArgs e) { ASPxGridView gv = (ASPxGridView)sender; DxDbOps.BuildUpdateSqlCode(e, GridnameToTable(gv.ClientInstanceName), "backend"); gv.CancelEdit(); e.Cancel = true; }
protected void dxgrid_OnRowUpdating(object sender, ASPxDataUpdatingEventArgs e) { ASPxGridView gv = (ASPxGridView)sender; DxDbOps.BuildUpdateSqlCode(e, "tblStaff", "backend"); gv.CancelEdit(); e.Cancel = true; }
protected void gv_pubvar_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxGridView gv = (ASPxGridView)sender; DxDbOps.BuildUpdateSqlCode(e, "tblPubVar", "backend", "dbo"); gv.CancelEdit(); e.Cancel = true; }
protected void gridLinkedREDCapForm_OnRowUpdating(object sender, ASPxDataUpdatingEventArgs e) { ASPxGridView gv = (ASPxGridView)sender; DxDbOps.BuildUpdateSqlCode(e, "REDCap_Form", "data", "def"); gv.CancelEdit(); e.Cancel = true; Session["LinkedREDCapForm"] = null; LoadlinkedTables(); }
protected void gridDict_OnRowUpdating(object sender, ASPxDataUpdatingEventArgs e) { ASPxGridView gv = (ASPxGridView)sender; DxDbOps.BuildUpdateSqlCode(e, "fld", "data", "def"); //((ASPxGridView) sender).JSProperties["cpIsUpdated"] = gv.ClientInstanceName.ToString(); gv.CancelEdit(); e.Cancel = true; gridDict.DataBind(); }
protected void dxgrid_OnRowUpdating(object sender, ASPxDataUpdatingEventArgs e) { ASPxGridView gv = (ASPxGridView)sender; //For changes to ActionText if (gv.ID == "grid_tblstudyaction") { string pkfld = ""; int pkvalue = -1; foreach (DictionaryEntry key in e.Keys) { pkfld = key.Key.ToString(); pkvalue = Convert.ToInt32(key.Value); } if (pkvalue > 0 && pkfld == "studyactionID") { foreach (DictionaryEntry newentry in e.NewValues) { foreach (DictionaryEntry oldentry in e.OldValues) { var newfld = newentry.Key.ToString().ToLower(); var oldfld = oldentry.Key.ToString().ToLower(); if (newentry.Key == oldentry.Key && newentry.Key.ToString() == "actiontext") { var newval = (newentry.Value == null) ? null : newentry.Value.ToString(); var oldval = (oldentry.Value == null) ? null : oldentry.Value.ToString(); if (newval != oldval) { SQL_utils sql = new SQL_utils("backend"); string sqlcode = String.Format("update tblAction set actiontext=replace(actiontext,'{0}','{1}') where studyactionID={2}" , oldval, newval, pkvalue); sql.NonQuery_from_SQLstring(sqlcode); } } } } } } DxDbOps.BuildUpdateSqlCode(e, GridnameToTable(gv.ClientInstanceName), "backend"); ((ASPxGridView)sender).JSProperties["cpIsUpdated"] = gv.ClientInstanceName.ToString(); gv.CancelEdit(); e.Cancel = true; }
protected void SaveButton_OnClick(object sender, EventArgs e) { int measureID = Convert.ToInt32(Request.QueryString["mID"]); OrderedDictionary keys = new OrderedDictionary(); keys.Add("measureID", measureID); OrderedDictionary newvalues = new DxDbOps.FormLayoutNewValues((ASPxFormLayout)FormLayout); newvalues.Add("measureID", measureID); OrderedDictionary oldvalues = (OrderedDictionary)Session["formlayoutoldvalues"]; bool outcome = DxDbOps.BuildUpdateSqlCode(keys, newvalues, oldvalues, "tblMeasure", "backend", "dbo"); bool outcome2 = DxDbOps.BuildUpdateSqlCode(keys, newvalues, oldvalues, "tbl", "data", "def"); LoadMeasureInfo(measureID); }
protected void gridEditStaff_BatchUpdate(object sender, ASPxDataBatchUpdateEventArgs e) { int staffID = Convert.ToInt32(gridStaffList.GetSelectedFieldValues("staffID").First()); List <bool> results = new List <bool>(); foreach (ASPxDataUpdateValues args in e.UpdateValues) { if (Convert.ToInt32(args.Keys[0].ToString()) < 0) { //Add staffID to the NewValues //int staffID = Convert.ToInt32(cboStaffInLab.Value.ToString()); args.NewValues["staffID"] = staffID; bool result = DxDbOps.BuildInsertSqlCode(args.NewValues, "tbllabgroup_staff", "backend"); results.Add(result); if (result) { needrefresh = true; } } else { bool result = DxDbOps.BuildUpdateSqlCode(args, "tbllabgroup_staff", "backend"); results.Add(result); if (result) { needrefresh = true; } } } DataTable dt = GetStaffToEdit(staffID); Session["labgroups_staff"] = dt; e.Handled = true; }