Exemplo n.º 1
0
        private void frmEndShift_Load(object sender, EventArgs e)
        {
            userid = UserLoginModel.UserLoginInfo.StaffID;

            if (userid == 0)
            {
                Form1 frm = new Form1();
                this.Close();
                frm.ShowDialog();
            }
            else
            {
                if (modelShift != null)
                {
                    MoneyFortmat Fomat = new MoneyFortmat(1);

                    this.txtShiftName.Text = modelShift.ShiftName ?? "";
                    this.txtStaffName.Text = modelShift.UserName ?? "";
                    this.txtStartTime.Text = (modelShift.StartShift ?? DateTime.Now).ToString("dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture);
                    this.txtEndTime.Text   = DateTime.Now.ToString("dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture);
                    this.txtCashStart.Text = Fomat.getValue(modelShift.CashStart ?? 0).ToString("C");
                    this.txtCashEnd.Text   = Fomat.getValue(modelShift.CashEnd ?? 0).ToString("C");
                    this.txtSafeDrop.Text  = Fomat.getValue(modelShift.SafeDrop ?? 0).ToString("C");
                }
            }
        }
Exemplo n.º 2
0
        public void addOnDutyList(string lblName, int i)
        {
            try
            {
                flpShiftDetail.Controls.Clear();

                if (i == 1)
                {
                    this.btnAdd.Show();
                    this.btnEnd.Show();
                    var data = ShiftService.GetListShiftHistoryByUserid(userid, 0).ToList();

                    double totalsafe = 0;

                    foreach (var item in data)
                    {
                        var ucShift = new UCShiftItem();

                        //ucShift.Dock = DockStyle.Fill;
                        MoneyFortmat Fomat = new MoneyFortmat(1);

                        totalsafe = totalsafe + item.SafeDrop ?? 0;

                        ucShift.lblNo.Text    = item.ShiftName;
                        ucShift.lblStaff.Text = item.UserName;
                        ucShift.lblStart.Text = (item.StartShift ?? DateTime.Now).ToString("dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture);
                        ucShift.lblEnd.Text   = " ";
                        if (item.EndShift != null)
                        {
                            ucShift.lblEnd.Text = (item.EndShift ?? DateTime.Now).ToString("dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture);
                        }
                        ucShift.lblCashstart.Text = Fomat.getValue(item.CashStart ?? 0).ToString("C");
                        ucShift.lblCashend.Text   = Fomat.getValue(item.CashEnd ?? 0).ToString("C");
                        ucShift.lblSfaedrop.Text  = Fomat.getValue(item.SafeDrop ?? 0).ToString("C");

                        ucShift.Size = new System.Drawing.Size(flpShiftDetail.Width - 5, ucShift.Height);

                        ucShift.Tag    = item;
                        ucShift.Click += UCShiftItem_Click;
                        ucShift.Width  = flpShiftDetail.Width;
                        flpShiftDetail.Controls.Add(ucShift);
                    }

                    this.lblTotalSafeDrop.Text = totalsafe.ToString("C");
                }
                else
                {
                    flpShiftDetail.Controls.Clear();
                }
            }
            catch (Exception ex)
            {
                SystemLog.LogPOS.WriteLog("frmShift::::::::::::::::addOnDutyList:::::::::::::" + ex.Message);
            }
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        private void frmEndShift_Load(object sender, EventArgs e)
        {
            userid = UserLoginModel.UserLoginInfo.StaffID;

            var modelShift = ShiftService.GetListShiftHistoryByUserid(userid, 0).FirstOrDefault();

            if (userid == 0)
            {
                Form1 frm = new Form1();
                this.Close();
                frm.ShowDialog();
            }
            else
            {
                if (modelShift != null)
                {
                    MoneyFortmat Fomat = new MoneyFortmat(1);
                    shiftid = modelShift.ShiftHistoryID;

                    this.txtShiftName.Text = modelShift.ShiftName ?? "";
                    this.txtStaffName.Text = modelShift.UserName ?? "";
                    this.txtStartTime.Text = (modelShift.StartShift ?? DateTime.Now).ToString("dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture);
                    this.txtCashStart.Text = Fomat.getValue(modelShift.CashStart ?? 0).ToString("C");
                }
                else
                {
                    frmMessager frm = new frmMessager("Messenger", "Please create new shift. ");
                    this.Close();
                    frm.ShowDialog();
                }
            }
        }
Exemplo n.º 5
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;
        }
Exemplo n.º 6
0
        public void addHistoryList(string lblName, int i)
        {
            if (i == 2)
            {
                this.btnAdd.Hide();
                this.btnEnd.Hide();
                var data = ShiftService.GetListShiftHistoryByUserid(userid, 1).ToList();

                double totalsafe = 0;

                foreach (var item in data)
                {
                    var ucShift = new UCShiftItem();

                    //ucShift.Dock = DockStyle.Fill;

                    totalsafe = totalsafe + item.SafeDrop ?? 0;
                    MoneyFortmat Fomat = new MoneyFortmat(1);

                    ucShift.lblNo.Text    = item.ShiftName;
                    ucShift.lblStaff.Text = item.UserName;
                    ucShift.lblStart.Text = (item.StartShift ?? DateTime.Now).ToString("dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture);
                    ucShift.lblEnd.Text   = " ";
                    if (item.EndShift != null)
                    {
                        ucShift.lblEnd.Text = (item.EndShift ?? DateTime.Now).ToString("dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture);
                    }
                    ucShift.lblCashstart.Text = Fomat.getValue(item.CashStart ?? 0).ToString("C");
                    ucShift.lblCashend.Text   = Fomat.getValue(item.CashEnd ?? 0).ToString("C");
                    ucShift.lblSfaedrop.Text  = Fomat.getValue(item.SafeDrop ?? 0).ToString("C");

                    ucShift.Size = new System.Drawing.Size(flpShiftDetail.Width - 5, ucShift.Height);

                    flpShiftDetail.Controls.Add(ucShift);
                }

                this.lblTotalSafeDrop.Text = totalsafe.ToString("C");
            }
            else
            {
                flpShiftDetail.Controls.Clear();
            }
        }
Exemplo n.º 7
0
        private void frmNewShift_Load(object sender, EventArgs e)
        {
            userid = UserLoginModel.UserLoginInfo.StaffID;

            if (userid == 0)
            {
                Form1 frm = new Form1();
                this.Close();
                frm.ShowDialog();
            }
            else
            {
                fname = UserLoginModel.UserLoginInfo.UserName;

                var historyshift = ShiftService.GetListShiftHistoryByUserid(userid, 1).FirstOrDefault();

                double startcash = 0;
                if (historyshift != null)
                {
                    startcash = (historyshift.CashEnd ?? 0) - (historyshift.SafeDrop ?? 0);
                }

                MoneyFortmat Fomat = new MoneyFortmat(1);
                startcash = Fomat.getValue(startcash);

                var data = ShiftService.GetAllStaffActive().ToList();

                this.cbStaff.DisplayMember = "Value";
                this.cbStaff.ValueMember   = "Key";

                foreach (var item in data)
                {
                    var temp = new KeyValueModel();
                    temp.Key   = item.StaffID;
                    temp.Value = item.UserName;
                    this.cbStaff.Items.Add(temp);
                }

                this.cbStaff.Text      = fname;
                this.txtCashStart.Text = startcash.ToString();
            }
        }
Exemplo n.º 8
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;
        }
Exemplo n.º 9
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);
            }
        }