Beispiel #1
0
 public static bool ShowClockInRequest()
 {
     ServiceGet serviceGet = new ServiceGet();
     FrmClockIn frmClockIn = new FrmClockIn();
     if(frmClockIn.ShowDialog() == DialogResult.OK)
     {
         if(frmClockIn.Success)
         {
             return true;
         }
         int check = serviceGet.Login(frmClockIn.MaNV, frmClockIn.pass.ToLower(), StaticClass.storeId);
         if(check ==2 )
         {
             return true;
         }
         if (check == 0)
         {
             Alert.Show("Đăng nhập sai mã nhân\n viên !", Color.Red);
             return false;
         }
         if (check == 1)
         {
             Alert.Show("Password không đúng !", Color.Red);
             return false;
         }
         if(check == 3)
         {
             Alert.Show("Tài khoản bị vô hiệu.", Color.Red);
             return false;
         }
     }
     return false;
 }
Beispiel #2
0
 public FrmSetupPrinter()
 {
     InitializeComponent();
     Printers = new Hashtable();
     serviceGet = new ServiceGet();
     getGui = new get_GUI();
 }
Beispiel #3
0
 public FrmPrintCashierReport()
 {
     InitializeComponent();
     serviceGet = new ServiceGet();
     startDate  = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0);
     endDate    = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
 }
 public FrmSelectKitchenNote()
 {
     InitializeComponent();
     serviceGet = new ServiceGet();
     Displaytest = "";
     Value = "";
 }
Beispiel #5
0
 public FrmSelectKitchenNote()
 {
     InitializeComponent();
     serviceGet  = new ServiceGet();
     Displaytest = "";
     Value       = "";
 }
Beispiel #6
0
 public FrmDeleteInvoice()
 {
     InitializeComponent();
     serviceGet = new ServiceGet();
     startDate  = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0);
     endDate    = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
 }
Beispiel #7
0
 public FrmSetupPrinter()
 {
     InitializeComponent();
     Printers   = new Hashtable();
     serviceGet = new ServiceGet();
     getGui     = new get_GUI();
 }
 public FrmPrintCashierReport()
 {
     InitializeComponent();
     serviceGet = new ServiceGet();
     startDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0);
     endDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
 }
 public FrmChangePassAdmin()
 {
     InitializeComponent();
     serviceGet = new ServiceGet();
     creTextBox1.isPass = true;
     creTextBox2.isPass = true;
     creTextBox3.isPass = true;
 }
Beispiel #10
0
 public FrmChangePassAdmin()
 {
     InitializeComponent();
     serviceGet         = new ServiceGet();
     creTextBox1.isPass = true;
     creTextBox2.isPass = true;
     creTextBox3.isPass = true;
 }
Beispiel #11
0
 public FrmCustomer()
 {
     InitializeComponent();
     get_service = new get_GUI();
     serviceGet  = new ServiceGet();
     Customers   = get_service.GetAllCustomers();
     txtMaxBalance.isKeyNumber = true;
 }
Beispiel #12
0
 public FrmDeleteInvoice()
 {
     InitializeComponent();
     serviceGet = new ServiceGet();
     startDate = new DateTime(DateTime.Now.Year,DateTime.Now.Month,DateTime.Now.Day,0,0,0);
     endDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
     
 }
Beispiel #13
0
        public FrmCustomer()
        {

            InitializeComponent();
            get_service = new get_GUI();
            serviceGet = new ServiceGet();
            Customers = get_service.GetAllCustomers();
            txtMaxBalance.isKeyNumber = true;
        }
Beispiel #14
0
 public static void Print(ReportClass reportClass,string printerName)
 {
     Service.ServiceGet serviceGet = new ServiceGet();
     Printer printer = serviceGet.GetPrinterByName(StaticClass.storeId, StaticClass.stationId, printerName);
     if (!(printer == null || printer.Details == "NONE" || printer.Disable == true))
     {
         reportClass.DataSourceConnections[0].SetConnection(StaticClass.serverName, StaticClass.databaseName, true);
         reportClass.PrintOptions.PrinterName = printer.Details;
         reportClass.PrintOptions.ApplyPageMargins(new PageMargins(1, 2, 1, 0));
         reportClass.PrintToPrinter(1,false,0,0);
     }
 }
Beispiel #15
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;
            }
            
        }
Beispiel #16
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;
         }
     }
 }
Beispiel #17
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;
         }
     }
 }
Beispiel #18
0
 public static bool ShowAdminPassRequest()
 {
     Service.ServiceGet serviceGet = new ServiceGet();
     FrmAdminPass frm = new FrmAdminPass();
     if (frm.ShowDialog() == DialogResult.OK)
     {
         if (!serviceGet.checkAdminPass(frm.text, StaticClass.storeId))
         {
             Alert.Show("Password không đúng !");
             return false;
         }
         else
         {
             return true;
         }
     }
     return false;
 }
Beispiel #19
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;

            }
        }
Beispiel #20
0
 public static void Print(ReportClass reportClass,string printerName)
 {
     Service.ServiceGet serviceGet = new ServiceGet();
     Printer printer = serviceGet.GetPrinterByName(StaticClass.storeId, StaticClass.stationId, printerName);
     if (!(printer == null || printer.Details == "NONE" || printer.Disable == true))
     {
         if (StaticClass.mode == "AUT")
         {
             reportClass.DataSourceConnections[0].SetConnection(StaticClass.serverName, StaticClass.databaseName, true);
         }
         else if (StaticClass.mode == "SQL")
         {
             //reportClass.DataSourceConnections[0].SetConnection(StaticClass.serverName, StaticClass.databaseName,
                                                               // StaticClass.userName, StaticClass.password);
             reportClass.SetDatabaseLogon(StaticClass.userName, StaticClass.password, StaticClass.serverName,
                                          StaticClass.databaseName,true);
             reportClass.DataSourceConnections[0].IntegratedSecurity = false;
         }
         else
         {
             return;
         }
         
         
         if(printerName == "Hóa đơn")
         {
             reportClass.PrintOptions.ApplyPageMargins(new PageMargins(1, 2, 1, 0));
         }
         
         try
         {
             reportClass.PrintOptions.PrinterName = printer.Details;
             reportClass.PrintToPrinter(1, false, 0, 0);
         }
         catch (Exception)
         {
             Alert.Show("Lỗi máy in", Color.Red);
         }
         
     }
 }
Beispiel #21
0
 private void creTextBox2_KeyPress(object sender, KeyPressEventArgs e)
 {
     
     if (e.KeyChar == 13)
     {
         Service.ServiceGet serviceGet = new ServiceGet();
         if (serviceGet.checkAdminPass(creTextBox2.Text, StaticClass.storeId))
         {
             Success = true;
             StaticClass.isAdmin = true;
             DialogResult = DialogResult.OK;
         }
         if(serviceGet.LoginBySwipe(creTextBox2.Text,StaticClass.storeId)==0)
         {
             Success = true;
             DialogResult = DialogResult.OK;
         }
         creTextBox1.SelectAll();
         creTextBox1.Focus();
     }
 }
Beispiel #22
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;
 }
Beispiel #23
0
 public FrmSelectKitchenNote(string text)
 {
     InitializeComponent();
     serviceGet  = new ServiceGet();
     Displaytest = text;
 }
Beispiel #24
0
 public FrmGeneralSetup()
 {
     InitializeComponent();
     serviceGet     = new ServiceGet();
     ReasonCodeList = serviceGet.GetReasonCode(StaticClass.storeId, ReasonCode.KitchenNote);
 }
 public FrmSelectKitchenNote(string text)
 {
     InitializeComponent();
     serviceGet = new ServiceGet();
     Displaytest = text;
 }
Beispiel #26
0
 public FrmPrinterChoice()
 {
     InitializeComponent();
     serviceGet = new ServiceGet();
 }
Beispiel #27
0
        private void FrmEditLayout_Load(object sender, EventArgs e)
        {
            //ArrayList a = new ArrayList();
            //a.Add(new MyButton(100,100,50,50));

            //ArrayList b = new ArrayList();
            //b.Add(new MyButton(200, 200, 100, 100));

            //ArrayList c = new ArrayList();
            //c.Add(new MyButton(200, 200, 100, 100));

            //ArrayList d = new ArrayList();
            //d.Add(new MyButton(200, 200, 100, 100));

            //ArrayList f = new ArrayList();
            //f.Add(new MyButton(200, 200, 100, 100));


            //listPanel.Add("khu 1", new panel("khu 1"));
            //listPanel.Add("khu 2", new panel(b, "khu 2"));
            //listPanel.Add("khu 3", new panel(c, "khu 3"));
            //listPanel.Add("khu 4", new panel(d, "khu 4"));
            //listPanel.Add("khu 5", new panel(f, "khu 5"));

            //sections.Add("khu 1");
            //sections.Add("khu 2");
            //sections.Add("khu 3");
            //sections.Add("khu 4");
            //sections.Add("khu 5");

            //this.Controls.Add((panel)listPanel["khu 1"]);
            //this.Controls.Add((panel)listPanel["khu 2"]);
            //this.Controls.Add((panel)listPanel["khu 3"]);
            //this.Controls.Add((panel)listPanel["khu 4"]);
            //this.Controls.Add((panel)listPanel["khu 5"]);

            serviceGet = new ServiceGet();
            DataTable sectionList = serviceGet.getSections("1001");
            for (int i = 0; i < sectionList.Rows.Count; i++)
            {
                string sectionName = sectionList.Rows[i][1].ToString();
                ArrayList buttons = serviceGet.getTablesEdit("1001", sectionName);
                Color color1 = Color.FromArgb((int) sectionList.Rows[i][2]);
                Color color2 = Color.FromArgb((int)sectionList.Rows[i][3]);
                
                listPanel.Add(sectionName, new panel(buttons,sectionName,color1,color2));
                sections.Add(sectionName);
                if(buttons.Count != 0)
                {
                    ((panel) listPanel[sectionName]).colorBar3.color_prop = ((MyButton) buttons[0]).borColor;
                }
                
                this.Controls.Add((panel)listPanel[sectionName]);
            }

            button10.changeColor(Color.White, Color.Red);
            pageIndex = 1;
            selectedSection = 1;

            if (listPanel.Count % 4 == 0)
            {
                pageNum = listPanel.Count / 4;
            }
            else
            {
                pageNum = listPanel.Count / 4 + 1; 
            }

            int x;
            if (pageIndex * 4 <= listPanel.Count)
            {
                x = 4;
            }
            else
            {
                x = listPanel.Count % 4;
            }

            changeColorButton(x);
            checkInvisible();
        }
Beispiel #28
0
 public FrmSetupStation()
 {
     InitializeComponent();
     getGui     = new get_GUI();
     serviceGet = new ServiceGet();
 }
Beispiel #29
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();

        }
Beispiel #30
0
 public FrmSetupTSButton()
 {
     InitializeComponent();
     serviceGet = new ServiceGet();
 }
Beispiel #31
0
 private void button51_Click(object sender, EventArgs e)
 {
     if (!Employee.CheckGrant(StaticClass.storeId, StaticClass.cashierId, Employee.CFA_Open_Cash_Drawer))
     {
         return;
     }
     //rptOpenDrawer rptOpenDrawer = new rptOpenDrawer();
     //Utilities.Utils.Print(rptOpenDrawer,Printer.PrinterHoadon);
     Service.ServiceGet serviceGet = new ServiceGet();
     Printer printer = serviceGet.GetPrinterByName(StaticClass.storeId, StaticClass.stationId, Printer.PrinterHoadon);
     if (!(printer == null || printer.Details == "NONE" || printer.Disable == true))
     {
         Service.CashdrawerService.OpenCashDrawer1(printer.Details);
     }
 }
Beispiel #32
0
 public FrmManager()
 {
     InitializeComponent();
     selectedButton = "";
     serviceGet = new ServiceGet();
 }
Beispiel #33
0
 public FrmLogin()
 {
     InitializeComponent();
     serviceGet = new ServiceGet();
 }
Beispiel #34
0
 public FrmSetupTSButton()
 {
     InitializeComponent();
     serviceGet = new ServiceGet();
 }
Beispiel #35
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();

        }
Beispiel #36
0
 public FrmPrinterChoice()
 {
     InitializeComponent();
     serviceGet = new ServiceGet();
 }
Beispiel #37
0
 public FrmGeneralSetup()
 {
     InitializeComponent();
     serviceGet = new ServiceGet();
     ReasonCodeList = serviceGet.GetReasonCode(StaticClass.storeId,ReasonCode.KitchenNote );
 }
Beispiel #38
0
 public FrmSetupStation()
 {
     InitializeComponent();
     getGui = new get_GUI();
     serviceGet = new ServiceGet();
 }
Beispiel #39
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();
            
        }