Beispiel #1
0
        public void onClicked(object sender, RoutedEventArgs e)
        {
            List <string> batch = new List <string>();

            foreach (DataPair dataPair in this.entryDict)
            {
                if (dataPair.isNew)
                {
                    string s = "INSERT INTO cusfields (cusfields.Value,cusfields.Index,CusID) VALUES('" + FormatFunctions.CleanDateNew(dataPair.Value.Text) + "','" + FormatFunctions.CleanDateNew(dataPair.Index.Text) + "','" + this.customer + "')";
                    batch.Add(s);
                    dataPair.isNew = false;
                }
                else if (!dataPair.Index.Text.Equals(dataPair.Index.GetInit()) || !dataPair.Value.Text.Equals(dataPair.Value.GetInit()))
                {
                    string s = "UPDATE cusfields SET cusfields.Value = '" + FormatFunctions.CleanDateNew(dataPair.Value.Text) + "',cusfields.Index='" + FormatFunctions.CleanDateNew(dataPair.Index.Text) + "' WHERE (IDKey= '" + dataPair.Index.GetInt() + "');";
                    batch.Add(s);
                }
            }
            string sql = "UPDATE cusfields SET cusfields.value='" + FormatFunctions.CleanDateNew(noteLabel.Text) + "' WHERE cusfields.Index LIKE'%otes%' AND CusID= '" + customer + "'";

            batch.Add(sql);
            string sql2 = "UPDATE cusindex SET Name='" + FormatFunctions.CleanDateNew(nameLabel.Text) + "' WHERE IDKey= '" + customer + "'";

            batch.Add(sql2);
            string sql3 = "UPDATE cusfields SET cusfields.value='" + FormatFunctions.CleanDateNew(BookingDate.Text) + "' WHERE cusfields.Index LIKE '%ookin%' AND CusID= '" + customer + "'";

            batch.Add(sql3);
            string sql4 = "UPDATE cusfields SET cusfields.value='" + FormatFunctions.CleanPhone(phoneLabel.Text) + "' WHERE cusfields.Index LIKE '%hone%' AND CusID= '" + customer + "'";

            batch.Add(sql4);
            string sql5 = "UPDATE cusfields SET cusfields.value='" + FormatFunctions.CleanDateNew(DateTime.Now.ToString("yyyy/M/d h:mm:ss")) + "' WHERE cusfields.Index LIKE '%odified On%' AND CusID= '" + customer + "'";//'Modified On','" + FormatFunctions.CleanDateNew(DateTime.Now.ToString("yyyy/M/d h:mm:ss")) + "'

            batch.Add(sql5);
            DatabaseFunctions.SendBatchToPHP(batch);
        }
Beispiel #2
0
        public void onClicked(object sender, RoutedEventArgs e)
        {
            foreach (DataPair dataPair in entryDict)
            {
                if (dataPair.isNew)
                {
                    DatabaseFunctions.SendToPhp(string.Concat(new object[]
                    {
                        "INSERT INTO cusfields (cusfields.Value,cusfields.Index,CusID) VALUES('",
                        FormatFunctions.CleanDateNew(dataPair.Value.Text),
                        "','",
                        FormatFunctions.CleanDateNew(dataPair.Index.Text),
                        "','",
                        this.customer,
                        "')"
                    }));
                    dataPair.isNew = false;
                }
                else if (!dataPair.Index.Text.Equals(dataPair.Index.GetInit()) || !dataPair.Value.Text.Equals(dataPair.Value.GetInit()))
                {
                    DatabaseFunctions.SendToPhp(string.Concat(new object[] { "UPDATE cusfields SET Value = '", FormatFunctions.CleanDateNew(dataPair.Value.Text), "', Cusfields.Index='", FormatFunctions.CleanDateNew(dataPair.Index.Text), "' WHERE (IDKey= '", dataPair.Index.GetInt(), "');" }));
                }
            }
            string sql = "DELETE FROM cusfields WHERE CusID='" + customer + "' AND cusfields.Index='INVOICEFIELD'";

            DatabaseFunctions.SendToPhp(sql);
            foreach (DataPair dp in entryDictQ)
            {
                if (dp.Value.Text != "" && dp.Index.Text != "")
                {
                    string sql2 = "INSERT INTO cusfields(cusfields.Value,cusfields.Index,CusID,cusfields.AdvValue) VALUES ('" + FormatFunctions.CleanDateNew(dp.Value.Text) + "','INVOICEFIELD','" + customer + "','" + FormatFunctions.CleanDateNew(dp.Index.Text) + "')";
                    DatabaseFunctions.SendToPhp(sql2);
                }
            }

            List <string> batch = new List <string>();
            string        sql5  = "UPDATE cusfields SET cusfields.value='" + FormatFunctions.CleanDateNew(DateTime.Now.ToString("yyyy/M/d h:mm:ss")) + "' WHERE cusfields.Index LIKE '%odified On%' AND CusID= '" + customer + "'";//'Modified On','" + FormatFunctions.CleanDateNew(DateTime.Now.ToString("yyyy/M/d h:mm:ss")) + "'

            batch.Add(sql5);
            string sql3 = "UPDATE cusfields SET cusfields.value='" + FormatFunctions.CleanDateNew(contactLabel.Text) + "' WHERE cusfields.Index LIKE '%ookin%' AND CusID= '" + customer + "'";

            batch.Add(sql3);
            string sql4 = "UPDATE cusfields SET cusfields.value='" + FormatFunctions.CleanPhone(phoneLabel.Text) + "' WHERE cusfields.Index LIKE '%hone%' AND CusID= '" + customer + "'";

            batch.Add(sql4);
            string sql6 = "UPDATE cusfields SET cusfields.value='" + salesmen[SalemanCombo.SelectedIndex] + "' WHERE cusfields.Index LIKE '%alesman%' AND CusID= '" + customer + "'";

            batch.Add(sql6);
            string sql7 = "UPDATE cusfields SET cusfields.value='" + FormatFunctions.CleanDateNew(DateTime.Now.ToString("yyyy/M/d h:mm:ss")) + "' WHERE cusfields.Index LIKE '%odified On%' AND CusID= '" + customer + "'";//'Modified On','" + FormatFunctions.CleanDateNew(DateTime.Now.ToString("yyyy/M/d h:mm:ss")) + "'

            batch.Add(sql7);
            string sql8 = "UPDATE cusindex SET Name='" + FormatFunctions.CleanDateNew(nameLabel.Text) + "' WHERE IDKey='" + customer + "'";

            batch.Add(sql8);
            DatabaseFunctions.SendBatchToPHP(batch);
            Install_Page page = new Install_Page(customer, stage);

            ClientData.mainFrame.Navigate(page);
        }
Beispiel #3
0
        public void performSearch3(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));
            string text = "SELECT uniqueid,cnum,cnam,disposition,duration,did,recordingfile,src,calldate FROM asteriskcdrdb.cdr WHERE ";

            foreach (string phone in dictionary["Value"])
            {
                string text2 = FormatFunctions.CleanPhone(phone);
                text = text + "dst LIKE'%" + text2 + "%' OR src LIKE'%" + text2 + "%' OR clid LIKE'%" + text2 + "%' OR cnam LIKE'%" + text2 + "%' OR cnum LIKE'%" + text2 + "%' OR outbound_cnam LIKE'%" + text2 + "%' OR outbound_cnum LIKE'%" + text2 + "%' OR ";
            }
            text  = Regex.Replace(text, "[-()]", "");
            text += "src='-14' ORDER BY calldate DESC LIMIT 500;";
            TaskCallback call = new TaskCallback(this.populateResults);

            DatabaseFunctions.SendToPhp(true, text, call);
        }
Beispiel #4
0
        public void onClickSave(object sender, EventArgs e)
        {
            DateTime      x     = Convert.ToDateTime(LastContact.Text);
            string        sql   = "UPDATE cusfields SET cusfields.Value='" + FormatFunctions.CleanDateNew(Address.Text) + "' WHERE cusfields.Index LIKE '%Address%' AND CusID='" + CusID + "'";
            string        sql2  = "UPDATE cusfields SET cusfields.Value='" + FormatFunctions.CleanPhone(Phone.Text) + "' WHERE cusfields.Index LIKE '%Phone%' AND CusID='" + CusID + "'";
            string        sql3  = "UPDATE cusfields SET cusfields.Value='" + FormatFunctions.CleanDateNew(Email.Text) + "' WHERE cusfields.Index LIKE '%Email%' AND CusID='" + CusID + "'";
            string        sql4  = "UPDATE cusfields SET cusfields.Value='" + FormatFunctions.CleanDateNew(Region.Text) + "' WHERE cusfields.Index LIKE '%Region%' AND CusID='" + CusID + "'";
            string        sql5  = "UPDATE cusfields SET cusfields.Value='" + FormatFunctions.CleanDateNew(x.ToString("yyyy/M/d h:mm:ss")) + "' WHERE cusfields.Index LIKE '%ast Contac%' AND CusID='" + CusID + "'";
            string        sql6  = "UPDATE cusindex SET Name='" + FormatFunctions.CleanDateNew(NameEntry.Text) + "' WHERE IDKey='" + CusID + "'";
            string        sql7  = "UPDATE cusfields SET cusfields.Value='" + FormatFunctions.CleanDateNew(Source.Text) + "' WHERE cusfields.Index LIKE '%Source%' AND CusID='" + CusID + "'";
            string        sql8  = "UPDATE cusfields SET cusfields.value='" + FormatFunctions.CleanDateNew(DateTime.Now.ToString("yyyy/M/d h:mm:ss")) + "' WHERE cusfields.Index LIKE '%odified On%' AND CusID= '" + CusID + "'";//'Modified On','" + FormatFunctions.CleanDateNew(DateTime.Now.ToString("yyyy/M/d h:mm:ss")) + "'
            string        sql9  = "UPDATE cusfields SET cusfields.Value='" + FormatFunctions.CleanDateNew(Postal.Text) + "' WHERE cusfields.Index LIKE '%Postal%' AND CusID='" + CusID + "'";
            List <string> batch = new List <string>()
            {
                sql, sql2, sql3, sql4, sql5, sql6, sql7, sql8, sql9
            };

            DatabaseFunctions.SendBatchToPHP(batch);
        }