예제 #1
0
 public SpecialPricing()
 {
     getGui = new get_GUI();
     BulkInfoList = new ArrayList();
     OnSaleInfoList = new ArrayList();
     PricesList = new ArrayList();
 }
예제 #2
0
        private void FrmSetupInvoiceNotes_Load(object sender, EventArgs e)
        {
            Services.get_GUI get_GUI = new get_GUI();
            DataTable a =  get_GUI.GetSetupByStore(StaticClass.storeId);
            for (var i = 1; i < 10; i++)
            {
                this.tabControl1.TabPages[1].Controls["cretextbox" + i].Text = a.Rows[0][24+i].ToString();
            }
            textBox1.Text = a.Rows[0][34].ToString();
            try
            {
                byte[] barrImg = (byte[])a.Rows[0]["Logo"];
                string strfn = Convert.ToString(DateTime.Now.ToFileTime());
                FileStream fs = new FileStream(strfn, FileMode.CreateNew, FileAccess.Write);
                fs.Write(barrImg, 0, barrImg.Length);
                fs.Flush();
                fs.Close();

                pictureBox1.Image = Image.FromFile(strfn);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);

            }
        }
예제 #3
0
 public FrmSetupPrinter()
 {
     InitializeComponent();
     Printers   = new Hashtable();
     serviceGet = new ServiceGet();
     getGui     = new get_GUI();
 }
예제 #4
0
 public FrmSetupPrinter()
 {
     InitializeComponent();
     Printers = new Hashtable();
     serviceGet = new ServiceGet();
     getGui = new get_GUI();
 }
예제 #5
0
 private void button1_Click(object sender, EventArgs e)
 {
     Services.get_GUI get_GUI = new get_GUI();
     get_GUI.UpdateInvoiceNotes(StaticClass.storeId,creTextBox1.Text,creTextBox2.Text,creTextBox3.Text,creTextBox4.Text,creTextBox5.Text,creTextBox6.Text,creTextBox7.Text,creTextBox8.Text,creTextBox9.Text,textBox1.Text);
     get_GUI.UpdateLogo(m_barrImg,StaticClass.storeId);
     this.Dispose();
 }
예제 #6
0
        public FrmQuanLyDanhMuc()
        {
            InitializeComponent();
            services=new get_GUI();

            catagries = services.GetAllCategories(StaticClass.storeId);
            dataBinding();
        }
예제 #7
0
 public FrmCustomer()
 {
     InitializeComponent();
     get_service = new get_GUI();
     serviceGet  = new ServiceGet();
     Customers   = get_service.GetAllCustomers();
     txtMaxBalance.isKeyNumber = true;
 }
예제 #8
0
 private void FrmSetupTax_Load(object sender, EventArgs e)
 {
     Services.get_GUI a = new get_GUI();
     DataTable taxRate = a.GetTaxRate(StaticClass.storeId);
     creTextBox1.Text = String.Format("{0:0.##}",(Convert.ToDecimal(taxRate.Rows[0]["Tax1_Rate"])*100));
     creTextBox2.Text = String.Format("{0:0.##}", (Convert.ToDecimal(taxRate.Rows[0]["Tax2_Rate"]) * 100));
     creTextBox3.Text = String.Format("{0:0.##}", (Convert.ToDecimal(taxRate.Rows[0]["Tax3_Rate"]) * 100));
 }
예제 #9
0
        public FrmQuanLyDanhMuc()
        {
            InitializeComponent();
            services = new get_GUI();

            catagries = services.GetAllCategories(StaticClass.storeId);
            dataBinding();
        }
예제 #10
0
 private void button2_Click(object sender, EventArgs e)
 {
     decimal t1 = Convert.ToDecimal(creTextBox1.Text)/100;
     decimal t2 = Convert.ToDecimal(creTextBox2.Text) / 100;
     decimal t3 = Convert.ToDecimal(creTextBox3.Text) / 100;
     Services.get_GUI get_GUI = new get_GUI();
     get_GUI.UpdateTax(StaticClass.storeId,t1,t2,t3);
     this.Dispose();
 }
예제 #11
0
        public FrmCustomer()
        {

            InitializeComponent();
            get_service = new get_GUI();
            serviceGet = new ServiceGet();
            Customers = get_service.GetAllCustomers();
            txtMaxBalance.isKeyNumber = true;
        }
예제 #12
0
 public FrmEmployee()
 {
     InitializeComponent();
     get_service = new get_GUI();
     Employees = get_service.GetAllEmployee(StaticClass.storeId);
     defaultPermission();
     //cmbDept.DisplayMember = Const.Department.Dept_ID;
     //cmbDept.DataSource = get_service.GetAllDepartmentsByType(StaticClass.storeId, Const.Department.EMPLOYEE);
     cmbDept.DataSource = viewOfDept();
     txtSwipt.isPass = true;
 }
예제 #13
0
 public FrmEmployee()
 {
     InitializeComponent();
     get_service = new get_GUI();
     Employees   = get_service.GetAllEmployee(StaticClass.storeId);
     defaultPermission();
     //cmbDept.DisplayMember = Const.Department.Dept_ID;
     //cmbDept.DataSource = get_service.GetAllDepartmentsByType(StaticClass.storeId, Const.Department.EMPLOYEE);
     cmbDept.DataSource = viewOfDept();
     txtSwipt.isPass    = true;
 }
예제 #14
0
 private void button3_Click(object sender, EventArgs e)
 {
     if(Alert.ShowAdminPassRequest())
     {
         FrmKeyBoard frmKeyBoard = new FrmKeyBoard(true);
         if(frmKeyBoard.ShowDialog() == DialogResult.OK)
         {
             Services.get_GUI get_GUI = new get_GUI();
             get_GUI.UpdateAdminSwipe(StaticClass.storeId, frmKeyBoard.value);
         }
     }
 }
예제 #15
0
 private void button2_Click(object sender, EventArgs e)
 {
     if( serviceGet.checkAdminPass(creTextBox1.Text, StaticClass.storeId))
     {
         if(creTextBox2.Text == creTextBox3.Text)
         {
             Services.get_GUI get_GUI = new get_GUI();
             get_GUI.UpdateAdminPass(StaticClass.storeId, creTextBox2.Text);
         }
         
     }
     this.Dispose();
    
 }
예제 #16
0
        public static bool CheckGrant(string storeId,string cashierId,int grantNum)
        {
            if(!StaticClass.isAdmin)
            {
                get_GUI getGui = new get_GUI();
                DataTable emp = getGui.GetEmpById(cashierId);
                Service.ServiceGet service = new ServiceGet();
                switch (grantNum)
                {
                    case XEM_BAN_KHAC:
                        return check(storeId, cashierId, "CFA_Other_Tables");
                    case CFA_INVOICE_DELETE_ITEMS:
                        return check(storeId, cashierId, "CFA_Invoice_DeleteItems");
                    case CFA_INVOICE_DISCOUNT:
                        return check(storeId, cashierId, "CFA_Invoice_Discount");
                    case CFA_INVOICE_PRICE_CHANGE:
                        return check(storeId, cashierId, "CFA_Invoice_PriceChange");
                    case CFA_INVOICE_VOID:
                        return check(storeId, cashierId, "CFA_Invoice_Void");
                    case CFA_TRANSFER_TABLE:
                        return check(storeId, cashierId, "CFA_Transfer_Tables");
                    case CFA_INVOICE_QUAN_CHANGE:
                        return check(storeId, cashierId, "CFA_ENDTRANS_CASH");
                    case CFA_INVOICE_RETURN:
                        return check(storeId, cashierId, "CFA_Refund_Item");
                    case CFA_SETUP_TAX:
                        return check(storeId, cashierId, "CFA_Setup_Tax");
                    case CFA_SETUP_PRINTER:
                        return check(storeId, cashierId, "CFA_Setup_DefPrinter");
                    case CFA_SETUP_RECEIPT_NOTES:
                        return check(storeId, cashierId, "CFA_SETUP_RECEIPT_NOTES");
                    case CFA_SETUP_DEPTS_EDIT:
                        return check(storeId, cashierId, "CFA_Depts_Edit");
                    case CFA_SETUP_INVENT_EDIT:
                        return check(storeId, cashierId, "CFA_Inven_Edit");
                    case CFA_SETUP_EDIT_EMP:
                        return check(storeId, cashierId, "CFA_SETUP_EDIT_EMPLOYEES");
                    case CFA_REPORT_DISPLAY:
                        return check(storeId, cashierId, "CFA_Reports_Display");
                    default:
                        return false;

                }
            }
            else
            {
                return true;
            }
            
        }
예제 #17
0
 public FrmDept()
 {
     get_service = new get_GUI();
     InitializeComponent();
     Categories = get_service.GetAllCategories(StaticClass.storeId);
     Service.Util.UpdateDataTableForCombo(cmbCate, Categories, 2);
     for (int j = 0; j < Categories.Rows.Count; j++)
     {
         if (Categories.Rows[j][2].Equals("Không phân loại"))
         {
             cmbCate.SelectedIndex = j;
             return;
         }
     }
 }
예제 #18
0
        public FrmDept()
        {
            get_service = new get_GUI();
            InitializeComponent();
            Categories = get_service.GetAllCategories(StaticClass.storeId);
            Service.Util.UpdateDataTableForCombo(cmbCate,Categories, 2);
            for(int j=0;j<Categories.Rows.Count;j++)
            {
                if(Categories.Rows[j][2].Equals("Không phân loại"))
                {
                    cmbCate.SelectedIndex = j;
                    return;
                }
            }

          
        }
예제 #19
0
 public FrmInventory()
 {
     InitializeComponent();
     get_service=new get_GUI();
     serviceGet = new ServiceGet();
     InventPrinters = new ArrayList();
     departs = get_service.GetAllDepartments2(StaticClass.storeId);
     Service.Util.UpdateDataTableForCombo(cmbDept, departs, 2);
     for (int j = 0; j < departs.Rows.Count; j++)
     {
         if (departs.Rows[j][2].Equals("Không phân loại"))
         {
             cmbDept.SelectedIndex = j;
             return;
         }
     }
 }
예제 #20
0
 public FrmInventory()
 {
     InitializeComponent();
     get_service    = new get_GUI();
     serviceGet     = new ServiceGet();
     InventPrinters = new ArrayList();
     departs        = get_service.GetAllDepartments2(StaticClass.storeId);
     Service.Util.UpdateDataTableForCombo(cmbDept, departs, 2);
     for (int j = 0; j < departs.Rows.Count; j++)
     {
         if (departs.Rows[j][2].Equals("Không phân loại"))
         {
             cmbDept.SelectedIndex = j;
             return;
         }
     }
 }
예제 #21
0
        public static bool CheckGrant(string storeId,string cashierId,int grantNum)
        {
            get_GUI getGui = new get_GUI();
            DataTable emp = getGui.GetEmpById(cashierId);
            Service.ServiceGet service = new ServiceGet();
            switch (grantNum)
            {
                case XEM_BAN_KHAC:
                    if(emp.Rows[0][XEM_BAN_KHAC].ToString() == "P")
                    {
                        return true;
                    }
                    else if (emp.Rows[0][XEM_BAN_KHAC].ToString() == "Y")
                    {
                        FrmAdminPass frm = new FrmAdminPass();
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            if (!service.checkAdminPass(frm.text, storeId))
                            {
                                MessageBox.Show("Password không đúng !");
                                return false;
                            }
                            else
                            {
                                return true;
                            }
                        }
                        else
                        {
                            return false;
                        }
                    }
                    else
                    {
                        return false;
                    }
                    break;
                default:
                    return false;

            }
        }
예제 #22
0
        public FrmReporting()
        {
            InitializeComponent();
            ArrayList thanh = new ArrayList();
            //thanh.AddRange(new string[]{"thanh","tuan"});
            listBox1.DataSource = viewSale();
            txtStartDate.Text = DateTime.Now.ToShortDateString();
            txtEndDate.Text = DateTime.Now.ToShortDateString();
            DateTime1 = new DateTime(DateTime.Now.Year,DateTime.Now.Month,DateTime.Now.Day,0,0,0);

            DateTime2 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
            txtStartTime.Text = "00" + ":00"  + ":" + "00" + " " + "AM";
            txtEndTime.Text = "11" + ":59" + ":" + "59" + " " + "PM";
            setChoseButton(btnSale);
            get_service=new get_GUI();
            
            Employee = get_service.GetAllEmployee(StaticClass.storeId);
            lstCashier.Items.Add("ALL");
            lstKindOfInvo.DataSource = viewKindOfInvoic();
        }
예제 #23
0
        public FrmReporting()
        {
            InitializeComponent();
            ArrayList thanh = new ArrayList();

            //thanh.AddRange(new string[]{"thanh","tuan"});
            listBox1.DataSource = viewSale();
            txtStartDate.Text   = DateTime.Now.ToShortDateString();
            txtEndDate.Text     = DateTime.Now.ToShortDateString();
            DateTime1           = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0);

            DateTime2         = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
            txtStartTime.Text = "00" + ":00" + ":" + "00" + " " + "AM";
            txtEndTime.Text   = "11" + ":59" + ":" + "59" + " " + "PM";
            setChoseButton(btnSale);
            get_service = new get_GUI();

            Employee = get_service.GetAllEmployee(StaticClass.storeId);
            lstCashier.Items.Add("ALL");
            lstKindOfInvo.DataSource = viewKindOfInvoic();
        }
예제 #24
0
        public FrmEditLayout()
        {
            pageIndex = 1;
            selectedSection = 1;
            InitializeComponent();
            getGui = new get_GUI();
            sections = new ArrayList();
            buttonKhu = new ArrayList();
            buttonKhu.Add(button10);
            buttonKhu.Add(button11);
            buttonKhu.Add(button22);
            buttonKhu.Add(button23);

            but_AddSec.changeColor(Color.White,Color.Green);
            button17.changeColor(Color.White, Color.LightSkyBlue);
            button13.changeColor(Color.White, Color.Orange);
            button14.changeColor(Color.White, Color.Orange);
            button15.changeColor(Color.White, Color.Orange);
            button16.changeColor(Color.White, Color.Red);
            button21.changeColor(Color.White, Color.Red);

            but_Done.changeColor(Color.White, Color.DimGray);
            but_Cancel.changeColor(Color.White, Color.DimGray);
        }
예제 #25
0
 private static bool check(string storeId, string cashierId, string columnName)
 {
     get_GUI getGui = new get_GUI();
     DataTable emp = getGui.GetEmpById(cashierId);
     Service.ServiceGet service = new ServiceGet();
     if (emp.Rows[0][columnName].ToString() == "Y")
     {
         return true;
     }
     else if (emp.Rows[0][columnName].ToString() == "P")
     {
         FrmAdminPass frm = new FrmAdminPass();
         if (frm.ShowDialog() == DialogResult.OK)
         {
             if (!service.checkAdminPass(frm.text, storeId))
             {
                 Alert.Show("Password không đúng !",Color.Red);
                 return false;
             }
             else
             {
                 return true;
             }
         }
         else
         {
             return false;
         }
     }
     else if (emp.Rows[0][columnName].ToString() == "N")
     {
         Alert.Show("Bạn không có quyền để\n thực hiện chức năng này",Color.Red);
         return false;
     }
     return false;
 }
예제 #26
0
        public SpecialPricing(string itemNum)
        {
            ItemNum = itemNum;
            getGui = new get_GUI();
            BulkInfoList = new ArrayList();
            OnSaleInfoList = new ArrayList();
            PricesList = new ArrayList();
            DataTable sale = getGui.GetBulkInfo(StaticClass.storeId, itemNum);
            if(sale != null)
            {
                for (int i = 0; i < sale.Rows.Count; i++)
                {
                    BulkInfo bulkInfo = new BulkInfo(Convert.ToSingle(sale.Rows[i]["Bulk_Quan"]), Convert.ToDecimal(sale.Rows[i]["Bulk_Price"]));
                    BulkInfoList.Add(bulkInfo);
                }
            }
            sale = getGui.GetOnsaleInfo(StaticClass.storeId, itemNum);
            if (sale != null)
            {
                for (int i = 0; i < sale.Rows.Count; i++)
                {
                    OnSalesInfo onSalesInfo = new OnSalesInfo(Convert.ToDateTime(sale.Rows[i]["Sale_Start"]), Convert.ToDateTime(sale.Rows[i]["Sale_End"]), Convert.ToSingle(sale.Rows[i]["Percent"]));
                    OnSaleInfoList.Add(onSalesInfo);
                }
            }

            sale = getGui.GetPrices(StaticClass.storeId, itemNum);
            if (sale != null)
            {
                for (int i = 0; i < sale.Rows.Count; i++)
                {
                    Prices prices = new Prices(Convert.ToDecimal(sale.Rows[i]["Price"]), Convert.ToDateTime(sale.Rows[i]["Criteria1"]), Convert.ToDateTime(sale.Rows[i]["Criteria2"]), Convert.ToString(sale.Rows[i]["Criteria3"]), Convert.ToBoolean(sale.Rows[i]["Enabled"]), Convert.ToInt32(sale.Rows[i]["PriceType"]));
                    PricesList.Add(prices);
                }
            }
        }
예제 #27
0
 public FrmSetupStation()
 {
     InitializeComponent();
     getGui = new get_GUI();
     serviceGet = new ServiceGet();
 }
예제 #28
0
 public ServiceGet()
 {
     getGui = new get_GUI();
 }
예제 #29
0
        //private Thread printReceiptThread;
        
        public FrmBanHang()
        {
            InitializeComponent();
            serviceGet = new ServiceGet();
            getGui = new get_GUI();
            frmPay = new FrmPay();
            //for (int i = 1; i < 8;i++ )
            //{
            //    button tmp = (button)panel1.Controls["button" + i.ToString()];
            //    tmp.changeColor(Color.White,Color.Orange);
            //}
            //for (int i = 15; i < 43; i++)
            //{
            //    button tmp = (button)panel2.Controls["button" + i.ToString()];
            //    tmp.changeColor(Color.White, Color.Gray);
            //}
            //button45.changeColor(Color.White,Color.OrangeRed);
            //button46.changeColor(Color.White, Color.OrangeRed);
            //button47.changeColor(Color.White,Color.Orange);
            //button48.changeColor(Color.White, Color.Yellow);
            //button49.changeColor(Color.White, Color.OrangeRed);
            //button50.changeColor(Color.White, Color.Gray);
            //button52.changeColor(Color.White, Color.Gray);
            //button53.changeColor(Color.White, Color.Orange);
            //button54.changeColor(Color.White, Color.Green);

            
            //listNhomHang = new ArrayList();
            
            
            //for (int i = 1; i < 18; i++)
            //{
            //    listNhomHang.Add(i.ToString());
            //}
            //for (int i = 1; i < 70; i++)
            //{
            //    listMatHang.Add(i.ToString());
            //}

            //listMatHang = new ArrayList();
            //listIdNhomHang = new ArrayList();
            //listNhomHang = new ArrayList();
            //listIdMatHang = new ArrayList();
            listTSButtonDept = new ArrayList();
            listTSButtonInvent = new ArrayList();
            DataTable tblnhomhang = serviceGet.GetDepartments("1001");
            for (int i = 0; i < tblnhomhang.Rows.Count; i++)
            {
                //listNhomHang.Add(tblnhomhang.Rows[i][2].ToString());
                //listIdNhomHang.Add(tblnhomhang.Rows[i][24].ToString());
                TSButton tsButton = new TSButton("01", Convert.ToInt32(tblnhomhang.Rows[i]["Index"]),
                 tblnhomhang.Rows[i]["Caption"].ToString(), tblnhomhang.Rows[i]["Picture"].ToString(), tblnhomhang.Rows[i]["Option1"].ToString(),
                 Convert.ToInt32(tblnhomhang.Rows[i]["BackColor"]), Convert.ToInt32(tblnhomhang.Rows[i]["ForeColor"]), Convert.ToBoolean(tblnhomhang.Rows[i]["Visible"]),
                 tblnhomhang.Rows[i]["Ident"].ToString());
                listTSButtonDept.Add(tsButton);
            }

            if(tblnhomhang.Rows.Count > 0)
            {
                DataTable tblMathang = getGui.GetInventoryByDept("0", ((TSButton)listTSButtonDept[0]).Ident, "1001");
                for (int i = 0; i < tblMathang.Rows.Count; i++)
                {
                    //listMatHang.Add(tblMathang.Rows[i][3].ToString());
                    //listIdMatHang.Add(tblMathang.Rows[i][7].ToString());
                    TSButton tsButton = new TSButton("01", Convert.ToInt32(tblMathang.Rows[i]["Index"]),
                     tblMathang.Rows[i]["Caption"].ToString(), tblMathang.Rows[i]["Picture"].ToString(), tblMathang.Rows[i]["Option1"].ToString(),
                     Convert.ToInt32(tblMathang.Rows[i]["BackColor"]), Convert.ToInt32(tblMathang.Rows[i]["ForeColor"]), Convert.ToBoolean(tblMathang.Rows[i]["Visible"]),
                     tblMathang.Rows[i]["Ident"].ToString());
                    listTSButtonInvent.Add(tsButton);
                }

            }
            else
            {
                button8.Visible = false;
            }
            

            if(listTSButtonDept.Count % 7 == 0)
            {
                numOfPageNhom = listTSButtonDept.Count / 7;
            }
            else
            {
                numOfPageNhom = listTSButtonDept.Count / 7 + 1;
                
            }

            if (listTSButtonInvent.Count % 28 == 0)
            {
                numOfPageMatHang = listTSButtonInvent.Count / 28;
            }
            else
            {
                numOfPageMatHang = listTSButtonInvent.Count / 28 + 1;
            }
            pageIndexNhom = 1;
            selectIndexNhom = 1;

            pageIndexMatHang = 1;

            
            LoadNhomHang();
            LoadMatHang();
            ////////////////////////////////////////////////////////////////////////////
            for (int i = 1; i < 8; i++)
            {
                string buttonName = "button" + i.ToString();
                button tmp = (button)panel1.Controls[buttonName];
                tmp.Click += new EventHandler(tmp_Click);
                //tmp.changeColor(Color.White, Color.Orange);
            }
            for (int i = 15; i < 43; i++)
            {
                button tmp1 = (button)panel2.Controls["button" + i.ToString()];
                //tmp1.changeColor(Color.White, Color.Gray);
                tmp1.Click += new EventHandler(tmp1_Click);
            }
            //UpdateInfo();

        }
예제 #30
0
        public FrmBanHang()
        {
            InitializeComponent();
            serviceGet = new ServiceGet();
            getGui = new get_GUI();
            //for (int i = 1; i < 8;i++ )
            //{
            //    button tmp = (button)panel1.Controls["button" + i.ToString()];
            //    tmp.changeColor(Color.White,Color.Orange);
            //}
            //for (int i = 15; i < 43; i++)
            //{
            //    button tmp = (button)panel2.Controls["button" + i.ToString()];
            //    tmp.changeColor(Color.White, Color.Gray);
            //}
            button45.changeColor(Color.White,Color.OrangeRed);
            button46.changeColor(Color.White, Color.OrangeRed);
            button47.changeColor(Color.White,Color.Orange);
            button48.changeColor(Color.White, Color.Yellow);
            button49.changeColor(Color.White, Color.OrangeRed);
            button50.changeColor(Color.White, Color.Gray);
            button52.changeColor(Color.White, Color.Gray);
            button53.changeColor(Color.White, Color.Orange);
            button54.changeColor(Color.White, Color.Green);

            
            //listNhomHang = new ArrayList();
            
            
            //for (int i = 1; i < 18; i++)
            //{
            //    listNhomHang.Add(i.ToString());
            //}
            //for (int i = 1; i < 70; i++)
            //{
            //    listMatHang.Add(i.ToString());
            //}

            listMatHang = new ArrayList();
            listIdNhomHang = new ArrayList();
            listNhomHang = new ArrayList();
            listIdMatHang = new ArrayList();
            DataTable tblnhomhang = serviceGet.GetDepartments("1001");
            for (int i = 0; i < tblnhomhang.Rows.Count; i++)
            {
                listNhomHang.Add(tblnhomhang.Rows[i][2].ToString());
                listIdNhomHang.Add(tblnhomhang.Rows[i][24].ToString());
            }

            DataTable tblMathang = getGui.GetInventoryByDept("0", listIdNhomHang[0].ToString(), "1001");
            for (int i = 0; i < tblMathang.Rows.Count; i++)
            {
                listMatHang.Add(tblMathang.Rows[i][3].ToString());
                listIdMatHang.Add(tblMathang.Rows[i][7].ToString());
            }

            if(listNhomHang.Count % 7 == 0)
            {
                numOfPageNhom = listNhomHang.Count/7;
            }
            else
            {
                numOfPageNhom = listNhomHang.Count / 7 + 1;
                
            }

            if (listMatHang.Count % 28 == 0)
            {
                numOfPageMatHang = listMatHang.Count / 28;
            }
            else
            {
                numOfPageMatHang = listMatHang.Count / 28 + 1;
            }
            pageIndexNhom = 1;
            selectIndexNhom = 1;

            pageIndexMatHang = 1;

            
            LoadNhomHang();
            LoadMatHang();

        }
예제 #31
0
 public FrmSetupStation()
 {
     InitializeComponent();
     getGui     = new get_GUI();
     serviceGet = new ServiceGet();
 }
예제 #32
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            GetDatabaseInfo getDatabaseInfo = new GetDatabaseInfo();
            if (!getDatabaseInfo.isconfiged)
            {
                FrmDelete requestconn = new FrmDelete();
                requestconn.label1.Text =
                    "Chưa có kết nối database.\n Bạn có muốn chọn database không?";
                if (requestconn.ShowDialog() == DialogResult.OK)
                {
                    FrmConfigDatabase frmConfigDatabase = new FrmConfigDatabase();
                    frmConfigDatabase.ShowDialog();
                }
            }
            else
            {
                
                
                
                if (DAO.DataProvider.TestConnection(getDatabaseInfo.mode, getDatabaseInfo.serverName,
                                                getDatabaseInfo.databaseName, getDatabaseInfo.user, getDatabaseInfo.pass))
                {
                    Services.get_GUI.serverName = getDatabaseInfo.serverName;
                    Services.get_GUI.databaseName = getDatabaseInfo.databaseName;
                    Services.get_GUI.Mode = getDatabaseInfo.mode;
                    Services.get_GUI.UserName = getDatabaseInfo.user;
                    Services.get_GUI.Password = getDatabaseInfo.pass;
                    Services.get_GUI getGUI = new get_GUI();
                    if (getGUI.GetSetupByStore(StaticClass.storeId) == null)
                    {
                        FrmDelete requestconn = new FrmDelete();
                        requestconn.label1.Text =
                        "Kết nối không thành công.\n Bạn có muốn chọn database không?";
                        if (requestconn.ShowDialog() == DialogResult.OK)
                        {
                            FrmConfigDatabase frmConfigDatabase = new FrmConfigDatabase();
                            frmConfigDatabase.ShowDialog();
                            return;
                        }

                    }
                    Lc.Check();
                    
                    if (StaticClass.version == Lc.Version.Demo)
                    {
                        
                        FrmRegisterInfo frmRegisterInfo;
                        int num = getGUI.GetNumOfInvoice();
                        if (num > 50)
                        {
                            frmRegisterInfo = new FrmRegisterInfo("Quá 100 hóa đơn.", false);
                            //frmRegisterInfo.ShowDialog();
                            Application.Run(frmRegisterInfo);
                            //if (MessBox2Choice.ShowBox("Quá 100 hóa đơn.\n Bạn có muốn đăng kí không?", Color.Red) == DialogResult.Yes)
                            //{
                            //    Application.Run(new FrmRegister());
                            //}
                        }
                        else
                        {
                            frmRegisterInfo = new FrmRegisterInfo("Bạn còn " + (100 - num).ToString() + " hóa đơn để thử\n với phiên bản Demo", true);
                            //frmRegisterInfo.ShowDialog();
                            frmRegisterInfo.ShowDialog();
                            //Alert.Show("Bạn còn " + (100 - num).ToString()+" hóa đơn để thử\n với phiên bản Demo");
                            Application.Run(new FrmLogin());
                        }
                    }
                    else
                    {
                        Application.Run(new FrmLogin());
                        //Application.Run(new FrmGeneralSetup());
                    }
                }
                else
                {
                    FrmDelete requestconn = new FrmDelete();
                    requestconn.label1.Text =
                    "Kết nối không thành công.\n Bạn có muốn chọn database không?";
                    if (requestconn.ShowDialog() == DialogResult.OK)
                    {
                        FrmConfigDatabase frmConfigDatabase = new FrmConfigDatabase();
                        frmConfigDatabase.ShowDialog();
                    }
                }

            }
            //Application.Run(new FrmCustomer());
        }
예제 #33
0
        public void FrmLogin_Load(object sender, EventArgs e)
        {
            //OleDbConnection m_cnADONetConnection = new OleDbConnection();
            //OleDbDataAdapter m_daDataAdapter;
            //OleDbCommandBuilder m_cbCommandBuilder;
            //DataTable m_dtDict = new DataTable();

            //m_cnADONetConnection.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + System.Windows.Forms.Application.StartupPath + @"\ConfigDatabase.mdb";

            //m_cnADONetConnection.Open();
            //m_daDataAdapter = new OleDbDataAdapter("Select * From DatabaseInfo", m_cnADONetConnection);
            //m_cbCommandBuilder = new OleDbCommandBuilder(m_daDataAdapter);
            //m_daDataAdapter.Fill(m_dtDict);
            //if (m_dtDict.Rows.Count != 0)
            //{
            //    StaticClass.mode = m_dtDict.Rows[0]["Mode"].ToString();
            //    if (m_dtDict.Rows[0]["InstanceName"].ToString() == "" )
            //    {
            //        StaticClass.serverName = m_dtDict.Rows[0]["ServerName"].ToString();
            //    }
            //    else
            //    {
            //        StaticClass.serverName = m_dtDict.Rows[0]["ServerName"].ToString() + "\\" + m_dtDict.Rows[0]["InstanceName"].ToString();
            //    }
                
            //    StaticClass.databaseName = m_dtDict.Rows[0]["DatabaseName"].ToString();
            //    Services.get_GUI.serverName = StaticClass.serverName;
            //    Services.get_GUI.databaseName = StaticClass.databaseName;
               
            //}
           
            serviceGet = new ServiceGet();
            getGui = new get_GUI();

            label5.Text = "Máy : " + StaticClass.stationId;
            button45.changeColor(Color.White, Color.Red);
            button46.changeColor(Color.White,Color.FromArgb(0,150,0));
            button9.changeColor(Color.White, Color.Red);
            button7.changeColor(Color.White, Color.FromArgb(0, 150, 0));
            button13.changeColor(Color.White,Color.Gray);
            button24.changeColor(Color.White, Color.Yellow);
            button25.changeColor(Color.White, Color.Yellow);
            button26.changeColor(Color.White, Color.Yellow);
            button27.changeColor(Color.White, Color.Yellow);
            button28.changeColor(Color.White, Color.Yellow);
            button29.changeColor(Color.White, Color.Yellow);
            button30.changeColor(Color.White, Color.Yellow);
            button31.changeColor(Color.White, Color.Yellow);
            button32.changeColor(Color.White, Color.Yellow);
            button33.changeColor(Color.White, Color.Yellow);
            button34.changeColor(Color.White, Color.Yellow);
            button35.changeColor(Color.White, Color.Yellow);
            button36.changeColor(Color.White, Color.Yellow);
            button37.changeColor(Color.White, Color.Yellow);
            button38.changeColor(Color.White, Color.Yellow);
            button39.changeColor(Color.White, Color.Yellow);
            button40.changeColor(Color.White, Color.Yellow);
            button41.changeColor(Color.White, Color.Yellow);
            button42.changeColor(Color.White, Color.Yellow);
            button43.changeColor(Color.White, Color.Yellow);
            button44.changeColor(Color.White, Color.Yellow);
            button48.changeColor(Color.White, Color.Yellow);
            button49.changeColor(Color.White, Color.Yellow);
            button50.changeColor(Color.White, Color.Yellow);
            button51.changeColor(Color.White, Color.Yellow);
            button52.changeColor(Color.White, Color.Yellow);
            button53.changeColor(Color.White,Color.Orange);
            button54.changeColor(Color.White,Color.Yellow);
            button55.changeColor(Color.White,Color.OrangeRed);


            panel2.Visible = false;
            panel1.Visible = true;
            textBox1.Clear();
            textBox2.Clear();
            //bool focus = textBox1.Focus();
            //bool f = textBox1.Focused;
            this.textBox1.Focus();
            this.Refresh();

            DataTable setup =  getGui.GetSetupByStore(StaticClass.storeId);
            string path = setup.Rows[0]["Company_Info_5"].ToString();
            FileInfo fi = new FileInfo(path);
            if(path != ""&& fi.Exists)
            {
                pictureBox1.Image = Image.FromFile(path);
            }
            label3.Text = setup.Rows[0]["Invoice_Notes_10"].ToString();
            
        }