Esempio n. 1
0
        private void MonthlySales()
        {
            dynamic stDay    = mod_system.GetFirstDate(monCal.SelectionStart);
            dynamic laDay    = mod_system.GetLastDate(monCal.SelectionEnd);
            string  fillData = "dsSalesDaily";

            string mysql = "SELECT customer_order.ID,customer_order.ORDERNUM,customer_order.ORDERDATE, ";

            mysql += "customer_order.QSTATUS,customer_order.QUEUEID,customer_order.MENUID, ";
            mysql += "customer_order.QTY,customer_order.MENUNAME,customer_order.MENUTYPE, ";
            mysql += "customer_order.MENUSIZE,customer_order.PRICE,customer_order.CASH, ";
            mysql += "customer_order.AMOUNTDUE,customer_order.`CHANGE`, ";
            mysql += "DATE_FORMAT(DOCDATE,'%m/%d/%Y')as 'DOCDATE', ";
            mysql += "customer_order.QIID,customer_order.QIStatus,customer_order.BOStatus ";
            mysql += "FROM customer_order ";
            mysql += string.Format("where DATE_FORMAT(DOCDATE,'%m/%d/%Y') BETWEEN '" + stDay + "' AND '" + laDay + "'");
            mysql += " AND BOStatus = 1 AND QIStatus = 1";

            Dictionary <string, string> rptPara = new Dictionary <string, string>();

            rptPara.Add("txtDate", "FOR THE MONTH OF " + stDay.ToString("MMMM") + " " + stDay.Year);
            rptPara.Add("IsDailyMonthly", "Monthly Sales Report");

            frmReport frm = new frmReport();

            frm.ReportInit(mysql, fillData, @"Report\rptSalesReport.rdlc", rptPara);
            frm.Show();
        }
Esempio n. 2
0
        private void DailySales()
        {
            string fillData = "dsSalesDaily";

            string mysql = "SELECT customer_order.ID,customer_order.ORDERNUM,customer_order.ORDERDATE, ";

            mysql += "customer_order.QSTATUS,customer_order.QUEUEID,customer_order.MENUID, ";
            mysql += "customer_order.QTY,customer_order.MENUNAME,customer_order.MENUTYPE, ";
            mysql += "customer_order.MENUSIZE,customer_order.PRICE,customer_order.CASH, ";
            mysql += "customer_order.AMOUNTDUE,customer_order.`CHANGE`, ";
            mysql += "DATE_FORMAT(DOCDATE,'%m/%d/%Y')as 'DOCDATE', ";
            mysql += "customer_order.QIID,customer_order.QIStatus,customer_order.BOStatus ";
            mysql += "FROM customer_order ";
            mysql += string.Format("where DATE_FORMAT(DOCDATE,'%m/%d/%Y')= '{0}'", monCal.SelectionStart.ToShortDateString());
            mysql += " AND BOStatus = 1 AND QIStatus = 1";

            Dictionary <string, string> rptPara = new Dictionary <string, string>();

            rptPara.Add("txtDate", "Date: " + monCal.SelectionStart.ToString("MMM dd, yyyy"));
            rptPara.Add("IsDailyMonthly", "Daily Sales Report");

            frmReport frm = new frmReport();

            frm.ReportInit(mysql, fillData, @"Report\rptSalesReport.rdlc", rptPara);
            frm.Show();
        }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            string mysql    = "Select * From tblMenu";
            string rpt_Path = "Report\rpt_Menu.rdlc";
            //if (Application.OpenForms["frmReport"] != null)
            //{
            //    (Application.OpenForms["frmReport"] as frmReport).ReportInit(mysql,"dsMenuItem",rpt_Path);
            //    (Application.OpenForms["frmReport"] as frmReport).Show();
            //}

            frmReport tmp = new frmReport();

            tmp.ReportInit(mysql, "dsMenuItem", rpt_Path);
            tmp.Show();
        }
        private void PrintOR(int queueID)
        {
            System.Threading.Thread.Sleep(2000);
            // Check if able to print

            Printer = tmpMaintenance.GetValue("PrinterReciept");
            IsPrint = tmpMaintenance.GetValue("IsRecieptPrint");
            if (!canPrint(Printer))
            {
                return;
            }

            string mysql = "SELECT * FROM customer_order WHERE QUEUEID = " + queueID + " and QIStatus =1";

            DataSet ds       = null;
            string  fillData = "TBLQUEUE";

            ds = Database.LoadSQL(mysql, fillData);

            string   OrderNum = String.Format("ORDER # 0000{0}", ds.Tables[0].Rows[0]["ORDERNUM"].ToString());
            DateTime DocDate  = Convert.ToDateTime(System.DateTime.Now);

            // Declare AutoPrint
            Reporting   autoPrint = null;
            LocalReport report    = new LocalReport();

            autoPrint = new Reporting();

            // Initialize Auto Print
            report.ReportPath = @"Report\rptReciept.rdlc";
            report.DataSources.Add(new ReportDataSource(fillData, ds.Tables[fillData]));

            // Assign Parameters
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("txtUsername", mod_system.ORuser.Username);

            // Importer Parameters
            if ((dic != null))
            {
                foreach (KeyValuePair <string, string> param in dic)
                {
                    var             nPara   = param;
                    ReportParameter tmpPara = new ReportParameter();
                    tmpPara.Name = nPara.Key;
                    tmpPara.Values.Add(nPara.Value);
                    report.SetParameters(new ReportParameter[] { tmpPara });
                    Console.WriteLine(string.Format("{0}: {1}", nPara.Key, nPara.Value));
                }
            }


            if (IsPrint == "YES")
            {
                frmReport frm = new frmReport();
                frm.ReportInit(mysql, "dsORPRINT", @"Report\rptReciept.rdlc", dic);
                frm.Show();
            }
            else
            {
                // Executing Auto Print
                autoPrint.Export(report);
                autoPrint.m_currentPageIndex = 0;
                autoPrint.Print(Printer);
            }
        }