コード例 #1
0
        public ActionResult FindPageList(int page = 1, int rows = 30)
        {
            int count = 0;
            var list  = ReceiptsBLL.FindPageList(Request.Params, out count);

            return(ToDataGrid(list, count));
        }
コード例 #2
0
        public ActionResult Save(string id)
        {
            ViewBag.types = ListToSelect(SysDataDictService.GetReceiptsCategories().Select(o => new SelectListItem()
            {
                Value = o.DicSN.ToString(), Text = o.Title
            }), emptyTitle: "请选择");
            var obj = new Receipts()
            {
                CreateTitle = Sys.CurrentUser.FullName, CreateDT = DateTime.Now
            };

            if (!id.IsNullOrEmpty())
            {
                obj = ReceiptsBLL.FindById(id);
                obj.IsNullThrow();
                if (obj.Source == 1)
                {
                    var user = UserInfoService.Find(o => o.UID == obj.CreateUID);
                    if (user != null)
                    {
                        obj.CreateTitle = user.FullName;
                    }
                }
                else
                {
                    var supplier = SupplierService.Find(o => o.Id == obj.CreateUID);
                    if (supplier != null)
                    {
                        obj.CreateTitle = supplier.Title;
                    }
                }
            }
            return(View(obj));
        }
コード例 #3
0
        private void frmManageReceip_Load(object sender, EventArgs e)
        {
            // khởi tạo các đối tượng
            receBLL = new ReceiptsBLL();

            Load_Loc();
        }
コード例 #4
0
        public ActionResult Auditor(string ids)
        {
            var sId  = ids.Split(',');
            var list = ReceiptsBLL.FindList(o => sId.Contains(o.Id));

            list.Each(o => { o.State = (short)ReceipState.已审核; });
            var re = ReceiptsBLL.Update(list);

            return(new JsonNetResult(re));
        }
コード例 #5
0
ファイル: frmMemberReceipt.cs プロジェクト: luan-cs/API
        private void LoadDataMember(string memberid)
        {
            rcpBll = new ReceiptsBLL();
            DataTable dt = rcpBll.GetMemberInfo(memberid);

            if (dt != null && dt.Rows.Count > 0)
            {
                ///                `members`.`MemberId`,
                ///                `members`.`MemberCode`,
                ///                `members`.`ObjectId`,
                ///                `members`.`NumberOfVissits`,
                ///                `members`.`LastestDate`,
                ///                `members`.`MemberType`,
                ///                `members`.`MemberScore`,
                ///                `objects`.`ObjectGroup`,
                ///                `objects`.`ObjectType`,
                ///                `objects`.`Tel`,
                ///                `objects`.`Email`,
                ///                `objects`.`Gender`,
                ///                `objects`.`FullName`,
                ///                `objects`.`TemAdd`
                string str = "";
                str = str + "\n" + Common.clsLanguages.GetResource("MemberID") + ": " + dt.Rows[0]["MemberId"].ToString() + " - " + dt.Rows[0]["MemberCode"].ToString();
                str = str + "\n" + Common.clsLanguages.GetResource("CustomerName") + ": " + dt.Rows[0]["MemberName"].ToString();
                str = str + "\n" + Common.clsLanguages.GetResource("Address") + ": " + dt.Rows[0]["Address"].ToString();
                str = str + "\n" + Common.clsLanguages.GetResource("Phone") + ": " + dt.Rows[0]["PhoneNumber"].ToString();
                str = str + "\n" + Common.clsLanguages.GetResource("NumberOfVissits") + ": " + dt.Rows[0]["NumberOfVissits"].ToString();
                str = str + "\n" + Common.clsLanguages.GetResource("LastestDate") + ": " + dt.Rows[0]["LastestDate"].ToString();
                str = str + "\n" + Common.clsLanguages.GetResource("Points") + ": " + dt.Rows[0]["CurrentScore"].ToString();
                lblProductName.Text = str;
                mbid                           = memberid;
                Program.rep_mb                 = new ReceiptMember();
                Program.rep_mb.MemberId        = dt.Rows[0]["MemberId"].ToString();
                Program.rep_mb.CreatedBy       = Program.Username;
                Program.rep_mb.MemberCode      = dt.Rows[0]["MemberCode"].ToString();
                Program.rep_mb.NumberOfVissits = dt.Rows[0]["NumberOfVissits"].ToString();
                Program.rep_mb.LastestDate     = dt.Rows[0]["LastestDate"].ToString();
                Program.rep_mb.MemberType      = null;
                Program.rep_mb.Tel             = dt.Rows[0]["PhoneNumber"].ToString();
                Program.rep_mb.Email           = dt.Rows[0]["Email"].ToString();
                Program.rep_mb.FullName        = dt.Rows[0]["MemberName"].ToString();
                Program.rep_mb.TemAdd          = dt.Rows[0]["Address"].ToString();
                Program.rep_mb.MemberScore     = dt.Rows[0]["CurrentScore"].ToString();
            }
            else
            {
                mbid           = "";
                Program.rep_mb = null;
                CustomMessageBox.MessageBox.ShowCustomMessageBox(clsLanguages.GetResource("NotFoundCustomerCode"),
                                                                 clsLanguages.GetResource("Information"),
                                                                 Config.CUSTOM_MESSAGEBOX_ICON.Information,
                                                                 Config.CUSTOM_MESSAGEBOX_BUTTON.OK);
            }
        }
コード例 #6
0
ファイル: frmManageBankCard.cs プロジェクト: luan-cs/API
        private void LoadBank()
        {
            receiptsBLL = new ReceiptsBLL();
            DataTable dt = receiptsBLL.GetBank();
            Dictionary <string, string> test = new Dictionary <string, string>();

            test.Add("000", VVPosS.Common.clsLanguages.GetResource("Gender_null"));
            foreach (DataRow dr in dt.Rows)
            {
                test.Add(dr["CommonId"].ToString(), dr["StrValue1"].ToString());
            }
            cbbBank.DataSource    = new BindingSource(test, null);
            cbbBank.DisplayMember = "Value";
            cbbBank.ValueMember   = "Key";
        }
コード例 #7
0
        private void btnReport_Click(object sender, EventArgs e)
        {
            ReceiptsBLL objBLL = new ReceiptsBLL();

            // load data hoa don
            rcAll = objBLL.GetAllReceiptsToday();

            if (rcAll == null)
            {
                DialogResult dr = CustomMessageBox.MessageBox.ShowCustomMessageBox("Hiện chưa có hóa đơn nào được xuất trong ngày",
                                                                                   Common.clsLanguages.GetResource("Information"),
                                                                                   Common.Config.CUSTOM_MESSAGEBOX_ICON.Information,
                                                                                   Common.Config.CUSTOM_MESSAGEBOX_BUTTON.OK);
                return;
            }

            DoPrinting();
        }
コード例 #8
0
ファイル: frmManageBankCard.cs プロジェクト: luan-cs/API
        private void LoadBankType()
        {
            string BankCommonId = "";

            if (cbbBank.SelectedIndex != 0)
            {
                BankCommonId = cbbBank.SelectedValue.ToString();
            }
            receiptsBLL = new ReceiptsBLL();
            DataTable dt = receiptsBLL.GetBankType(BankCommonId);
            Dictionary <string, string> test = new Dictionary <string, string>();

            test.Add("", VVPosS.Common.clsLanguages.GetResource("Gender_null"));
            foreach (DataRow dr in dt.Rows)
            {
                test.Add(dr["CommonId"].ToString(), dr["StrValue1"].ToString());
            }
            cbbCardType.DataSource    = new BindingSource(test, null);
            cbbCardType.DisplayMember = "Value";
            cbbCardType.ValueMember   = "Key";
        }
コード例 #9
0
        public ActionResult Detail(string id)
        {
            ViewBag.types = ListToSelect(SysDataDictService.GetReceiptsCategories().Select(o => new SelectListItem()
            {
                Value = o.DicSN.ToString(), Text = o.Title
            }), emptyTitle: "请选择");
            var obj = ReceiptsBLL.FindById(id);

            obj.IsNullThrow();
            var user = UserInfoService.Find(o => o.UID == obj.CreateUID);

            if (user != null)
            {
                obj.CreateTitle = user.FullName;
            }
            var type = SysDataDictService.Find(o => o.DicSN == obj.CategoryId);

            if (type != null)
            {
                ViewData["Category"] = type.Title;
            }
            return(View(obj));
        }
コード例 #10
0
        private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            ReceiptsBLL objBLL = new ReceiptsBLL();
            // load data hoa don
            DataTable rcAll = objBLL.GetReceipts();
            int       y_p   = 0;
            int       h_s   = 0;

            ///

            StringFormat strfmt_Left         = new StringFormat();
            StringFormat strfmt_Center       = new StringFormat();
            StringFormat strfmt_Right        = new StringFormat();
            StringFormat strfmt_Left_Right   = new StringFormat();
            StringFormat strfmt_Center_Right = new StringFormat();
            StringFormat strfmt_Right_Center = new StringFormat();
            StringFormat strfmt_Left_Center  = new StringFormat();

            strfmt_Left.LineAlignment = StringAlignment.Near;
            strfmt_Left.Alignment     = StringAlignment.Near;

            strfmt_Center.LineAlignment = StringAlignment.Center;
            strfmt_Center.Alignment     = StringAlignment.Center;

            strfmt_Right.LineAlignment = StringAlignment.Far;
            strfmt_Right.Alignment     = StringAlignment.Far;

            strfmt_Left_Right.LineAlignment = StringAlignment.Far;
            strfmt_Left_Right.Alignment     = StringAlignment.Near;

            strfmt_Center_Right.LineAlignment = StringAlignment.Far;
            strfmt_Center_Right.Alignment     = StringAlignment.Center;

            strfmt_Right_Center.LineAlignment = StringAlignment.Center;
            strfmt_Right_Center.Alignment     = StringAlignment.Far;

            strfmt_Left_Center.LineAlignment = StringAlignment.Center;
            strfmt_Left_Center.Alignment     = StringAlignment.Near;

            // Logo
            var       imgLogo = Common.Utility.GetImageFromService("ShopImg", "logoPrint.png");
            Rectangle logo    = new Rectangle(5, 10, 60, 40);

            e.Graphics.DrawImage(imgLogo, logo);

            Rectangle strHoaDon = new Rectangle(120, 5, 165, 20);
            string    data      = Common.clsLanguages.GetResource("TotalRevenue");//"Doanh thu";

            e.Graphics.DrawString(data, new Font("Arial", 12, FontStyle.Bold), Brushes.DarkSlateBlue, strHoaDon, strfmt_Right);

            //Ngày hóa đơn
            Rectangle strRec = new Rectangle(80, 25, 200, 15);

            data = DateTime.Now.ToString("yyyy-MM-dd"); //"Ngày :"
            e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Regular), Brushes.DarkSlateBlue, strRec, strfmt_Right);

            /*
             * Rectangle RecLine1 = new Rectangle(110, 40, 170, 2);
             * var Line1 = Common.Utility.GetImageFromService("ShopImg", "line1.png");
             * e.Graphics.DrawImage(Line1, RecLine1);
             *
             * Rectangle strRec1 = new Rectangle(145, 42, 135, 18);
             * string strSoHD = rcAll.receipt.ReceiptId;
             * int soHD = int.Parse(strSoHD.Substring(10));
             * data = Common.clsLanguages.GetResource("ReceiptNumber") + " : 10#" + soHD.ToString(); //"Số HĐ: "
             * e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Italic), Brushes.DarkSlateBlue, strRec1, strfmt_Right);
             */
            //// Cty....

            /*Rectangle strCty = new Rectangle(5, 50, 140, 40);//20
             * data = Common.clsLanguages.GetResource("MerchantName");// "Công ty CP Việt Vang";
             * e.Graphics.DrawString(data, new Font("Arial", 9, FontStyle.Bold), Brushes.DarkSlateBlue, strCty, strfmt_Left);
             * //Địa chỉ Cty
             * Rectangle strDCCty = new Rectangle(5, 90, 290, 60);//50
             * data = Common.clsLanguages.GetResource("MerchantAddress") + "\n" + Common.clsLanguages.GetResource("MerchantTel") + "\n" + Common.clsLanguages.GetResource("MerchantWeb");
             * e.Graphics.DrawString(data, new Font("Arial", 7, FontStyle.Regular), Brushes.DarkSlateBlue, strDCCty, strfmt_Left);
             */
            //Headers
            Rectangle strHD_STT = new Rectangle(3, 50, 30, 18);

            data = Common.clsLanguages.GetResource("No");// "STT";
            e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Bold), Brushes.Black, strHD_STT, strfmt_Center);

            Rectangle strHD_SP = new Rectangle(33, 50, 187, 18);

            data = Common.clsLanguages.GetResource("Receipt");//"Hóa đơn ";
            e.Graphics.DrawString(data, new Font("Arial", 9, FontStyle.Bold), Brushes.Black, strHD_SP, strfmt_Left);

            /*Rectangle strHD_SL = new Rectangle(130, 150, 30, 18);
             * data = Common.clsLanguages.GetResource("ReceiptProQty");//"SL";
             * e.Graphics.DrawString(data, new Font("Arial", 9, FontStyle.Bold), Brushes.Black, strHD_SL, strfmt_Center);
             *
             * Rectangle strHD_DG = new Rectangle(160, 150, 60, 18);
             * data = Common.clsLanguages.GetResource("ReceiptProPrice");//"ĐG";
             * e.Graphics.DrawString(data, new Font("Arial", 9, FontStyle.Bold), Brushes.Black, strHD_DG, strfmt_Center);*/

            Rectangle strHD_TT = new Rectangle(160, 50, 110, 18);

            data = Common.clsLanguages.GetResource("TotalAmount");//ReceiptProTotalAfterTax "TT + Thuế";
            e.Graphics.DrawString(data, new Font("Arial", 9, FontStyle.Bold), Brushes.Black, strHD_TT, strfmt_Center);

            Rectangle RecLine2 = new Rectangle(5, 68, 290, 2);
            var       Line2    = Common.Utility.GetImageFromService("ShopImg", "line2.png");

            e.Graphics.DrawImage(Line2, RecLine2);

            decimal totalMoney        = 0;
            decimal serviceCostAmount = 0;
            decimal totalTax          = 0;
            decimal totalAmount       = 0;

            /*decimal cashPay = 0;
            *  decimal cardPay = 0;*/

            if (rcAll.Rows.Count > 0)
            {
                y_p = 70;

                int i = 0;

                foreach (DataRow dtl in rcAll.Rows)
                {
                    i++;
                    //Headers
                    h_s = 22;
                    //Common.clsLanguages.GetResource("ProductID") + " " + dtl.ProductId + " - " +
                    double _dbLength = (dtl.ItemArray[0].ToString()).Length;
                    if (_dbLength > 97 / 5)
                    {
                        int _iCelling = (int)Math.Ceiling((_dbLength * 5) / 97);
                        h_s = 14 * _iCelling + 12;
                    }

                    /*if (dtl.IsBuffet == "0" || (dtl.IsBuffet == "1" && double.Parse(dtl.Price) > 0))
                     * {*/
                    Rectangle strCT_STT = new Rectangle(3, y_p, 30, h_s);
                    data = i.ToString();
                    e.Graphics.DrawString(data, new Font("Arial", 7, FontStyle.Regular), Brushes.Black, strCT_STT, strfmt_Center);

                    Rectangle strCT_SP = new Rectangle(33, y_p, 97, h_s);

                    string strSoHD = dtl.ItemArray[0].ToString();
                    int    soHD    = int.Parse(strSoHD.Substring(10));
                    data = "10#" + soHD.ToString();  //"Số HĐ: "

                    //data = dtl.ItemArray[0].ToString();
                    e.Graphics.DrawString(data, new Font("Arial", 7, FontStyle.Regular), Brushes.Black, strCT_SP, strfmt_Left_Center);

                    /*Rectangle strCT_SL = new Rectangle(130, y_p, 30, h_s);
                     * data = dtl.ItemArray[9].ToString();
                     * e.Graphics.DrawString(data, new Font("Arial", 7, FontStyle.Regular), Brushes.Black, strCT_SL, strfmt_Center);
                     *
                     * Rectangle strTT_DG = new Rectangle(160, y_p, 60, h_s);
                     * //data = (double.Parse(dtl.Price) + (double.Parse(dtl.TaxAmount) / double.Parse(dtl.Qty))).ToString("0,0");
                     * data = dtl.Price;
                     * e.Graphics.DrawString(data, new Font("Arial", 7, FontStyle.Regular), Brushes.Black, strTT_DG, strfmt_Right_Center);
                     */
                    Rectangle strTT_TT = new Rectangle(160, y_p, 120, h_s);
                    data = Decimal.Parse(dtl.ItemArray[9].ToString()).ToString("#,##0");
                    e.Graphics.DrawString(data, new Font("Arial", 7, FontStyle.Regular), Brushes.Black, strTT_TT, strfmt_Right_Center);

                    totalMoney        += Decimal.Parse(dtl.ItemArray[9].ToString());
                    serviceCostAmount += Decimal.Parse(dtl.ItemArray[5].ToString());
                    totalTax          += Decimal.Parse(dtl.ItemArray[6].ToString());
                    totalAmount       += Decimal.Parse(dtl.ItemArray[4].ToString());
                    //cashPay += Decimal.Parse(dtl.ItemArray[10].ToString());
                    //cardPay += Decimal.Parse(dtl.ItemArray[11].ToString());

                    y_p += h_s;
                    Rectangle RecLineCT = new Rectangle(5, y_p, 290, 1);
                    var       LineCT    = Common.Utility.GetImageFromService("ShopImg", "linect.png");
                    e.Graphics.DrawImage(LineCT, RecLineCT);

                    /*}
                     * else
                     * {
                     *  Rectangle strCT_SP = new Rectangle(43, y_p, 147, h_s);//60
                     *  data = dtl.ProductName;
                     *  e.Graphics.DrawString(data, new Font("Arial", 7, FontStyle.Regular), Brushes.Black, strCT_SP, strfmt_Left_Center);
                     *
                     *  Rectangle strCT_SL = new Rectangle(190, y_p, 30, h_s);
                     *  data = dtl.Qty;
                     *  e.Graphics.DrawString(data, new Font("Arial", 7, FontStyle.Regular), Brushes.Black, strCT_SL, strfmt_Right_Center);
                     *
                     *  y_p += h_s;
                     *  Rectangle RecLineCT = new Rectangle(43, y_p, 247, 1);
                     *  var LineCT = Common.Utility.GetImageFromService("ShopImg", "linect.png");
                     *  e.Graphics.DrawImage(LineCT, RecLineCT);
                     *
                     * }*/
                }
            }


            ///Tổng tiền trước thuế /sau thuế
            Rectangle RecTTST = new Rectangle(80, y_p, 120, 15);

            data = Common.clsLanguages.GetResource("TotalAmount");
            e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Regular), Brushes.Black, RecTTST, strfmt_Right);

            Rectangle RecTTST_Val = new Rectangle(200, y_p, 80, 15);

            data = totalAmount.ToString("#,##0");
            //data = String.Format("{ 0:C}", totalMoney.ToString());
            e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Bold), Brushes.Black, RecTTST_Val, strfmt_Right);
            y_p = y_p + 15;

            ///phí dịch vụ
            Rectangle RecPDV = new Rectangle(40, y_p, 160, 15);

            data = Common.clsLanguages.GetResource("TaxAndServiceChange") + " (" + (int.Parse(ConfigurationManager.AppSettings["SeviceCostPercent"]) +
                                                                                    int.Parse(ConfigurationManager.AppSettings["VAT"])) + " %)"; //Common.clsLanguages.GetResource("TotalServiceCharge");//
            e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Regular), Brushes.Black, RecPDV, strfmt_Right);

            Rectangle RecPDV_Val = new Rectangle(200, y_p, 80, 15);

            data = (serviceCostAmount + totalTax).ToString("#,##0");
            e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Bold), Brushes.Black, RecPDV_Val, strfmt_Right);
            y_p = y_p + 15;

            ///Giảm giá

            /*Rectangle RecDIS = new Rectangle(80, y_p, 120, 15);
             * data = Common.clsLanguages.GetResource("TotalDiscountAmount");//"Giảm giá ";
             * e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Regular), Brushes.Black, RecDIS, strfmt_Right);
             *
             * Rectangle RecDIS_Val = new Rectangle(200, y_p, 80, 15);
             * data = rcAll.receipt.DiscountAmount;
             * e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Bold), Brushes.Black, RecDIS_Val, strfmt_Right);
             * y_p = y_p + 15;*/

            ///Tổng tiền thanh toán
            Rectangle RecPAY = new Rectangle(80, y_p, 120, 15);

            data = Common.clsLanguages.GetResource("TotalMoney");//"TC Cần thanh toán";
            e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Regular), Brushes.Black, RecPAY, strfmt_Right);

            Rectangle RecPAY_Val = new Rectangle(200, y_p, 80, 15);

            data = totalMoney.ToString("#,##0");
            e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Bold), Brushes.Black, RecPAY_Val, strfmt_Right);
            y_p = y_p + 15;

            ////

            /*Rectangle RecLine3 = new Rectangle(90, y_p, 200, 1);
             * var Line3 = Common.Utility.GetImageFromService("ShopImg", "line1.png");
             * e.Graphics.DrawImage(Line3, RecLine3);
             * y_p = y_p + 2;*/

            ///Tổng tiền mặt

            /*Rectangle RecCASH = new Rectangle(80, y_p, 120, 15);
             * data = Common.clsLanguages.GetResource("CashPayment");//Common.clsLanguages.GetResource("TotalCashCustomer");//"Tiền mặt khách đưa";
             * e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Regular), Brushes.Black, RecCASH, strfmt_Right);
             *
             * Rectangle RecCASH_Val = new Rectangle(200, y_p, 80, 15);
             * data = cashPay.ToString("#,##0.00");
             * e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Bold), Brushes.Black, RecCASH_Val, strfmt_Right);
             * y_p = y_p + 15;
             *
             * ///Tổng tiền thẻ
             * Rectangle RecCARD = new Rectangle(80, y_p, 120, 15);
             * data = Common.clsLanguages.GetResource("CardPayment");//Common.clsLanguages.GetResource("TotalCardAmount");//"Tiền thẻ khách:";
             * e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Regular), Brushes.Black, RecCARD, strfmt_Right);
             *
             * Rectangle RecCARD_Val = new Rectangle(200, y_p, 80, 15);
             * data = cardPay.ToString("#,##0.00");
             * e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Bold), Brushes.Black, RecCARD_Val, strfmt_Right);
             * y_p = y_p + 15;*/

            ///Số tiền thối lại

            /*Rectangle RecRefun = new Rectangle(80, y_p, 120, 15);
             * data = Common.clsLanguages.GetResource("TotalReturnAmount");//Common.clsLanguages.GetResource("TotalCardAmount");//"Tiền thẻ khách:";
             * e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Regular), Brushes.Black, RecRefun, strfmt_Right);
             *
             * Rectangle RecRefun_Val = new Rectangle(200, y_p, 80, 15);
             * data = rcAll.receipt.ReturnAmt;
             * e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Bold), Brushes.Black, RecRefun_Val, strfmt_Right);
             * y_p = y_p + 15;
             *
             * if (rcAll.receiptMember != null && !string.IsNullOrEmpty(rcAll.receiptMember.MemberId))
             * {
             *  ////
             *  Rectangle RecLine5 = new Rectangle(5, y_p, 290, 2);
             *  var Line5 = Common.Utility.GetImageFromService("ShopImg", "line1.png");
             *  e.Graphics.DrawImage(Line5, RecLine5);
             *  y_p = y_p + 4;
             *
             *  Rectangle RecTTKH = new Rectangle(10, y_p, 160, 18);
             *  data = Common.clsLanguages.GetResource("CustomerInformation");//"Thông tin khách hàng";
             *  e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Bold), Brushes.Black, RecTTKH, strfmt_Left);
             *  y_p = y_p + 18;
             *
             *  Rectangle RecTTKH1 = new Rectangle(10, y_p, 190, 15);
             *  data = Common.clsLanguages.GetResource("FullName") + " : " + rcAll.receiptMember.FullName;
             *  e.Graphics.DrawString(data, new Font("Arial", 7, FontStyle.Regular), Brushes.Black, RecTTKH1, strfmt_Left);
             *
             *  Rectangle RecTTKH1A = new Rectangle(205, y_p, 90, 15);
             *  data = Common.clsLanguages.GetResource("TotalScore") + " : " + rcAll.receiptMember.MemberScore;
             *  e.Graphics.DrawString(data, new Font("Arial", 7, FontStyle.Regular), Brushes.Black, RecTTKH1A, strfmt_Left);
             *  y_p = y_p + 15;
             *
             *  Rectangle RecTTKH2 = new Rectangle(10, y_p, 190, 15);
             *  data = Common.clsLanguages.GetResource("MemberID") + " : " + rcAll.receiptMember.MemberId;
             *  e.Graphics.DrawString(data, new Font("Arial", 7, FontStyle.Regular), Brushes.Black, RecTTKH2, strfmt_Left);
             *  y_p = y_p + 15;
             * }
             */
            ////
            Rectangle RecLine6 = new Rectangle(5, y_p, 290, 2);
            var       Line6    = Common.Utility.GetImageFromService("ShopImg", "line1.png");

            e.Graphics.DrawImage(Line6, RecLine6);
            y_p = y_p + 4;

            Rectangle RecTK = new Rectangle(5, y_p, 190, 18);

            //data = Common.clsLanguages.GetResource("ReceiptFooterText"); //"Cám ơn & hẹn gặp lại quý khách !";
            data = Common.clsLanguages.GetResource("MerchantName");
            e.Graphics.DrawString(data, new Font("Arial", 8, FontStyle.Italic), Brushes.Black, RecTK, strfmt_Left);

            //Rectangle RecPower = new Rectangle(200, y_p, 95, 47);
            //var LineP = Common.Utility.GetImageFromService("VVImg", "powered by vv.emf");
            //e.Graphics.DrawImage(LineP, RecPower);
            //y_p = y_p + 47;

            // show các PromoText

            /*DataTable dtPromo = RptsBLL.GetValidPromotionToPrint();
             * if (dtPromo != null && dtPromo.Rows.Count > 0)
             * {
             *  ////
             *  Rectangle RecLine7 = new Rectangle(5, y_p, 290, 1);
             *  var Line7 = Common.Utility.GetImageFromService("ShopImg", "line1.png");
             *  e.Graphics.DrawImage(Line7, RecLine7);
             *  y_p = y_p + 4;
             *  //////
             *  foreach (DataRow dr in dtPromo.Rows)
             *  {
             *      Rectangle RecPromo = new Rectangle(5, y_p, 290, 130);
             *      data = "\n---------------\n" + dr["PromoText"].ToString() + "\n---------------\n";
             *      e.Graphics.DrawString(data, new Font("Arial", 7, FontStyle.Italic), Brushes.Black, RecPromo, strfmt_Center);
             *      y_p = y_p + 130;
             *  }
             * }*/
        }
コード例 #11
0
        public ActionResult Save(Receipts obj)
        {
            var re = ReceiptsBLL.SaveOrUpdate(obj, Request.Files);

            return(Content(re.ToJson()));
        }
コード例 #12
0
        private void btnBaoCao_Click(object sender, EventArgs e)
        {
            /*
             * -------------------------------Get date-----------------------------------*
             */
            if (rdThang.Checked)
            {
                month_  = txtThang.Value.ToString();
                year_   = txtNam.Value.ToString();
                fromday = "";
                today   = "";
                if (Common.clsLanguages.StrCulture == "ja-JP")
                {
                    title = "(" + txtThang.Value.ToString().PadLeft(2, '0') + " " + Common.clsLanguages.GetResource("Month") + " " + txtNam.Value.ToString() + " " + Common.clsLanguages.GetResource("Year") + ")";
                }
                else
                {
                    title = "(" + Common.clsLanguages.GetResource("Month") + " " + txtThang.Value.ToString().PadLeft(2, '0') + " " + Common.clsLanguages.GetResource("Year") + " " + txtNam.Value.ToString() + ")";
                }
            }
            else
            {
                month_  = "";
                year_   = "";
                fromday = txtTungay.Value.ToString("yyyy-MM-dd");
                today   = txtDenngay.Value.ToString("yyyy-MM-dd");
                //if (Common.clsLanguages.StrCulture == "ja-JP")
                //    title = (txtTungay.Value == txtDenngay.Value) ? txtTungay.Text.Substring(0, 10) + Common.clsLanguages.GetResource("Day") : "(" + Common.clsLanguages.GetResource("FromDate") + " " + txtTungay.Text.Substring(0, 10) + " " + Common.clsLanguages.GetResource("ToDate") + " " + txtDenngay.Text.Substring(0, 10) + ")";
                title = (fromday == today) ? Common.clsLanguages.GetResource("Day") + ": " + txtTungay.Text.Substring(0, 10) : "(" + Common.clsLanguages.GetResource("FromDate") + " " + txtTungay.Text.Substring(0, 10) + " " + Common.clsLanguages.GetResource("ToDate") + " " + txtDenngay.Text.Substring(0, 10) + ")";
            }
            List <Receipts> lst_rc = new List <Receipts>();

            receiptBLL = new ReceiptsBLL();
            lst_rc     = receiptBLL.GetQtyCardBank(fromday, today, month_, year_, txtSoHoaDon.Text);
            if (lst_rc == null)
            {
                //NothingDate
                //CustomMessageBox.MessageBox.ShowCustomMessageBox("Không có số liệu !",
                //Common.clsLanguages.GetResource("Information"),
                //Common.Config.CUSTOM_MESSAGEBOX_ICON.Information,
                //Common.Config.CUSTOM_MESSAGEBOX_BUTTON.OK);
                CustomMessageBox.MessageBox.ShowCustomMessageBox(Common.clsLanguages.GetResource("NothingDate"),
                                                                 Common.clsLanguages.GetResource("Information"),
                                                                 Common.Config.CUSTOM_MESSAGEBOX_ICON.Information,
                                                                 Common.Config.CUSTOM_MESSAGEBOX_BUTTON.OK);
                return;
            }
            else
            {
                try
                {
                    rpt.LocalReport.DataSources.Clear();
                    rpt.LocalReport.ReportEmbeddedResource = "VVPosM1.ReportView.dsQtyCardBank.rdlc";

                    Microsoft.Reporting.WinForms.ReportDataSource ds = new Microsoft.Reporting.WinForms.ReportDataSource("dsQtyCardBank", lst_rc);
                    ds.Value = lst_rc;
                    rpt.LocalReport.DataSources.Add(ds);
                    string templateImage = Common.Utility.GetUrlFromService("ShopImg", "logoprint.png"); //"http://localhost:7979/Image/ShopImg/logoprint.png";


                    // gán parameters
                    //ReportParameter[] lstParams = new ReportParameter[13];
                    ReportParameter[] lstParams;

                    lstParams    = new ReportParameter[16];
                    lstParams[0] = new ReportParameter("TenCTy", Common.clsLanguages.GetResource("MerchantName"));
                    lstParams[1] = new ReportParameter("DCCty", Common.clsLanguages.GetResource("MerchantAddress"));
                    lstParams[2] = new ReportParameter("TieuDe", Common.clsLanguages.GetResource("TracsitionReport"));//TracsitionReport

                    lstParams[3] = new ReportParameter("Time1", title);
                    string s = Common.clsLanguages.GetResource("ReportDate") + " " + DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss");
                    lstParams[4] = new ReportParameter("Time", s);

                    lstParams[5] = new ReportParameter("ReceiptId", Common.clsLanguages.GetResource("OrderCode"));
                    lstParams[6] = new ReportParameter("CardNo", Common.clsLanguages.GetResource("CardId")); //CardId
                    lstParams[7] = new ReportParameter("CardType", Common.clsLanguages.GetResource("CardType"));
                    lstParams[8] = new ReportParameter("Bank", Common.clsLanguages.GetResource("Banks"));    //Banks
                    lstParams[9] = new ReportParameter("TotalAmount", Common.clsLanguages.GetResource("TotalAmount"));

                    lstParams[10] = new ReportParameter("Total", Common.clsLanguages.GetResource("TotalAll"));

                    lstParams[11] = new ReportParameter("ImageName", templateImage);

                    lstParams[12] = new ReportParameter("CreatedDate", Common.clsLanguages.GetResource("CreateDate"));
                    lstParams[13] = new ReportParameter("CreatedBy", Common.clsLanguages.GetResource("CreateBy"));
                    lstParams[14] = new ReportParameter("NO", Common.clsLanguages.GetResource("No"));//Quantity
                    lstParams[15] = new ReportParameter("Qty", Common.clsLanguages.GetResource("Quantity"));

                    rpt.LocalReport.EnableExternalImages = true;
                    this.rpt.LocalReport.SetParameters(lstParams);
                    this.rpt.RefreshReport();
                    rpt.LocalReport.Refresh();
                    rpt.Refresh();

                    this.WindowState   = FormWindowState.Normal;
                    this.StartPosition = FormStartPosition.CenterScreen;
                    this.TopMost       = true;
                    // this.ShowDialog(this.Parent);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }
コード例 #13
0
 public frmRpt_TotalCustomerProductMoth()
 {
     InitializeComponent();
     SetUIChanges();
     receiptBLL = new ReceiptsBLL();
 }
コード例 #14
0
        public ActionResult Delete(string[] ids)
        {
            var re = ReceiptsBLL.Delete(ids);

            return(new JsonNetResult(re));
        }
コード例 #15
0
 public frmRpt_RevenueProductHour()
 {
     InitializeComponent();
     SetUIChanges();
     receiptBLL = new ReceiptsBLL();
 }
コード例 #16
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            bool result = false;

            if (String.IsNullOrWhiteSpace(txtReceiptId.Text.Trim()))
            {
                CustomMessageBox.MessageBox.ShowCustomMessageBox("Vui lòng nhập vào mã hóa đơn.",
                                                                 clsLanguages.GetResource("Information"),
                                                                 Config.CUSTOM_MESSAGEBOX_ICON.Information,
                                                                 Config.CUSTOM_MESSAGEBOX_BUTTON.OK);
                txtReceiptId.Focus();
                return;
            }
            if (String.IsNullOrWhiteSpace(rtxtNotes.Text.Trim()))
            {
                CustomMessageBox.MessageBox.ShowCustomMessageBox("Vui lòng nhập lý do hủy.",
                                                                 clsLanguages.GetResource("Information"),
                                                                 Config.CUSTOM_MESSAGEBOX_ICON.Information,
                                                                 Config.CUSTOM_MESSAGEBOX_BUTTON.OK);
                rtxtNotes.Focus();
                return;
            }
            DialogResult dr = CustomMessageBox.MessageBox.ShowCustomMessageBox(clsLanguages.GetResource("AreYouSureCancel"),
                                                                               clsLanguages.GetResource("Information"),
                                                                               Config.CUSTOM_MESSAGEBOX_ICON.Information,
                                                                               Config.CUSTOM_MESSAGEBOX_BUTTON.YESNO);

            if (dr == DialogResult.Yes)
            {
                try
                {
                    ReceiptsBLL receiptBll = new ReceiptsBLL();
                    string      strFirst   = "11";
                    //strFirst += ConfigurationManager.AppSettings["ShopId"];
                    string strMiddle = receiptBll.GetCurDateServer();
                    string strId     = "";
                    int    iId       = Int32.Parse(txtReceiptId.Text.Trim());
                    if (iId < 10)
                    {
                        strId = "0000" + iId;
                    }
                    else if (iId >= 10 && iId <= 99)
                    {
                        strId = "000" + iId;
                    }
                    else if (iId >= 100 && iId <= 999)
                    {
                        strId = "00" + iId;
                    }
                    else if (iId >= 1000 && iId <= 9999)
                    {
                        strId = "0" + iId;
                    }
                    else if (iId >= 10000 && iId <= 99999)
                    {
                        strId = iId.ToString();
                    }

                    string notes = rtxtNotes.Text;
                    if (receiptBll.GetReceiptById(strFirst + strMiddle + strId))
                    {
                        receiptBll.CancelReceipt(strFirst + strMiddle + strId, notes);
                        result = true;
                    }
                    else
                    {
                        CustomMessageBox.MessageBox.ShowCustomMessageBox("Mã hóa đơn không tồn tại trong hệ thống.",
                                                                         clsLanguages.GetResource("Error"),
                                                                         Config.CUSTOM_MESSAGEBOX_ICON.Error,
                                                                         Config.CUSTOM_MESSAGEBOX_BUTTON.OK);
                        txtReceiptId.Clear();
                        return;
                    }
                }
                catch
                {
                    CustomMessageBox.MessageBox.ShowCustomMessageBox("Không thành công.",
                                                                     clsLanguages.GetResource("Information"),
                                                                     Config.CUSTOM_MESSAGEBOX_ICON.Information,
                                                                     Config.CUSTOM_MESSAGEBOX_BUTTON.OK);
                    return;
                }
                if (result)
                {
                    CustomMessageBox.MessageBox.ShowCustomMessageBox("Hủy hóa đơn thành công.",
                                                                     clsLanguages.GetResource("Information"),
                                                                     Config.CUSTOM_MESSAGEBOX_ICON.Information,
                                                                     Config.CUSTOM_MESSAGEBOX_BUTTON.OK);
                    this.Close();
                }
                else
                {
                    CustomMessageBox.MessageBox.ShowCustomMessageBox("Không thành công.",
                                                                     clsLanguages.GetResource("Information"),
                                                                     Config.CUSTOM_MESSAGEBOX_ICON.Information,
                                                                     Config.CUSTOM_MESSAGEBOX_BUTTON.OK);
                }
            }
        }
コード例 #17
0
        private void dgv_CellClickReceipt(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                string id = dgvRecept.Rows[e.RowIndex].Cells[1].Value.ToString();
                receBLL = new ReceiptsBLL();
                // load thông tin chi tiết hóa đơn
                DataTable dt = receBLL.searchReceiptsDetails(id);
                dgvReceipDetail.Rows.Clear();
                if (dt != null && dt.Rows.Count > 0)
                {
                    int i   = 0;
                    int stt = 0;
                    foreach (DataRow dr in dt.Rows)
                    {
                        dgvReceipDetail.Rows.Add();
                        dgvReceipDetail.Rows[i].Cells[0].Value = (stt + 1).ToString();
                        dgvReceipDetail.Rows[i].Cells[1].Value = dr["ReceiptId"].ToString();
                        // thông tin sản phẩm
                        string str = "";
                        str = str + Common.clsLanguages.GetResource("ProductId") + ": " + dr["ProductId"].ToString() + "\n";
                        str = str + Common.clsLanguages.GetResource("ProductName1") + ": " + dr["Name"].ToString() + "\n";
                        str = str + Common.clsLanguages.GetResource("PromotionID") + ": " + dr["PromotionId"].ToString() + "\n";
                        dgvReceipDetail.Rows[i].Cells[2].Value = str;
                        dgvReceipDetail.Rows[i].Cells[3].Value = dr["Qty"].ToString();
                        dgvReceipDetail.Rows[i].Cells[4].Value = string.Format("{0:0,0}", dr["Price"]);
                        dgvReceipDetail.Rows[i].Cells[5].Value = string.Format("{0:0,0}", dr["TotalAmountBeforeTax"]);
                        dgvReceipDetail.Rows[i].Cells[6].Value = string.Format("{0:0,0}", dr["TaxAmount"]);
                        dgvReceipDetail.Rows[i].Cells[7].Value = string.Format("{0:0,0}", dr["TotalAmount"]);
                        i++;
                        stt++;
                    }
                    //if (e.ColumnIndex == 5)
                    //{
                    //    if (receBLL.PrintReceipt(id, "1") == 1)
                    //    {
                    //        MessageBox.Show("In thành công!");
                    //    }
                    //    else
                    //    {
                    //        MessageBox.Show("In không thành công!");
                    //    }
                    //}
                }

                // load thông tin chi tiết khách hàng
                DataTable tbinfo = receBLL.searchReceiptInfo(id);
                lblThongTinKhachHang.Text = "";
                if (tbinfo != null && tbinfo.Rows.Count > 0)
                {
                    foreach (DataRow dr in tbinfo.Rows)
                    {
                        string info = "";
                        info = info + "-" + Common.clsLanguages.GetResource("CustomerNew") + " \n";
                        info = info + "-" + Common.clsLanguages.GetResource("CustomerName") + ":" + dr["CustomerName"] + "\n";
                        info = info + "-" + Common.clsLanguages.GetResource("Address") + ":" + dr["Address"] + "\n";
                        info = info + "-" + Common.clsLanguages.GetResource("Tel") + ":" + dr["Phone"] + "\n";
                        info = info + "-" + Common.clsLanguages.GetResource("Notes") + ":" + dr["Note"] + "\n";
                        lblThongTinKhachHang.Text = info;
                    }
                }


                // load thông tin khách hàng member

                DataTable tbmember = receBLL.searchReceiptMember(id);
                lblThongTinKhachHang.Text = "";
                if (tbmember != null && tbmember.Rows.Count > 0)
                {
                    foreach (DataRow dr in tbmember.Rows)
                    {
                        string info = "";
                        info = info + "-" + Common.clsLanguages.GetResource("CustomerMember") + " \n";
                        info = info + "-" + Common.clsLanguages.GetResource("MemberID") + ":" + dr["MemberId"] + "\n";
                        info = info + "-" + Common.clsLanguages.GetResource("CreateDate") + ":" + dr["CreatedDate"] + "\n";
                        info = info + "-" + Common.clsLanguages.GetResource("CreateBy") + ":" + dr["CreatedBy"] + "\n";
                        lblThongTinKhachHang.Text = info;
                    }
                }

                // Load thông tin thẻ

                DataTable dt1 = receBLL.searchReceiptsCard(id);
                dvgCard.Rows.Clear();
                if (dt1 != null && dt1.Rows.Count > 0)
                {
                    int i = 0;

                    foreach (DataRow dr in dt1.Rows)
                    {
                        dvgCard.Rows.Add();
                        dvgCard.Rows[i].Cells[0].Value = (i + 1).ToString();
                        dvgCard.Rows[i].Cells[1].Value = dr["ReceiptId"].ToString();
                        // thông tin thẻ
                        string str = "";
                        str = str + "-" + Common.clsLanguages.GetResource("Loc_3") + ": " + dr["CardNo"].ToString() + "\n";
                        str = str + "- Tên chủ thẻ: " + dr["CardHolderName"].ToString() + "\n";
                        str = str + "- Ngân hàng: " + dr["Bank"].ToString() + "\n";
                        str = str + "-" + Common.clsLanguages.GetResource("DeadlineDate") + ": " + dr["ExpiredDate"].ToString() + "\n";
                        str = str + "- Loại thẻ: " + dr["CardType"].ToString() + "\n";
                        str = str + "-" + Common.clsLanguages.GetResource("TotalAmount") + ": " + dr["TotalAmount"].ToString() + "\n";
                        str = str + "- TerminalId: " + dr["TerminalId"].ToString() + "\n";
                        dvgCard.Rows[i].Cells[2].Value = str;

                        // thông tin khởi tạo
                        str = "";
                        str = str + "-" + Common.clsLanguages.GetResource("CreateBy") + ": " + dr["CreatedBy"].ToString() + "\n";
                        str = str + "-" + Common.clsLanguages.GetResource("CreateDate") + ": " + dr["CreatedDate"].ToString() + "\n";
                        dvgCard.Rows[i].Cells[3].Value = str;
                        i++;
                    }
                }
            }
        }
コード例 #18
0
        private void btnXemBC_Click(object sender, EventArgs e)
        {
            try
            {
                pro = new Products();
                string sMon = dptThangNam.Value.Month.ToString();
                string sYea = dptThangNam.Value.Year.ToString();
                string pBeginWorkingDate = dptThangNam.Value.ToString("yyyy-MM-dd");
                string pTuNgayDenNgay    = sMon + " - " + sYea;
                // nếu chọn chkbox sản phẩm
                if (chkSanPham.Checked)
                {
                    receiptBLL = new ReceiptsBLL();

                    DataTable dt = receiptBLL.GetProductNoOfCustomersMonthAll(sMon, sYea, cboLoad.SelectedValue.ToString());

                    if (dt != null && dt.Rows.Count > 0)
                    {
                        // vị trí report và page nằm ngang
                        //System.Drawing.Printing.PageSettings pg = new System.Drawing.Printing.PageSettings();
                        //pg.Landscape = true;

                        // rptViewTotalCustomer.ZoomMode = ZoomMode.PageWidth;

                        rptViewTotalCustomer.LocalReport.DataSources.Clear();                                                                               //clear report
                        rptViewTotalCustomer.LocalReport.ReportEmbeddedResource = "VVPosM1.ReportView.rptTotalCustomerProductMoth.rdlc";                    // bind reportviewer with .rdlc

                        Microsoft.Reporting.WinForms.ReportDataSource dataset = new Microsoft.Reporting.WinForms.ReportDataSource("TotalCustomerMoth", dt); // set the datasource
                        rptViewTotalCustomer.LocalReport.DataSources.Add(dataset);
                        dataset.Value = dt;
                        //logo
                        string            templateImage = Common.Utility.GetUrlFromService("ShopImg", "logoprint.png");
                        ReportParameter[] lstParams     = new ReportParameter[13];
                        lstParams[0]  = new ReportParameter("TCTy", Common.clsLanguages.GetResource("MerchantName"));
                        lstParams[1]  = new ReportParameter("DCCTy", Common.clsLanguages.GetResource("MerchantAddress"));
                        lstParams[2]  = new ReportParameter("TieuDe", Common.clsLanguages.GetResource("ReportByMonth"));
                        lstParams[3]  = new ReportParameter("TimeS", Common.clsLanguages.GetResource("GetDateReport") + " " + DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss"));
                        lstParams[4]  = new ReportParameter("Time", dptThangNam.Value.Month.ToString() + "-" + dptThangNam.Value.Year.ToString());
                        lstParams[5]  = new ReportParameter("ImageName", templateImage);
                        lstParams[6]  = new ReportParameter("No", Common.clsLanguages.GetResource("No"));
                        lstParams[7]  = new ReportParameter("InformationProduct", Common.clsLanguages.GetResource("Information"));
                        lstParams[8]  = new ReportParameter("Note", Common.clsLanguages.GetResource("Notes"));
                        lstParams[9]  = new ReportParameter("Revennue", Common.clsLanguages.GetResource("Revennue"));
                        lstParams[10] = new ReportParameter("Quantity", Common.clsLanguages.GetResource("TotalCustomer"));
                        lstParams[11] = new ReportParameter("Total", Common.clsLanguages.GetResource("TotalAll"));
                        lstParams[12] = new ReportParameter("Title", Common.clsLanguages.GetResource("Title1"));
                        rptViewTotalCustomer.LocalReport.EnableExternalImages = true;

                        this.rptViewTotalCustomer.LocalReport.SetParameters(lstParams);
                        rptViewTotalCustomer.LocalReport.Refresh();
                        rptViewTotalCustomer.RefreshReport(); // refresh report
                    }
                    else
                    {
                        CustomMessageBox.MessageBox.ShowCustomMessageBox(Common.clsLanguages.GetResource("DataNull"),
                                                                         Common.clsLanguages.GetResource("Information"),
                                                                         Common.Config.CUSTOM_MESSAGEBOX_ICON.Information,
                                                                         Common.Config.CUSTOM_MESSAGEBOX_BUTTON.OK);
                    }
                }

                // nếu check nhóm sản phẩm
                if (chkNhomSanPham.Checked)
                {
                    receiptBLL = new ReceiptsBLL();

                    DataTable dt = receiptBLL.GetProductGroupNoOfCustomersMonthAll(sMon, sYea, cboLoad.SelectedValue.ToString());

                    if (dt != null && dt.Rows.Count > 0)
                    {
                        // vị trí report và page nằm ngang
                        //System.Drawing.Printing.PageSettings pg = new System.Drawing.Printing.PageSettings();
                        //pg.Landscape = true;

                        // rptViewTotalCustomer.ZoomMode = ZoomMode.PageWidth;

                        rptViewTotalCustomer.LocalReport.DataSources.Clear();                                                                               //clear report
                        rptViewTotalCustomer.LocalReport.ReportEmbeddedResource = "VVPosM1.ReportView.rptTotalCustomerProductMoth.rdlc";                    // bind reportviewer with .rdlc

                        Microsoft.Reporting.WinForms.ReportDataSource dataset = new Microsoft.Reporting.WinForms.ReportDataSource("TotalCustomerMoth", dt); // set the datasource
                        rptViewTotalCustomer.LocalReport.DataSources.Add(dataset);
                        dataset.Value = dt;
                        //logo
                        string            templateImage = Common.Utility.GetUrlFromService("ShopImg", "logoprint.png");
                        ReportParameter[] lstParams     = new ReportParameter[13];
                        lstParams[0]  = new ReportParameter("TCTy", Common.clsLanguages.GetResource("MerchantName"));
                        lstParams[1]  = new ReportParameter("DCCTy", Common.clsLanguages.GetResource("MerchantAddress"));
                        lstParams[2]  = new ReportParameter("TieuDe", Common.clsLanguages.GetResource("ReportByMonth"));
                        lstParams[3]  = new ReportParameter("TimeS", Common.clsLanguages.GetResource("GetDateReport") + " " + DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss"));
                        lstParams[4]  = new ReportParameter("Time", dptThangNam.Value.Month.ToString() + "-" + dptThangNam.Value.Year.ToString());
                        lstParams[5]  = new ReportParameter("ImageName", templateImage);
                        lstParams[6]  = new ReportParameter("No", Common.clsLanguages.GetResource("No"));
                        lstParams[7]  = new ReportParameter("InformationProduct", Common.clsLanguages.GetResource("Information"));
                        lstParams[8]  = new ReportParameter("Note", Common.clsLanguages.GetResource("Notes"));
                        lstParams[9]  = new ReportParameter("Revennue", Common.clsLanguages.GetResource("Revennue"));
                        lstParams[10] = new ReportParameter("Quantity", Common.clsLanguages.GetResource("TotalCustomer"));
                        lstParams[11] = new ReportParameter("Total", Common.clsLanguages.GetResource("TotalAll"));
                        lstParams[12] = new ReportParameter("Title", Common.clsLanguages.GetResource("Title1"));
                        rptViewTotalCustomer.LocalReport.EnableExternalImages = true;

                        this.rptViewTotalCustomer.LocalReport.SetParameters(lstParams);
                        rptViewTotalCustomer.LocalReport.Refresh();
                        rptViewTotalCustomer.RefreshReport(); // refresh report
                    }
                    else
                    {
                        CustomMessageBox.MessageBox.ShowCustomMessageBox(Common.clsLanguages.GetResource("DataNull"),
                                                                         Common.clsLanguages.GetResource("Information"),
                                                                         Common.Config.CUSTOM_MESSAGEBOX_ICON.Information,
                                                                         Common.Config.CUSTOM_MESSAGEBOX_BUTTON.OK);
                    }
                }
            }

            catch (Exception)
            {
            }
        }