예제 #1
0
        private void ExportExcel_Click(object sender, EventArgs e)
        {
            Button ucReportItem = (Button)sender;
            List <ExportExcelToDataTable> tag = (List <ExportExcelToDataTable>)(ucReportItem.Tag);

            if (tag != null)
            {
                ExportExcelToDataTable.WriteExcelToFrom(tag);
            }
        }
예제 #2
0
        public void AddDataPrinter()
        {
            MoneyFortmat Fomat = new MoneyFortmat(1);

            DataPrinter = new List <ExportExcelToDataTable>();

            var temp1 = new ExportExcelToDataTable();

            temp1.Tilte = "Shift Name";
            temp1.Value = modelShift.ShiftName ?? "";
            DataPrinter.Add(temp1);

            var temp2 = new ExportExcelToDataTable();

            temp2.Tilte = "Staff Name";
            temp2.Value = modelShift.UserName ?? "";
            DataPrinter.Add(temp2);

            var temp3 = new ExportExcelToDataTable();

            temp3.Tilte = "Start Time";
            temp3.Value = (modelShift.StartShift ?? DateTime.Now).ToString("dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture);
            DataPrinter.Add(temp3);

            var temp4 = new ExportExcelToDataTable();

            temp4.Tilte = "End Time";
            temp4.Value = DateTime.Now.ToString("dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture);
            DataPrinter.Add(temp4);

            var temp5 = new ExportExcelToDataTable();

            temp5.Tilte = "Cash Start";
            temp5.Value = Fomat.getValue(modelShift.CashStart ?? 0).ToString("C");
            DataPrinter.Add(temp5);

            var temp6 = new ExportExcelToDataTable();

            temp6.Tilte = "Cash End";
            temp6.Value = Fomat.getValue(modelShift.CashEnd ?? 0).ToString("C");
            DataPrinter.Add(temp6);

            var temp7 = new ExportExcelToDataTable();

            temp7.Tilte = "Safe Drop";
            temp7.Value = Fomat.getValue(modelShift.SafeDrop ?? 0).ToString("C");
            DataPrinter.Add(temp7);
        }
예제 #3
0
        private void LoadReportWeeklyAccountSaleDetail()
        {
            pDetail.Controls.Clear();
            UCDailySaleQTYReport UCQTYReport = new UCDailySaleQTYReport();

            UCQTYReport.Dock = DockStyle.Fill;

            pDetail.Controls.Add(UCQTYReport);

            var dateselect = Convert.ToDateTime(dateSelect.Text).ToString("yyyy-MM-dd");

            var data = ReportService.GetDataAccountSaleReport(dateselect, 1).ToList();

            var export = new List <ExportExcelToDataTable>();
            var i      = 1;

            foreach (var item in data)
            {
                UCItemReport ucitem = new UCItemReport();

                ucitem.lbname.Text = item.FullName;

                var fomat = new MoneyFortmat(1);

                ucitem.lbtotal.Text = fomat.getValue(item.Total).ToString("C");

                var temp = new ExportExcelToDataTable();
                temp.Tilte = item.FullName;
                temp.Value = fomat.getValue(item.Total).ToString("N2");
                export.Add(temp);

                ucitem.Size = new System.Drawing.Size(UCQTYReport.PDetail.Width - 5, ucitem.Height);

                if (i % 2 == 0)
                {
                    ucitem.BackColor = Color.FromArgb(221, 221, 221);
                }

                UCQTYReport.PDetail.Controls.Add(ucitem);
                i++;
            }
            UCQTYReport.btnExport.Tag    = export;
            UCQTYReport.btnExport.Click += ExportExcel_Click;

            UCQTYReport.btnPrint.Tag    = export;
            UCQTYReport.btnPrint.Click += PrinterClick_Click;
        }
예제 #4
0
        public void SetDataSummary(UCDailySaleSumaryReport ucDailyReport, DailyReportModel data)
        {
            var fomat = new MoneyFortmat(1);

            ucDailyReport.lblNetSalse.Text = fomat.getValue(data.NetSale).ToString("C");
            Double gst = Convert.ToDouble(data.NetSale) / 11000;

            if (gst < 1)
            {
                ucDailyReport.lblGST.Text = "$0" + money.Format2(Convert.ToDouble(data.NetSale) / 11);
            }
            else
            {
                ucDailyReport.lblGST.Text = "$" + money.Format2(Convert.ToDouble(data.NetSale) / 11);
            }

            ucDailyReport.lblDiscount.Text     = fomat.getValue(data.Discount).ToString("C");
            ucDailyReport.lblRefund.Text       = fomat.getValue(data.Refund).ToString("C");
            ucDailyReport.lblTotakReceiva.Text = "$" +
                                                 fomat.getValue(data.NetSale + data.GST - data.Discount).ToString("N2");
            ucDailyReport.lblTotakCash.Text    = "$" + fomat.getValue(data.CashTotal).ToString("N2");
            ucDailyReport.lblTotalCard.Text    = fomat.getValue(data.CardTotal).ToString("C");
            ucDailyReport.lblTotalAccount.Text = fomat.getValue(data.AccountTotal).ToString("C");

            var export = new List <ExportExcelToDataTable>();

            var temp1 = new ExportExcelToDataTable();

            temp1.Tilte = "Net Sale";
            temp1.Value = "$" + fomat.getValue(data.NetSale).ToString("N2");
            export.Add(temp1);

            var temp2 = new ExportExcelToDataTable();

            temp2.Tilte = "GST";
            if (gst < 1)
            {
                temp2.Value = "$0" + money.Format2(Convert.ToDouble(data.NetSale) / 11);
            }
            else
            {
                temp2.Value = "$" + money.Format2(Convert.ToDouble(data.NetSale) / 11);
            }

            export.Add(temp2);

            var temp3 = new ExportExcelToDataTable();

            temp3.Tilte = "Discount";
            temp3.Value = "$" + fomat.getValue(data.Discount).ToString("N2");
            export.Add(temp3);

            var temp4 = new ExportExcelToDataTable();

            temp4.Tilte = "Refund";
            temp4.Value = "$" + fomat.getValue(data.Refund).ToString("N2");
            export.Add(temp4);

            var temp5 = new ExportExcelToDataTable();

            temp5.Tilte = "Total Receivable";
            temp5.Value = "$" + fomat.getValue(data.NetSale + data.GST - data.Discount).ToString("N2");
            export.Add(temp5);

            var temp6 = new ExportExcelToDataTable();

            temp6.Tilte = "Total CASH";
            temp6.Value = "$" + fomat.getValue(data.CashTotal).ToString("N2");
            export.Add(temp6);

            var temp7 = new ExportExcelToDataTable();

            temp7.Tilte = "Total CARD";
            temp7.Value = "$" + fomat.getValue(data.CardTotal).ToString("N2");
            export.Add(temp7);

            var temp8 = new ExportExcelToDataTable();

            temp8.Tilte = "Total ACCOUNT";
            temp8.Value = "$" + fomat.getValue(data.AccountTotal).ToString("N2");
            export.Add(temp8);



            ucDailyReport.btnExport.Tag    = export;
            ucDailyReport.btnExport.Click += ExportExcel_Click;

            ucDailyReport.btnPrint.Tag    = export;
            ucDailyReport.btnPrint.Click += PrinterClick_Click;
        }
예제 #5
0
        private void LoadShiftReportDetail(ShiftReportModel data)
        {
            if (data != null)
            {
                pDetail.Controls.Clear();
                UCShiftReport shift = new UCShiftReport();
                shift.Dock = DockStyle.Fill;

                var fomat = new MoneyFortmat(1);

                shift.lblShiftNo.Text   = data.ShiftName ?? "";
                shift.lblStaff.Text     = data.UserName ?? "";
                shift.lblStartTime.Text = (data.StartShift ?? DateTime.Now).ToString("dd/MM/yyyy hh:mm:ss",
                                                                                     CultureInfo.InvariantCulture);
                shift.lblEndTime.Text = (data.EndShift ?? DateTime.Now).ToString("dd/MM/yyyy hh:mm:ss",
                                                                                 CultureInfo.InvariantCulture);
                shift.lblStartCash.Text = "$" + fomat.getValue(data.CashStart).ToString("N2");
                shift.lblEndCash.Text   = "$" + fomat.getValue(data.CashEnd).ToString("N2");
                shift.lblSafeDrop.Text  = "$" + fomat.getValue(data.SafeDrop).ToString("N2");
                shift.lblTotal.Text     = "$" + fomat.getValue(data.TotalCash).ToString("N2");
                shift.lblVariation.Text = "$" +
                                          fomat.getValue(data.CashEnd - data.CashStart - data.TotalCash).ToString("N2");
                shift.lblTotalNetSalse.Text = "$" + fomat.getValue(data.TotalSale).ToString("N2");


                var export = new List <ExportExcelToDataTable>();

                var temp1 = new ExportExcelToDataTable();
                temp1.Tilte = "Shift No";
                temp1.Value = data.ShiftName ?? "";
                export.Add(temp1);

                var temp2 = new ExportExcelToDataTable();
                temp2.Tilte = "Staff";
                temp2.Value = data.UserName ?? "";
                export.Add(temp2);

                var temp3 = new ExportExcelToDataTable();
                temp3.Tilte = "Start Time";
                temp3.Value = (data.StartShift ?? DateTime.Now).ToString("dd/MM/yyyy hh:mm:ss",
                                                                         CultureInfo.InvariantCulture);
                export.Add(temp3);

                var temp4 = new ExportExcelToDataTable();
                temp4.Tilte = "End Time";
                temp4.Value = (data.EndShift ?? DateTime.Now).ToString("dd/MM/yyyy hh:mm:ss",
                                                                       CultureInfo.InvariantCulture);
                export.Add(temp4);

                var temp5 = new ExportExcelToDataTable();
                temp5.Tilte = "Start Cash(Cash float in)";
                temp5.Value = fomat.getValue(data.CashStart).ToString("N2");
                export.Add(temp5);

                var temp6 = new ExportExcelToDataTable();
                temp6.Tilte = "End Cash(Counted by Staff)";
                temp6.Value = fomat.getValue(data.CashEnd).ToString("N2");
                export.Add(temp6);

                var temp7 = new ExportExcelToDataTable();
                temp7.Tilte = "Total Cash by Report";
                temp7.Value = fomat.getValue(data.TotalCash).ToString("N2");
                export.Add(temp7);

                var temp8 = new ExportExcelToDataTable();
                temp8.Tilte = "Variation";
                temp8.Value = fomat.getValue(data.CashEnd - data.CashStart - data.TotalCash).ToString("N2");
                export.Add(temp8);

                var temp9 = new ExportExcelToDataTable();
                temp9.Tilte = "Safe drop";
                temp9.Value = fomat.getValue(data.SafeDrop).ToString("N2");
                export.Add(temp9);

                var temp10 = new ExportExcelToDataTable();
                temp10.Tilte = "Total Net Sale by Shift";
                temp10.Value = fomat.getValue(data.TotalSale).ToString("N2");
                export.Add(temp10);

                shift.btnExport.Tag    = export;
                shift.btnExport.Click += ExportExcel_Click;

                shift.btnPrint.Tag    = export;
                shift.btnPrint.Click += PrinterClick_Click;


                pDetail.Controls.Add(shift);
            }
        }