public int ValuesetToDB(SQL_utils sql, Valueset vset) { if (measureid > 0) { int newvaluesetid = DxDbOps.CreateValueSet(sql, measureid, vset); return(newvaluesetid); } return(-1); }
public static void gvcrud_OnRowUpdating(ASPxGridView gv, ASPxDataUpdatingEventArgs e, string db, string tbl, string schema) { Debug.WriteLine(" ***** grid_OnRowUpdating"); DxDbOps.BuildUpdateSqlCode(e, tbl, db, schema); //((ASPxGridView)sender).JSProperties["cpIsUpdated"] = gv.ClientInstanceName.ToString(); gv.JSProperties["cpIsUpdated"] = gv.ClientInstanceName.ToString(); gv.CancelEdit(); e.Cancel = true; }
public int LogUpload_Doc() { OrderedDictionary newvalues = new OrderedDictionary(); //newvalues.Add("docID", docID); //newvalues.Add("docversID", docversID); newvalues.Add("docfilename", docfilename); newvalues.Add("doctitle", doctitle); newvalues.Add("docdesc", docdesc); newvalues.Add("doctypeID", doctypeID); newvalues.Add("docstatusID", docstatusID); newvalues.Add("fileext", fileext); newvalues.Add("origfilename", origfilename); //Insert Doc docID = DxDbOps.InsertSqlCode_ReturnPK(newvalues, "tblDoc", "backend", "dbo", "DocID"); if (docID > 0) { newvalues.Add("DocID", docID); //Insert DocVers docversID = DxDbOps.InsertSqlCode_ReturnPK(newvalues, "tblDocVers", "backend", "dbo", "DocVersID"); //Insert entity link - we link this DocID to this MeasureID SQL_utils sql = new SQL_utils("backend"); string sql_doc = String.Format("select docID from tbldoc where doctitle='{0}' and created > dateadd(minute, -3, getdate())", doctitle); string sql_docvers = String.Format("select docversID from tbldocvers where origfilename='{0}' and docID={1} and created > dateadd(minute, -3, getdate())" , origfilename, docID); int thisDocID = sql.IntScalar_from_SQLstring(sql_doc); int thisDocVersID = sql.IntScalar_from_SQLstring(sql_docvers); string fk_code = String.Format("insert into tblDocFK(DocID, EntitytypeID, EntityID) values({0}, {1}, {2})" , thisDocID, (int)linked_entitytype, linked_entityID); if (thisDocID == docID & thisDocVersID == docversID) { docfilename = String.Format("DocVersID_{0}{1}", docversID, fileext); sql.NonQuery_from_SQLstring(fk_code); sql.Close(); return(docversID); } else { sql.Close(); return(-1); } } return(-1); }
public static void gvcrud_OnRowDeleting(ASPxGridView gv, ASPxDataDeletingEventArgs e) { //ASPxGridView gv = (ASPxGridView)sender; string gvname = gv.ClientInstanceName; DxDbOps.BuildDeleteSqlCode(e, gvname, "Data"); gv.JSProperties["cpIsUpdated"] = gv.ClientInstanceName.ToString(); gv.CancelEdit(); e.Cancel = true; }
public static void gvcrud_OnRowInserting(ASPxGridView gv, ASPxDataInsertingEventArgs e, string dbname, string schemaname) { Debug.WriteLine(" ***** grid_OnRowInserting"); //ASPxGridView gv = (ASPxGridView)sender; //SQL_utils sql = new SQL_utils(dbname); string gvname = gv.ClientInstanceName; DxDbOps.BuildInsertSqlCode(e, gvname, dbname, schemaname); gv.JSProperties["cpIsUpdated"] = gv.ClientInstanceName.ToString(); gv.CancelEdit(); e.Cancel = true; }