Esempio n. 1
0
 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;
 }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
 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>");
     }
 }
Esempio n. 4
0
        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 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);
            }
        }
Esempio n. 6
0
        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>";
            }
        }
Esempio n. 7
0
 public void CreateFolder(int subpath, string newfolder)
 {
     using (DigiDapter dg = new DigiDapter())
     {
         dg.Add("DESCRIPTION", newfolder);
         dg.Add("PARENTID", subpath);
     }
 }
Esempio n. 8
0
        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();
        }
Esempio n. 9
0
        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;
        }
Esempio n. 10
0
        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>");
        }
Esempio n. 11
0
 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();
 }
Esempio n. 12
0
 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();
 }
Esempio n. 13
0
 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);
     }
 }
Esempio n. 14
0
 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();
 }
Esempio n. 15
0
 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();
 }
Esempio n. 16
0
        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;
        }
Esempio n. 17
0
        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;
        }
Esempio n. 18
0
        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);
            }
        }
Esempio n. 19
0
        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>");
                }
            }
        }
Esempio n. 20
0
        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);
            }
        }
Esempio n. 21
0
        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");
                }
            }
        }
Esempio n. 22
0
        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 { }
                }
            }
        }
Esempio n. 23
0
 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);
     }
 }
Esempio n. 24
0
        public void Submit_Click(Object sender, EventArgs e)
        {
            using (DigiDapter dg = new DigiDapter())
            {
                dg.Add("SUBJECT", Subject.Text);
                dg.Add("BODY", Text.Text);
                dg.Add("OWNERID", UC.UserId);

                if (groups.GetValue.Length > 0)
                {
                    dg.Add("GROUPS", groups.GetValue);
                }
                else
                {
                    dg.Add("GROUPS", "|" + UC.UserGroupId.ToString() + "|");
                }
                dg.Execute("Base_notes");
            }

            SomeJS.Text = "<script>opener.location = opener.location;window.close();</script>";
        }
Esempio n. 25
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     using (DigiDapter dg = new DigiDapter())
     {
         dg.Add("NPROG", NprogText.Text);
         dg.Add("CHECKDAY", CheckDay.Checked);
         dg.Add("CHECKMONTH", CheckMonth.Checked);
         dg.Add("CHECKYEAR", CheckYear.Checked);
         dg.Add("TWODIGITYEAR", YearDigit.SelectedValue);
         dg.Add("CHECKCUSTOMERCODE", CheckCustomerCode.Checked);
         dg.Add("NPROGSTART", NprogStarttxt.Text);
         dg.Add("NPROGRESTART", NprogRestart.SelectedValue);
         dg.Add("DISABLED", CheckDisabled.Checked);
         dg.Add("TYPE", (byte)NumberType);
         object newid = dg.Execute("QUOTENUMBERS", "ID=" + litId.Text, DigiDapter.Identities.Identity);
         if (dg.RecordInserted)
         {
             litId.Text = newid.ToString();
         }
     }
 }
Esempio n. 26
0
        public void SaveEvents()
        {
            if (Request["EventTxt"] != null && Request["EventTxt"].Length > 0)
            {
                using (DigiDapter dg = new DigiDapter())
                {
                    dg.Add("DESCRIPTION", Request["EventTxt"]);
                    dg.Add("EVENTDATE", UC.LTZ.ToUniversalTime(Convert.ToDateTime(Request["EventDate"], UC.myDTFI)));
                    dg.Add("PROJECTID", prjID);
                    dg.Add("SECTIONID", long.Parse(Request["EventSection"]));
                    dg.Execute("PROJECT_EVENTS", "ID=" + Request["EventId"]);
                }

                int other = 1;
                while (Request["EventTxt_" + other] != null && Request["EventTxt_" + other].Length > 0)
                {
                    using (DigiDapter dg = new DigiDapter())
                    {
                        dg.Add("DESCRIPTION", Request["EventTxt_" + other]);
                        dg.Add("EVENTDATE", UC.LTZ.ToUniversalTime(Convert.ToDateTime(Request["EventDate_" + other], UC.myDTFI)));
                        dg.Add("PROJECTID", prjID);
                        dg.Add("SECTIONID", long.Parse(Request["EventSection_" + other]));
                        dg.Execute("PROJECT_EVENTS", "ID=" + Request["EventId_" + other]);
                    }
                    other++;
                }
            }

            if (Request["EventToDelete"] != null && Request["EventToDelete"].Length > 0)
            {
                string[] ids = Request["EventToDelete"].Split('|');
                foreach (string id in ids)
                {
                    if (id.Length > 0)
                    {
                        DatabaseConnection.DoCommand("DELETE FROM PROJECT_EVENTS WHERE ID=" + id);
                    }
                }
            }
        }
Esempio n. 27
0
        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>");
            }
        }
Esempio n. 28
0
 protected void btnSave_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 QUOTESHIPMENT WHERE ID={0}", ((Literal)di.FindControl("rowid")).Text));
             }
             else
             {
                 using (DigiDapter dg = new DigiDapter())
                 {
                     dg.Add("DESCRIPTION", ((TextBox)di.FindControl("type")).Text);
                     dg.Add("REQUIREDDATE", ((CheckBox)di.FindControl("flagData")).Checked);
                     dg.Execute("QUOTESHIPMENT", "ID=" + ((Literal)di.FindControl("rowid")).Text);
                 }
             }
         }
     }
     LoadGrid();
 }
Esempio n. 29
0
        private void SaveTemplate_Click(object sender, EventArgs e)
        {
            TemplateAdmin ta = new TemplateAdmin();

            string[] s = new string[1];
            s[0] = FreeText.Text;
            string body = ta.GetXMLBody(s);

            string sqlString;

            sqlString = "SELECT ID FROM TEMPLATES WHERE TEMPLATENAME = 'ESTIMATE'";
            using (DigiDapter dg = new DigiDapter(sqlString))
            {
                if (dg.HasRows)
                {
                    dg.Add("TEMPLATENAME", "ESTIMATE", 'I');
                    dg.Add("LANG", UC.CultureSpecific, 'I');
                }
                if (NomeFile.Value.Length > 0)
                {
                    string PathTemplate;
                    PathTemplate = Path.Combine(Request.PhysicalApplicationPath, "Logos");
                    if (File.Exists(Path.Combine(PathTemplate, Path.GetFileName(NomeFile.Value))))
                    {
                        File.Delete(Path.Combine(PathTemplate, Path.GetFileName(NomeFile.Value)));
                    }

                    NomeFile.PostedFile.SaveAs(Path.Combine(PathTemplate, Path.GetFileName(NomeFile.Value)));
                    dg.Add("LOGO", Path.GetFileName(NomeFile.Value));
                }

                dg.Add("BODY", body);

                dg.Execute("TEMPLATES", "ID=" + dg.ExternalReaderRowId);
            }
            Response.Redirect("/estimates/estimatehome.aspx");
        }
Esempio n. 30
0
        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;
        }