private void btnPrintStockReport_Click(object sender, EventArgs e)
        {
            try
            {
                var prds = new List <Product>();
                prds.Add(_frmPrd._prd);

                string rptHeader = "Dealer Name\t\t : " + User.Name + Environment.NewLine
                                   + "Liscence Number\t : " + User.LiscenceNo + Environment.NewLine
                                   + "MR Shop Number\t : "
                                   + User.MrShopNo + Environment.NewLine + Environment.NewLine + Environment.NewLine;

                string rptCriteria = "From " + dtFrom.Value + "To " + dtTo.Value;

                string rptDate      = Environment.NewLine + "Date : " + DateTime.Now.ToLongDateString();
                string rptSignature = "____________________" + Environment.NewLine + "\t Signature";
                StockPrint.PrintForm(
                    prds
                    , rptHeader
                    , rptCriteria
                    , rptDate
                    , rptSignature
                    , "L"
                    , "A3"
                    , "Daily Stock Register"
                    );
            }
            catch (Exception ex)
            {
                Logger.LogError(ex);
            }
        }
Exemplo n.º 2
0
        private void btnStckReportForDefaultProduct_Click(object sender, EventArgs e)
        {
            try
            {
                string rptHeader = "Dealer Name\t\t : " + User.Name + Environment.NewLine
                                   + "Liscence Number\t : " + User.LiscenceNo + Environment.NewLine
                                   + "MR Shop Number\t : "
                                   + User.MrShopNo + Environment.NewLine + Environment.NewLine + Environment.NewLine;

                string rptCriteria = "From " + dtFrom.Value + "To " + dtTo.Value;

                string rptDate      = Environment.NewLine + "Date : " + DateTime.Now.ToLongDateString();
                string rptSignature = "____________________" + Environment.NewLine + "\t Signature";
                StockPrint.PrintForm(
                    MasterData.PrdData.Data.FindAll(i => i.IsDefaultProduct)
                    , rptHeader
                    , rptCriteria
                    , rptDate
                    , rptSignature
                    , "L"
                    , "A3"
                    , "Daily Stock Register"
                    );
            }
            catch (Exception ex)
            {
                Logger.LogError(ex);
            }
        }
Exemplo n.º 3
0
        public async Task TestSendAnErrorStringColor()
        {
            var stockMessage = new StockPrint();

            Printer.APrint printer = new Printer.Error(true, stockMessage);
            string         message = "test";
            await printer.PrintAsync(message);

            Assert.AreEqual(stockMessage.StockPrintMessage, "[Error]: " + message + Environment.NewLine);
        }
Exemplo n.º 4
0
        public async Task TestSendAnInfoStringNoColor()
        {
            var stockMessage = new StockPrint();

            Printer.APrint printer = new Printer.Info(false, stockMessage);
            string         message = "test";
            await printer.PrintAsync(message);

            Assert.AreEqual(stockMessage.StockPrintMessage, message + Environment.NewLine);
        }