private void scorerepeater_ItemCommand(object source, RepeaterCommandEventArgs e) { int scoreValue = 0; int voteNumber = 1; Label ScoreID = (Label)e.Item.FindControl("ScoreID"); DataTable dt = DatabaseConnection.CreateDataset("SELECT * FROM SCOREVALUES WHERE IDDESCRIPTION=" + ScoreID.Text + " AND IDCROSS=" + ViewState["crossid"] + " AND TYPE=" + ViewState["type"]).Tables[0]; if (dt.Rows.Count > 0) { scoreValue = Convert.ToInt32(dt.Rows[0]["scorevalue"]); voteNumber += Convert.ToInt32(dt.Rows[0]["votenumber"]); } int vote = 0; switch (e.CommandName) { case "VotePlus": scoreValue++; vote = 1; break; case "VoteMinus": scoreValue--; vote = -1; break; } long newid = 0; using (DigiDapter dg = new DigiDapter()) { dg.Add("SCOREVALUE", scoreValue); dg.Add("VOTENUMBER", voteNumber); dg.Add("IDDESCRIPTION", ScoreID.Text); dg.Add("IDCROSS", ViewState["crossid"], 'I'); dg.Add("TYPE", ViewState["type"], 'I'); object nid; if (dt.Rows.Count > 0) { nid = dt.Rows[0]["id"]; dg.Execute("SCOREVALUES", "id=" + dt.Rows[0]["id"], DigiDapter.Identities.Identity); } else { nid = dg.Execute("SCOREVALUES", DigiDapter.Identities.Identity); } newid = Convert.ToInt64(nid); } DatabaseConnection.DoCommand(string.Format("INSERT INTO SCORELOG (IDVALUE,VOTEDATE,OWNERID,VOTE) VALUES ({0},GETDATE(),{1},{2})", newid, UC.UserId, vote)); ClientScript.RegisterStartupScript(this.GetType(), "close", "<script>self.close();parent.HideBox();</script>"); }
private int InsertRenameCategory(string newCategory, int parent, int id, string mail) { if ((newCategory != null && newCategory.Length != 0)) { using (DigiDapter dg = new DigiDapter()) { dg.Add("DESCRIPTION", newCategory); dg.Add("PARENTID", parent); dg.Add("EMAILOWNER", ((mail.Length > 0)?mail:string.Empty)); object newId = dg.Execute("CATALOGCATEGORIES", "id=" + id, DigiDapter.Identities.Identity); if (dg.RecordInserted) { return(Convert.ToInt32(newId.ToString())); } else { return(id); } } } else { LblMessage.Text = Root.rm.GetString("Cattxt9"); // Manca il TextFont return(-1); } }
public void btn_Click(object sender, EventArgs e) { if (Category.Text.Length > 0) { string sqlTable; if (Request.Params["Ref"] != null) { sqlTable = "CRM_ReferrerCategories"; } else { sqlTable = "CRM_ContactCategories"; } using (DigiDapter dg = new DigiDapter()) { dg.Add("DESCRIPTION", Category.Text); dg.Add("CREATEDBYID", UC.UserId); if (RadioButtonList1.Items[1].Selected) { dg.Add("FLAGPERSONAL", 1); } dg.Execute(sqlTable); } SomeJS.Text = "<script>parent.__doPostBack('RefreshRepCategories');self.close();parent.HideBox();</script>"; } }
private int InsertRenameCategory(string newCategory, int parent, int id) { if ((newCategory != null && newCategory.Length != 0)) { using (DigiDapter dg = new DigiDapter()) { dg.Add("DESCRIPTION", newCategory); dg.Add("PARENTID", parent); object newId = dg.Execute("FILESCATEGORIES", "ID=" + id, DigiDapter.Identities.Identity); LblMessage.Text = Root.rm.GetString("Cattxt8"); // Aggiornamento eseguito con successo if (id == -1) { return(Convert.ToInt32(newId.ToString())); } else { return(id); } } } else { LblMessage.Text = Root.rm.GetString("Cattxt9"); // Manca il TextFont return(-1); } }
private void ModifyDataSet(string id) { string sqlString = "SELECT ID FROM BASE_EVENTS WHERE ID = " + id; using (DigiDapter dg = new DigiDapter(sqlString)) { if (!dg.HasRows) { dg.Add("CREATEDBYID", UC.UserId, 'I'); } dg.Add("UID", UserApp.SelectedItem.Value); dg.Add("STARTDATE", UC.LTZ.ToUniversalTime(Convert.ToDateTime(StartDate.Text + " " + StartHour.Text, UC.myDTFI))); dg.Add("TITLE", AgTitle.Text); dg.Add("NOTE", Note.Text); dg.Add("LASTMODIFIEDBYID", UC.UserId); if (id == "-1") { if (CheckRecurrent.Checked) { { dg.Add("RECURRID", NewRecurrence()); } } } dg.Execute("BASE_EVENTS", "id=" + id); } }
public void RapSubmit_Click(Object sender, EventArgs e) { if (RapRagSoc.Text.Length > 0) { using (DigiDapter dg = new DigiDapter()) { dg.InsertOnly(); dg.Add("CREATEDBYID", UC.UserId, 'I'); dg.Add("COMPANYNAME", RapRagSoc.Text); dg.Add("COMPANYNAMEFILTERED", StaticFunctions.FilterSearch(RapRagSoc.Text)); dg.Add("PHONE", RapPhone.Text); dg.Add("EMAIL", RapEmail.Text); dg.Add("OWNERID", UC.UserId); dg.Add("GROUPS", "|" + UC.AdminGroupId + "|" + UC.UserGroupId + "|"); object newId = dg.Execute("Base_Companies", DigiDapter.Identities.Identity); string setRef = "SetRef('" + G.ParseJSString(RapRagSoc.Text) + "','" + newId.ToString() + "','','','',''," + "'" + G.ParseJSString(RapPhone.Text) + "','" + G.ParseJSString(RapEmail.Text) + "');"; ClientScript.RegisterStartupScript(this.GetType(), "start", "<script>" + setRef + "</script>"); } } }
private void ChangeElement(int id, string table, string field) { string newId = String.Empty; using (DigiDapter dg = new DigiDapter("SELECT * FROM " + table + " WHERE ID=" + id)) { if (!dg.HasRows) { } dg.Add(field, ElementDescription.Text); dg.Add("LANG", MyUICulture.SelectedValue); object obNewId = dg.Execute(table, "ID=" + id, DigiDapter.Identities.Identity); try { newId = obNewId.ToString(); } catch { } } if ((newId != null && newId.Length != 0) && id.ToString() != newId) { using (DigiDapter dg = new DigiDapter()) { dg.Add("K_ID", (KElement.Text == "0") ? newId : KElement.Text); dg.Execute(table, "ID=" + newId, DigiDapter.Identities.Identity); } } FillList(field, table); FormTable.Visible = false; }
public void RapSubmit_Click(object sender, EventArgs e) { string newId = String.Empty; using (DigiDapter dg = new DigiDapter()) { dg.Add("OWNERID", UC.UserId); dg.Add("CREATEDBYID", UC.UserId); dg.Add("CREATEDDATE", DateTime.UtcNow); dg.Add("LASTMODIFIEDDATE", DateTime.UtcNow); dg.Add("LASTMODIFIEDBYID", UC.UserId); dg.Add("NAME", Name.Text); dg.Add("SURNAME", Surname.Text); dg.Add("COMPANYNAME", CompanyName.Text); dg.Add("GROUPS", "|" + UC.UserGroupId + "|"); object obNewId = dg.Execute("CRM_Leads", "ID=-1", DigiDapter.Identities.Identity); newId = obNewId.ToString(); } DatabaseConnection.DoCommand("INSERT INTO CRM_CROSSLEAD (LEADID) VALUES (" + newId + ")"); string js; string control = Request.QueryString["textbox"].ToString(); string control3 = (Request.QueryString["textboxID"] != null) ? Request.QueryString["textboxID"].ToString() : ""; js = "<script>"; js += " dynaret('" + control + "').value='" + Name.Text + " " + Surname.Text + "';"; if (control3.Length > 0) { js += " dynaret('" + control3 + "').value=" + newId + ";"; } js += " self.close();"; js += " parent.HideBox();"; js += "</script>"; SomeJS.Text = js; }
private void CurrSubmit_Click(object sender, EventArgs e) { try { int id = int.Parse(CurrID.Text); string sqlString = "SELECT * FROM CURRENCYTABLE WHERE ID =" + id; using (DigiDapter dg = new DigiDapter(sqlString)) { if (!dg.HasRows) { } dg.Add("CURRENCY", CurrName.Text); dg.Add("CURRENCYSYMBOL", CurrSymbol.Text); dg.Add("CHANGETOEURO", StaticFunctions.FixDecimal(CurrChange1.Text)); dg.Add("CHANGEFROMEURO", StaticFunctions.FixDecimal(CurrChange2.Text)); dg.Execute("CURRENCYTABLE", "ID=" + id); } CurrencyRepeater.DataSource = DatabaseConnection.CreateDataset("SELECT * FROM CURRENCYTABLE").Tables[0]; CurrencyRepeater.DataBind(); CancelForm(); Start(); } catch { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + Root.rm.GetString("Curtxt12") + "');</script>"); } }
public void Submit_Click(Object sender, EventArgs e) { using (DigiDapter dg = new DigiDapter()) { dg.Add("DESCRIPTION", GroupText.Text); string dep = "|"; foreach (ListItem im in ListDip.Items) { dep += im.Value.ToString() + "|"; } if (dep.Length < 2) { dep = "|" + UC.AdminGroupId.ToString() + "|"; } if (dep.IndexOf("|" + UC.AdminGroupId.ToString() + "|") < 0) { dep = "|" + UC.AdminGroupId.ToString() + dep; } dg.Add("DEPENDENCY", dep); dg.Execute("GROUPS", "id=" + int.Parse(ViewState["IDGroup"].ToString())); } ViewState["IDGroup"] = "-1"; GroupText.Text = String.Empty; ListDip.Items.Clear(); FillGrid(); FillListGroups(); Groups_Grid.Visible = true; Groups_Table.Visible = false; }
public void RapSubmit_Click(object sender, EventArgs e) { object newId; using (DigiDapter dg = new DigiDapter()) { dg.Add("OWNERID", UC.UserId); dg.Add("CREATEDBYID", UC.UserId); dg.Add("CREATEDDATE", DateTime.UtcNow); dg.Add("LASTMODIFIEDDATE", DateTime.UtcNow); dg.Add("LASTMODIFIEDBYID", UC.UserId); dg.Add("NAME", Name.Text); dg.Add("SURNAME", Surname.Text); dg.Add("GROUPS", "|" + UC.UserGroupId + "|"); newId = dg.Execute("BASE_CONTACTS", "ID=-1", DigiDapter.Identities.Identity); } string js; string control = Request.QueryString["textbox"].ToString(); string control3 = (Request.QueryString["textboxID"] != null) ? Request.QueryString["textboxID"].ToString() : ""; js = "<script>"; js += " dynaret('" + control + "').value='" + Name.Text + " " + Surname.Text + "';"; if (control3.Length > 0) { js += " dynaret('" + control3 + "').value=" + newId.ToString() + ";"; } js += " window.onload=null;self.close();"; js += " parent.HideBox();"; js += "</script>"; SomeJS.Text = js; }
private void ModifyTask() { using (DigiDapter dg = new DigiDapter()) { dg.Add("CREATEDBYID", UC.UserId, 'I'); dg.Add("LASTMODIFIEDDATE", DateTime.UtcNow, 'I'); dg.Add("LASTMODIFIEDBYID", UC.UserId, 'I'); try { dg.Add("OWNERID", Convert.ToInt64(ToDoList_OwnerID.Text)); } catch { dg.Add("OWNERID", UC.UserId); } dg.Add("EXPIRATIONDATE", ToDoList_ExpirationDate.Text); if (ToDoList_CompanyID.Text.Length > 0) { dg.Add("COMPANYID", ToDoList_CompanyID.Text); } if (ToDoList_OpportunityID.Text.Length > 0) { dg.Add("OPPORTUNITYID", ToDoList_OpportunityID.Text); } dg.Add("TASK", ToDoList_Task.Text); dg.Add("OUTCOME", ToDoList_Outcome.Text); dg.Add("GROUPS", UC.UserGroupId); dg.Add("LASTMODIFIEDDATE", DateTime.UtcNow, 'U'); dg.Add("LASTMODIFIEDBYID", UC.UserId, 'U'); dg.Execute("CRM_ToDolist", "id=" + int.Parse(TaskID.Text)); } }
private bool AddFields(byte tablename) { if (Field.Text.Length == 0) { return(false); } int fieldID = int.Parse(FieldID.Text); using (DigiDapter dg = new DigiDapter()) { dg.Add("TABLENAME", tablename); dg.Add("NAME", Field.Text); try { dg.Add("VIEWORDER", Convert.ToInt32(ViewOrderField.Text)); } catch { dg.Add("VIEWORDER", 1); } dg.Add("TYPE", Type.SelectedItem.Value); if (FieldRef.SelectedIndex > 0 && FieldRefValue.SelectedIndex > 0) { dg.Add("PARENTFIELD", DatabaseConnection.SqlScalar("SELECT REFERENCEFIELD FROM ADDEDFIELD_DROPDOWN WHERE ID=" + int.Parse(FieldRef.SelectedValue))); dg.Add("PARENTQUERY", FieldRef.SelectedValue.ToString()); dg.Add("PARENTFIELDVALUE", FieldRefValue.SelectedValue); } else { dg.Add("PARENTFIELD", DBNull.Value); dg.Add("PARENTFIELDVALUE", DBNull.Value); dg.Add("PARENTQUERY", DBNull.Value); } if (Type.SelectedItem.Value == "4") { dg.Add("ITEMS", "|" + SelectItem.Text.Replace(',', '|') + "|"); } if (Groups.GetValue.Length > 0) { dg.Add("GROUPS", Groups.GetValue); } else { dg.Add("GROUPS", "|" + UC.UserGroupId.ToString() + "|"); } dg.Execute("ADDEDFIELDS", "ID=" + fieldID); } FieldID.Text = "-1"; Field.Text = String.Empty; ViewOrderField.Text = String.Empty; Groups.SetGroups("|" + UC.UserGroupId + "|"); return(true); }
private void updBoatType_Click(object sender, EventArgs e) { foreach (DataGridItem di in dgValueEditor.Items) { if (di.ItemType == ListItemType.Item || di.ItemType == ListItemType.AlternatingItem) { if (((CheckBox)di.FindControl("chkDelete")).Checked) { DatabaseConnection.DoCommand(string.Format("DELETE FROM {0} WHERE ID={1}", this.TableName, ((Literal)di.FindControl("rowid")).Text)); } else { using (DigiDapter dg = new DigiDapter()) { object field1 = new object(); switch (this.DataValueFieldType) { case FieldType.numeric: field1 = Convert.ToDecimal(((TextBox)di.FindControl("type")).Text); break; case FieldType.varchar: field1 = ((TextBox)di.FindControl("type")).Text; break; } dg.Add(this.DataValueField, field1); if (this.DataValueField2.Length > 0) { object field2 = new object(); switch (this.DataValueFieldType2) { case FieldType.numeric: field2 = Convert.ToDecimal(((TextBox)di.FindControl("type2")).Text); break; case FieldType.varchar: field2 = ((TextBox)di.FindControl("type2")).Text; break; } dg.Add(this.DataValueField2, field2); } if (this.Lang.Length > 0) { dg.Add(this.Lang, ((DropDownList)di.FindControl("MyUICulture")).SelectedValue); } dg.Add("VIEWORDER", (((TextBox)di.FindControl("vieworder")).Text.Length > 0)?((TextBox)di.FindControl("vieworder")).Text:"0"); dg.Execute(this.TableName, "id=" + ((Literal)di.FindControl("rowid")).Text); } } } } LoadGrid(); }
private void ModifyCrossOpportunity(int conID, int opID, int valueID, string type) { int ContactType = 0; switch (Request["contactID"].Substring(0, 1)) { case "C": break; case "L": ContactType = 1; break; case "A": ContactType = 0; break; } string sqlString = String.Format("SELECT ID FROM CRM_CROSSOPPORTUNITY WHERE CONTACTTYPE=" + ContactType + " AND CONTACTID = {0} AND OPPORTUNITYID = {1} AND TYPE= {2};", conID, opID, type); using (DigiDapter dg = new DigiDapter(sqlString)) { if (!dg.HasRows) { dg.Add("OPPORTUNITYID", opID, 'I'); dg.Add("CONTACTID", conID, 'I'); dg.Add("TYPE", type, 'I'); dg.Add("CONTACTTYPE", ContactType, 'I'); } dg.Add("TABLETYPEID", valueID); if (dg.HasRows) { dg.Execute("CRM_CROSSOPPORTUNITY", "ID=" + dg.ExternalReader[0]); } else { dg.Execute("CRM_CROSSOPPORTUNITY", "ID=-1"); } } }
void btnListSave_Click(object sender, EventArgs e) { using (DigiDapter dg = new DigiDapter()) { dg.Add("DESCRIPTION", ListDescription.Text); dg.Add("PERCENTAGE", (ListPercentage.Text.Length > 0)?decimal.Parse(ListPercentage.Text):0); dg.Add("INCREASE", (ListIncrease.Text.Length > 0)?decimal.Parse(ListIncrease.Text):0); dg.Execute("CATALOGPRICELISTDESCRIPTION", "ID=" + ListId.Text); } FillRepeater(); }
public void FillFreeFields(int id, CRMTables crmTables, UserConfig UC) { string sqlStringQuery; sqlStringQuery = "SELECT * FROM ADDEDFIELDS WHERE TABLENAME=" + (byte)crmTables + " ORDER BY VIEWORDER"; DataSet ds = DatabaseConnection.CreateDataset(sqlStringQuery); if (ds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { try { if (Request.Form["Free_" + dr["name"]].Length > 0) { string sqlString; sqlString = "SELECT ID FROM ADDEDFIELDS_CROSS WHERE ID = " + id + " AND IDRIF=" + dr["id"]; using (DigiDapter dg = new DigiDapter(sqlString)) { dg.Add("ID", id); dg.Add("IDRIF", dr["id"]); dg.Add("FIELDVAL", Request.Form["Free_" + dr["name"]]); if (dg.HasRows) { dg.Execute("ADDEDFIELDS_CROSS", "ID = " + id + " AND IDRIF=" + dr["id"]); } else { dg.Execute("ADDEDFIELDS_CROSS", "PKEY = -1"); } } } else { DatabaseConnection.DoCommand("DELETE FROM ADDEDFIELDS_CROSS WHERE ID = " + id + " AND IDRIF=" + dr["id"]); } } catch { } } } }
void btnSaveprj_Click(object sender, EventArgs e) { object newid; using (DigiDapter dg = new DigiDapter()) { dg.Add("TITLE", prjTitle.Text); dg.Add("DESCRIPTION", prjDescription.Text); dg.Add("OWNER", prjOwnerID.Text); dg.Add("PRJOPEN", ((prjOpen.Checked)?1:0)); dg.Add("PRJSUSPEND", ((prjSuspend.Checked) ? 1 : 0)); dg.Add("LASTMODIFIEDDATE", UC.LTZ.ToUniversalTime(DateTime.Now)); dg.Add("LASTMODIFIEDBYID", UC.UserId); if (prjID.Text == "-1") { dg.Add("CREATEDDATE", UC.LTZ.ToUniversalTime(DateTime.Now)); dg.Add("CREATEDBYID", UC.UserId); } if (Request["OtherOwnerID"] != null && Request["OtherOwnerID"].Length > 0) { string otherowner = "|" + Request["OtherOwnerID"]; int other = 1; while (Request["OtherOwnerID_" + other] != null && Request["OtherOwnerID_" + other].Length > 0) { otherowner += "|" + Request["OtherOwnerID_" + other]; other++; } dg.Add("ADMINACCOUNT", otherowner + "|"); } else { dg.Add("ADMINACCOUNT", string.Empty); } dg.Add("GROUPS", "|1|"); newid = dg.Execute("PROJECT", "ID=" + prjID.Text, DigiDapter.Identities.Identity); } if (prjID.Text == "-1") { prjID.Text = newid.ToString(); } ProjectEvents1.prjID = long.Parse(prjID.Text); ProjectEvents1.SaveEvents(); ProjectSectionRelation1.prjID = long.Parse(prjID.Text); ProjectSectionRelation1.SaveRelation(); NewRepeater1.Visible = true; Tabber.Visible = false; FillRepeater(); }
private void RecoverContact(int id) { using (DigiDapter dg = new DigiDapter()) { dg.Add("LASTACTIVITY", 1); //MODIFICA dg.Add("LASTMODIFIEDDATE", DateTime.UtcNow); dg.Add("LASTMODIFIEDBYID", UC.UserId); dg.Add("LIMBO", 0); dg.Execute("BASE_CONTACTS", "ID=" + id); } FillRepeaterC(); }
private void SaveMerged(DataSet ds, int[] checkedArray, int target, string table, int idTarget) { using (DigiDapter dg = new DigiDapter()) { dg.UpdateOnly(); for (int i = 0; i < checkedArray.Length; i++) { dg.Add(ds.Tables[0].Columns[i].ColumnName, ds.Tables[0].Rows[checkedArray[i]][i], 'I'); } dg.Execute(table, "id=" + idTarget); } }
internal static void ToLimbo(int id, int userId, string table) { using (DigiDapter dg = new DigiDapter("SELECT ID,LIMBO,LASTACTIVITY,LASTMODIFIEDDATE,LASTMODIFIEDBYID FROM " + table + " WHERE ID =" + id)) { dg.UpdateOnly(); dg.Add("LIMBO", 1); dg.Add("LASTACTIVITY", 2); dg.Add("LASTMODIFIEDDATE", DateTime.UtcNow); dg.Add("LASTMODIFIEDBYID", userId); dg.Execute(table, "ID =" + id); } }
private void RecoverLead(int id) { using (DigiDapter dg = new DigiDapter()) { dg.UpdateOnly(); dg.Add("LASTACTIVITY", 1); //MODIFICA dg.Add("LASTMODIFIEDDATE", DateTime.UtcNow); dg.Add("LASTMODIFIEDBYID", UC.UserId); dg.Add("LIMBO", 0); dg.Execute("CRM_LEADS", "ID=" + id); } FillLeadRepeater(); }
protected void dgValueEditor_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Add") { using (DigiDapter dg = new DigiDapter()) { dg.Add("DESCRIPTION", ((TextBox)e.Item.FindControl("Newtype")).Text); dg.Add("REQUIREDDATE", ((CheckBox)e.Item.FindControl("NewflagData")).Checked); dg.Execute("QUOTESHIPMENT"); } } LoadGrid(); }
private void ModifyDataSet() { foreach (string li in SelectOffice.GetValueArray) { if (li.Length > 0) { using (DigiDapter dg = new DigiDapter()) { dg.Add("UID", li); dg.Add("UIDINS", UC.UserId); dg.Add("STARTDATE", UC.LTZ.ToUniversalTime(Convert.ToDateTime(F_StartDate.Text + " " + F_StartHour.Text, UC.myDTFI))); dg.Add("ENDDATE", UC.LTZ.ToUniversalTime(Convert.ToDateTime(F_StartDate.Text + " " + F_EndHour.Text, UC.myDTFI))); dg.Add("CONTACT", F_Title.Text); dg.Add("COMPANY", F_Title2.Text); if (CompanyId.Text.Length > 0) { dg.Add("COMPANYID", CompanyId.Text); } if (F_ContactID.Text.Length > 0) { dg.Add("CONTACTID", F_ContactID.Text); } dg.Add("NOTE", F_note.Text); if (CheckSite.Checked) { dg.Add("PLACE", 1); dg.Add("ROOM", Room.Text); } else { dg.Add("PLACE", 0); dg.Add("ADDRESS", Address.Text); dg.Add("CITY", City.Text); dg.Add("PROVINCE", Province.Text); dg.Add("CAP", CAP.Text); } if (CheckRecurrent.Checked) { dg.Add("RECURRID", NewRecurrence()); } if (li == UC.UserId.ToString()) { dg.Add("CONFIRMATION", 1); } Message(int.Parse(li), String.Format(Root.rm.GetString("Meettxt56"), F_StartDate.Text, F_StartHour.Text, F_EndHour.Text), F_Title.Text + "<br>" + F_note.Text, F_Title.Text + "<br>" + F_note.Text); dg.Execute("BASE_CALENDAR"); } } } }
private void Submit_Click(Object sender, EventArgs e) { if (Office.GetValue.Length > 0) { foreach (string im in Office.GetValueArray) { object newMessageId = null; for (int i = 0; i < 2; i++) { using (DigiDapter dg = new DigiDapter()) { dg.Add("SUBJECT", Subject.Text); dg.Add("BODY", Text.Text); dg.Add("FROMACCOUNT", UC.UserId); dg.Add("TOACCOUNT", im); dg.Add("INOUT", i); if (newMessageId == null) { newMessageId = dg.Execute("BASE_MESSAGES", DigiDapter.Identities.Identity); } else { dg.Execute("BASE_MESSAGES"); } } } MessagesHandler.NotifyNewMessage(int.Parse(im), Convert.ToInt32(newMessageId)); } Subject.Text = String.Empty; Text.Text = String.Empty; SomeJS.Text = "<script>opener.location = opener.location;window.close();</script>"; } else { ClientScript.RegisterStartupScript(this.GetType(), "nousers", "<script>alert('" + Root.rm.GetString("Nmstxt12") + "');</script>"); } }
private void ModifyReminderActivity(int id, string data) { using (DigiDapter dg = new DigiDapter()) { dg.Add("OWNERID", ((TextBox)Page.FindControl("TextboxOwnerID")).Text, 'I'); dg.Add("K_ID", id, 'I'); dg.Add("TABLENAME", "CRM_WORKACTIVITY", 'I'); dg.Add("REMINDERDATE", UC.LTZ.ToUniversalTime(Convert.ToDateTime(data, UC.myDTFI))); dg.Add("NOTE", ((TextBox)Page.FindControl("TextBoxSubject")).Text); dg.Add("ADVANCEREMIND", (((DropDownList)Page.FindControl("DropDownListPreAlarm")).SelectedValue.Length > 0) ? ((DropDownList)Page.FindControl("DropDownListPreAlarm")).SelectedValue : "0"); dg.Execute("CRM_REMINDER", "K_ID =" + id + " AND TABLENAME='CRM_WORKACTIVITY' AND OWNERID=" + int.Parse(((TextBox)Page.FindControl("TextboxOwnerID")).Text)); } }
public void Submit_Click(Object sender, EventArgs e) { if (StaticFunctions.IsBlank(ViewState["IDGroup"].ToString()) || (GroupText.Text != null && GroupText.Text.Length == 0)) { return; } if (int.Parse(ViewState["IDGroup"].ToString()) == -1) { if (Convert.ToInt32(DatabaseConnection.SqlScalar(string.Format("SELECT COUNT(*) FROM GROUPS WHERE DESCRIPTION='{0}'", DatabaseConnection.FilterInjection(GroupText.Text)))) > 0) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "officeduplicate", "<script>alert('" + Root.rm.GetString("Duplicate") + "');</script>"); return; } } string sqlString = "SELECT ID FROM GROUPS WHERE ID =" + int.Parse(ViewState["IDGroup"].ToString()); using (DigiDapter dg = new DigiDapter(sqlString)) { dg.Add("DESCRIPTION", GroupText.Text); string dep = "|"; foreach (ListItem im in ListDip.Items) { dep += im.Value.ToString() + "|"; } if (dep.Length < 2) { dep = "|" + UC.AdminGroupId.ToString() + "|"; } if (dep.IndexOf("|" + UC.AdminGroupId.ToString() + "|") < 0) { dep = "|" + UC.AdminGroupId.ToString() + dep; } dg.Add("DEPENDENCY", dep); dg.Execute("GROUPS", "id=" + int.Parse(ViewState["IDGroup"].ToString())); } ViewState["IDGroup"] = "-1"; GroupText.Text = String.Empty; ListDip.Items.Clear(); FillGrid(); FillListGroups(); Groups_Grid.Visible = true; Groups_Table.Visible = false; NewBtn.Visible = true; }
private void ModifyReminder() { string sqlString = "SELECT ID FROM CRM_REMINDER WHERE ID =" + int.Parse(Reminder_ID.Text + " AND TABLENAME='CRM_REMINDER' AND OWNERID=" + UC.UserId); using (DigiDapter dg = new DigiDapter(sqlString)) { if (!dg.HasRows) { dg.Add("OWNERID", UC.UserId, 'I'); dg.Add("K_ID", 0, 'I'); dg.Add("TABLENAME", "CRM_Reminder", 'I'); } dg.Add("REMINDERDATE", UC.LTZ.ToUniversalTime(Convert.ToDateTime(Reminder_Reminder.Text, UC.myDTFI))); dg.Add("NOTE", (Reminder_RemNote.Text.Length > 0) ? Reminder_RemNote.Text : ""); dg.Execute("CRM_Reminder", "id=" + dg.ExternalReaderRowId); } }
void modSave_Click(object sender, EventArgs e) { using (DigiDapter dg = new DigiDapter()) { dg.Add("NAME", txtName.Text); dg.Add("SURNAME", txtSurname.Text); dg.Add("PHONE_1", txtPHONE_1.Text); dg.Add("PHONE_2", txtPHONE_2.Text); dg.Add("MOBILEPHONE_1", txtMobilePhone_1.Text); dg.Add("MOBILEPHONE_2", txtMobilePhone_2.Text); dg.Add("FAX", txtFax.Text); dg.Add("EMAIL", txtEmail.Text); dg.Execute("BASE_CONTACTS", "ID=" + litID.Text); } FillRepeater(); Repeater1.Visible = true; edittable.Visible = false; }
void modSave_Click(object sender, EventArgs e) { using (DigiDapter dg = new DigiDapter()) { dg.Add("COMPANYNAME", txtCompanyName.Text); dg.Add("INVOICINGADDRESS", txtInvoicingAddress.Text); dg.Add("INVOICINGCITY", txtInvoicingCity.Text); dg.Add("INVOICINGSTATEPROVINCE", txtInvoicingStateProvince.Text); dg.Add("INVOICINGZIPCODE", txtInvoicingZipCode.Text); dg.Add("PHONE", txtPhone.Text); dg.Add("FAX", txtFAX.Text); dg.Add("EMAIL", txtEmail.Text); dg.Add("WEBSITE", txtWebSite.Text); dg.Execute("BASE_COMPANIES", "ID=" + litID.Text); } FillRepeater(); Repeater1.Visible = true; edittable.Visible = false; }