Exemple #1
0
        private void SkierMessaging_Shown(object sender, EventArgs e)
        {
            //put a switch in here for args[0], until then assume only Purchase Confirmation
            //for (int i = 1;i=)
            //string[,] ReceiptLines = BuildReceipt("17-100820");
            //EmailAll();
            //set email flag in salesdata
            DataTable SalesUpdates = CF.LoadTable(DW.dwConn, $"SELECT A.TRANSKEY FROM {DW.ActiveDatabase}.salesdata AS A INNER JOIN applications.pmtdata AS B ON A.TRANSKEY=B.TRANSKEY WHERE A.NTRANSTYPE=0 AND A.SALEDATE >='2018-04-17' AND A.TGROUP IN ('EX','SP') AND A.email<>'' AND A.email_send='N' AND B.PMTKEY NOT IN ('120-1','10510','106-1') AND A.DOB<='2000-04-17' GROUP BY A.TRANSKEY", "SalesUpdates");

            if (SalesUpdates != null)
            {
                String CurSales = string.Empty;
                foreach (DataRow tDR in SalesUpdates.Rows)
                {
                    CurSales = CF.AddToList(CurSales, "'" + tDR["transkey"].ToString().Trim() + "'");
                }
                if (CurSales != string.Empty)
                {
                    CF.ExecuteSQL(DW.dwConn, $"UPDATE {DW.ActiveDatabase}.salesdata SET email_send='Y' WHERE TRANSKEY IN ({CurSales})");
                }
            }
            EmailTransactions($"SELECT A.transkey, A.nperskassa, A.npersnr, A.NKASSANR, A.saledate, A.email FROM applications.salesdata AS A INNER JOIN applications.pmtdata AS B ON B.transkey = A.transkey WHERE A.nkassanr NOT IN (3, 20, 21, 22) AND A.email <> '' AND A.email_send = 'Y' AND A.email_sent = 'N' AND A.saledate > '2018-04-17' AND A.tgroup IN ('SP', 'EX') AND B.PTYPE <> 'AR' AND A.DOB <= '2000-04-17' GROUP BY A.SALEDATE, A.email, A.TRANSKEY ORDER BY A.SALEDATE, A.TRANSKEY");
            if (TArgs == null)
            {
                Application.Exit();
            }
        }
Exemple #2
0
        private void POS_Sync_Shown(object sender, EventArgs e)
        {
            ASy.ProgressChanged += AltaSyncProgressChanged;
            LblStartTime.Text    = DateTime.Now.ToString(Mirror.AxessDateTimeFormat);
            SSLStatus.Text       = "Loading POS data";
            SetTaskStatus();
            POSListView.Items.Clear();
            dtpPOSSync.MaxDate = DateTime.Today;
            using (DataTable POSData = CF.LoadTable(AM.MirrorConn, $"SELECT nkassanr, szcomputername, szname FROM {AM.ActiveDatabase}.tabkassakonf WHERE szcomputername LIKE '%alta%' and nkassatypnr = 1 ORDER BY nkassanr", "POSData"))
            {
                foreach (DataRow POSRow in POSData.Rows)
                {
                    POSListView.Items.Add(new ListViewItem(new[] { POSRow["nkassanr"].ToString(), POSRow["szcomputername"].ToString(), POSRow["szname"].ToString() }));
                }
            }

            if (ArgList.Length != 0)
            {
                if (ArgList == "ALL")
                {
                    ArgList = string.Empty;
                    foreach (ListViewItem tItem in POSListView.Items)
                    {
                        ArgList = CF.AddToList(ArgList, tItem.Text);
                        {
                            tItem.Checked = true;
                        }
                    }
                }
                if (ArgList == "PREPAIDS")
                {
                    ASy.FixPrepaids();
                }
                else
                {
                    string[] POS = ArgList.Split(',');
                    foreach (string tPOS in POS)
                    {
                        foreach (ListViewItem tItem in POSListView.Items)
                        {
                            if (tItem.Text == tPOS)
                            {
                                tItem.Checked = true;
                                break;
                            }
                        }
                    }
                    if (!DateTime.TryParse(ArgDateStart, out DateTime StarttDate))
                    {
                        StarttDate = DateTime.Today;
                    }
                    dtpPOSSync.Value = StarttDate;
                    timer1.Interval  = 1000;
                    timer1.Enabled   = true;
                }
            }
            SSLStatus.Text = "";
        }