Пример #1
0
        private void but_AddSec_Click(object sender, EventArgs e)
        {
            FrmKeyBoard a = new FrmKeyBoard();

            if (a.ShowDialog() == DialogResult.OK)
            {
                string secName = a.value;
                listPanel.Add(secName, new panel(secName));
                sections.Add(secName);
                this.Controls.Add((panel)listPanel[secName]);
                ((panel)listPanel[secName]).isNew = true;
                selectedSection = listPanel.Count;

                int x;
                if (listPanel.Count % 4 == 0)
                {
                    pageNum = listPanel.Count / 4;
                    x       = 4;
                }
                else
                {
                    pageNum = listPanel.Count / 4 + 1;
                    x       = listPanel.Count % 4;
                }
                pageIndex = pageNum;
                changeColorButton(x);
                checkInvisible();
                ((panel)listPanel[secName]).BringToFront();
                but_Done.BringToFront();
                but_Cancel.BringToFront();
            }
        }
Пример #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            decimal           costPer           = 0;
            string            desc              = "";
            string            quan              = "";
            FrmKeyboardNumber frmKeyboardNumber = new FrmKeyboardNumber("Số lượng");

            if (frmKeyboardNumber.ShowDialog() == DialogResult.OK)
            {
                quan = frmKeyboardNumber.value;
                FrmKeyBoard frmKeyBoard = new FrmKeyBoard();
                frmKeyBoard.label1.Text = "Ghi chú";
                if (frmKeyBoard.ShowDialog() == DialogResult.OK)
                {
                    desc = frmKeyBoard.value;
                    FrmKeyboardNumber frmKeyboardNumber1 = new FrmKeyboardNumber("Giá", txtGia.Text);
                    if (frmKeyboardNumber1.ShowDialog() == DialogResult.OK)
                    {
                        costPer = Convert.ToDecimal(frmKeyboardNumber1.value);
                        decimal newCostPer = (Convert.ToDecimal(txtKho.Text) * Convert.ToDecimal(txtGia.Text) +
                                              Convert.ToDecimal(quan) * costPer) /
                                             (Convert.ToDecimal(txtKho.Text) + Convert.ToDecimal(quan));
                        decimal sumQuan = Convert.ToDecimal(txtKho.Text) + Convert.ToDecimal(quan);
                        get_service.UpdateInStock(StaticClass.storeId, txtInvenId.Text, sumQuan.ToString());
                        get_service.UpdateCostPer(StaticClass.storeId, txtInvenId.Text, newCostPer.ToString());
                        get_service.InsertInventory_In(txtInvenId.Text, StaticClass.storeId, quan, costPer.ToString(), DateTime.Now.ToString(), "True", desc, StaticClass.cashierId);
                        txtKho.Text = String.Format("{0:0.##}", sumQuan);
                        txtGia.Text = String.Format("{0:#,#}", newCostPer);
                        inventory   = get_service.GetAllInventory(StaticClass.storeId);
                    }
                }
            }
        }
Пример #3
0
 private void textBox1_DoubleClick(object sender, EventArgs e)
 {
     if (tableType == "Invoices")
     {
         FrmKeyBoard frmKeyBoard = new FrmKeyBoard();
         if (frmKeyBoard.ShowDialog() == DialogResult.OK)
         {
             textBox1.Text = frmKeyBoard.value;
         }
     }
     else
     {
         try
         {
             Process p = new Process();
             //p.StartInfo.WorkingDirectory = @"C:\whatever";
             p.StartInfo.FileName       = Application.StartupPath + @"\FreeVK.exe";
             p.StartInfo.CreateNoWindow = true;
             p.Start();
             textBox1.Focus();
             //p.WaitForExit();
         }
         catch (Exception)
         {
             Alert.Show("Chương trình FreeVK.exe\n không tồn tại.", Color.Red);
         }
     }
 }
Пример #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            FrmKeyBoard frmKeyBoard = new FrmKeyBoard();

            if (frmKeyBoard.ShowDialog() == DialogResult.OK)
            {
                if (listBox1.Items.Contains(frmKeyBoard.value))
                {
                    Alert.Show("Mã này đã có rồi.", Color.Red);
                }
                else
                {
                    object[] station = new object[] { frmKeyBoard.value, StaticClass.storeId, "2", "1", "2", "0", "NONE", "NONE", "0", "NONEP", "NONE", "NONE", "NONE", "NONE"
                                                      , "N/A", "0", "NONE", true, true, "Y", "5", false, true, false, false, false, "0", "aaa",
                                                      "N/A", false, "1", true, "0", "sss", "0", "0", false, DateTime.Now, false, "0", "", "", "", "",
                                                      false, "0", "aaa", false, false, "0", "", "aaa", false, "1", "0", "0", false, "0", "NONE", "8421631",
                                                      false, "", 0, false, "1", true, false, "0", "0", false, false, false, false, false, "0", "0", false, "0", "0",
                                                      "aaa", "0", "0", false, false, "0", false, true, "NONEP", "", "", "0", "1", "1", "None", false, false, false, false, false,
                                                      "7", "0", "1", "1", 0, "NONE", "1", false, "1" };
                    getGui.InsertStation(station);
                    ArrayList printers = serviceGet.getPrinters(StaticClass.storeId, "01");
                    foreach (Printer o in printers)
                    {
                        serviceGet.InsertPrinter(o, frmKeyBoard.value);
                    }
                    listBox1.Items.Add(frmKeyBoard.value);
                }
            }
        }
Пример #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            FrmKeyBoard frmKeyBoard = new FrmKeyBoard();
            if(frmKeyBoard.ShowDialog() == DialogResult.OK)
            {
                if(listBox1.Items.Contains(frmKeyBoard.value))
                {
                    Alert.Show("Mã này đã có rồi.",Color.Red);
                }
                else
                {
                    object[] station = new object[] { frmKeyBoard.value, StaticClass.storeId, "2", "1", "2", "0", "NONE", "NONE", "0", "NONEP", "NONE", "NONE", "NONE", "NONE" 
                        ,"N/A","0","NONE",true,true,"Y","5",false,true,false,false,false,"0","aaa",
                        "N/A",false,"1",true,"0","sss","0","0",false,DateTime.Now,false,"0","","","","",
                        false,"0","aaa",false,false,"0","","aaa",false,"1","0","0",false,"0","NONE","8421631",
                        false,"",0,false,"1",true,false,"0","0",false,false,false,false,false,"0","0",false,"0","0",
                        "aaa","0","0",false,false,"0",false,true,"NONEP","","","0","1","1","None",false,false,false,false,false,
                        "7","0","1","1",0,"NONE","1",false,"1"};
                    getGui.InsertStation(station);
                    ArrayList printers = serviceGet.getPrinters(StaticClass.storeId, "01");
                    foreach (Printer o in printers)
                    {
                        serviceGet.InsertPrinter(o, frmKeyBoard.value);
                    }
                    listBox1.Items.Add(frmKeyBoard.value);

                    
                    
                }
            }
        }
Пример #6
0
 private void textBox1_Click(object sender, EventArgs e)
 {
     FrmKeyBoard frmKeyBoard = new FrmKeyBoard(true);
     if(frmKeyBoard.ShowDialog() == DialogResult.OK)
     {
         textBox1.Text = frmKeyBoard.value;
     }
 }
Пример #7
0
        private void textBox1_DoubleClick(object sender, EventArgs e)
        {
            FrmKeyBoard frmKeyBoard = new FrmKeyBoard(textBox1.Text);

            if (frmKeyBoard.ShowDialog() == DialogResult.OK)
            {
                textBox1.Text = frmKeyBoard.value;
            }
        }
Пример #8
0
        private void textBox1_Click(object sender, EventArgs e)
        {
            FrmKeyBoard frmKeyBoard = new FrmKeyBoard(true);

            if (frmKeyBoard.ShowDialog() == DialogResult.OK)
            {
                textBox1.Text = frmKeyBoard.value.ToLower();
            }
        }
Пример #9
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);
         }
     }
 }
Пример #10
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);
         }
     }
 }
Пример #11
0
        private void button13_Click(object sender, EventArgs e)
        {
            var a = new FrmKeyBoard();

            if (a.ShowDialog() == DialogResult.OK)
            {
                var tmp    = (panel)listPanel[sections[selectedSection - 1]];
                var tmpBut = new MyButton(100, 100, 100, 100, MyButton.ButtonStyles.Rectangle);
                tmpBut.Text_pro = a.value;
                tmpBut.isNew    = true;
                tmp.addButton(tmpBut);
            }
        }
Пример #12
0
        private void button57_Click(object sender, EventArgs e)
        {
            FrmKeyBoard kb = new FrmKeyBoard();

            if (kb.ShowDialog() == DialogResult.OK)
            {
                foreach (MyItem item in myCash1.get_RowSelected())
                {
                    myCash1.listInvoiceItem.Rows[item.Id - 1][3] = kb.value;
                }
                UpdateItemSelect();
            }
        }
Пример #13
0
        private void button61_Click(object sender, EventArgs e)
        {
            ArrayList   myItems     = myCash1.get_RowSelected();
            MyItem      myItem      = (MyItem)myItems[0];
            FrmKeyBoard frmKeyBoard = new FrmKeyBoard(myCash1.listInvoiceItem.Rows[myItem.Id - 1]["Kit_ItemNum"].ToString());

            if (frmKeyBoard.ShowDialog() == DialogResult.OK)
            {
                foreach (MyItem item in myItems)
                {
                    myCash1.listInvoiceItem.Rows[item.Id - 1]["Kit_ItemNum"] = frmKeyBoard.value;
                }
            }
        }
Пример #14
0
        private void button56_Click(object sender, EventArgs e)
        {
            FrmKeyBoard kb = new FrmKeyBoard();

            if (kb.ShowDialog() == DialogResult.OK)
            {
                foreach (MyItem item in myCash1.get_RowSelected())
                {
                    Decimal disc = Convert.ToDecimal(kb.value) / 100;
                    myCash1.listInvoiceItem.Rows[item.Id - 1][12] = disc;
                }
                UpdateItemSelect();
            }
        }
Пример #15
0
 private void button1_Click(object sender, EventArgs e)
 {
     FrmKeyBoard frmKeyBoard = new FrmKeyBoard(Displaytest);
     if(frmKeyBoard.ShowDialog() == DialogResult.OK)
     {
         if(frmKeyBoard.value != "")
         {
             Value = frmKeyBoard.value;
             this.DialogResult = DialogResult.OK;
         }
         else
         {
             this.Dispose();
         }
   
     }
 }
Пример #16
0
        private void button1_Click(object sender, EventArgs e)
        {
            FrmKeyBoard frmKeyBoard = new FrmKeyBoard(Displaytest);

            if (frmKeyBoard.ShowDialog() == DialogResult.OK)
            {
                if (frmKeyBoard.value != "")
                {
                    Value             = frmKeyBoard.value;
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    this.Dispose();
                }
            }
        }
Пример #17
0
        private void button1_Click(object sender, EventArgs e)
        {
            FrmKeyBoard frmKeyBoard = new FrmKeyBoard(true);

            if (frmKeyBoard.ShowDialog() == DialogResult.OK)
            {
                DataTable dataTable = get_service.getCustBySwipe(frmKeyBoard.value);
                if (dataTable.Rows.Count > 0)
                {
                    Alert.Show("Thẻ từ đã tồn tại !", Color.Red);
                    return;
                }
                Persistence.CustomerSwipe customerSwipe = new CustomerSwipe(frmKeyBoard.value);
                customerSwipe.isNew = true;
                listBox1.Items.Add(customerSwipe);
                swipeList.Add(customerSwipe);
            }
        }
Пример #18
0
        private void button1_Click(object sender, EventArgs e)
        {
            FrmKeyBoard frmKeyBoard = new FrmKeyBoard();

            if (frmKeyBoard.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (!Printers.ContainsKey(frmKeyBoard.value))
                {
                    Printer printer = new Printer(frmKeyBoard.value, "", "", "NONE", false, false, false);
                    printer.isNew = true;
                    Printers.Add(frmKeyBoard.value, printer);
                    listBox1.Items.Add(frmKeyBoard.value);
                    listBox1.SelectedIndex = listBox1.Items.Count - 1;
                }
                else
                {
                    Alert.Show("Tên máy in đã có rồi", Color.Red);
                }
            }
        }
Пример #19
0
 private void button1_Click(object sender, EventArgs e)
 {
     FrmKeyBoard frmKeyBoard = new FrmKeyBoard("");
     if(frmKeyBoard.ShowDialog() == DialogResult.OK)
     {
         if(frmKeyBoard.value != "")
         {
             foreach (var o in ReasonCodeList)
             {
                 if(frmKeyBoard.value == o.ToString())
                 {
                     Alert.Show("Ghi chú đã có",Color.Red);
                     return;
                 }
             }
             ReasonCode reasonCode = new ReasonCode(frmKeyBoard.value,ReasonCode.KitchenNote);
             reasonCode.isNew = true;
             listBox1.Items.Add(reasonCode);
             ReasonCodeList.Add(reasonCode);
         }
     }
 }
Пример #20
0
        private void button1_Click(object sender, EventArgs e)
        {
            FrmKeyBoard frmKeyBoard = new FrmKeyBoard("");

            if (frmKeyBoard.ShowDialog() == DialogResult.OK)
            {
                if (frmKeyBoard.value != "")
                {
                    foreach (var o in ReasonCodeList)
                    {
                        if (frmKeyBoard.value == o.ToString())
                        {
                            Alert.Show("Ghi chú đã có", Color.Red);
                            return;
                        }
                    }
                    ReasonCode reasonCode = new ReasonCode(frmKeyBoard.value, ReasonCode.KitchenNote);
                    reasonCode.isNew = true;
                    listBox1.Items.Add(reasonCode);
                    ReasonCodeList.Add(reasonCode);
                }
            }
        }
Пример #21
0
 private void button56_Click(object sender, EventArgs e)
 {
     FrmKeyBoard kb = new FrmKeyBoard();
     if (kb.ShowDialog() == DialogResult.OK)
     {
         foreach (MyItem item in myCash1.get_RowSelected())
         {
             Decimal disc = Convert.ToDecimal(kb.value)/100;
             myCash1.listInvoiceItem.Rows[item.Id - 1][12] = disc;
         }
         UpdateItemSelect();
     }
 }
Пример #22
0
 private void button13_Click(object sender, EventArgs e)
 {
     var a = new FrmKeyBoard();
     if (a.ShowDialog() == DialogResult.OK)
     {
         var tmp = (panel)listPanel[sections[selectedSection - 1]];
         var tmpBut = new MyButton(100, 100, 100, 100, MyButton.ButtonStyles.Rectangle);
         tmpBut.Text_pro = a.value;
         tmpBut.isNew = true;
         tmp.addButton(tmpBut);
     }
 }
Пример #23
0
        private void but_AddSec_Click(object sender, EventArgs e)
        {
            FrmKeyBoard a = new FrmKeyBoard();
            if(a.ShowDialog() == DialogResult.OK)
            {
                string secName = a.value;
                listPanel.Add(secName, new panel(secName));
                sections.Add(secName);
                this.Controls.Add((panel)listPanel[secName]);
                ((panel) listPanel[secName]).isNew = true;
                selectedSection = listPanel.Count;
                
                int x;
                if (listPanel.Count % 4 == 0)
                {
                    pageNum = listPanel.Count / 4;
                    x = 4;
                }
                else
                {
                    pageNum = listPanel.Count / 4 + 1;
                    x = listPanel.Count%4;
                }
                pageIndex = pageNum;
                changeColorButton(x);
                checkInvisible();
                ((panel)listPanel[secName]).BringToFront();
                but_Done.BringToFront();
                but_Cancel.BringToFront();
            }

            

        }
Пример #24
0
 private void button1_Click(object sender, EventArgs e)
 {
     FrmKeyBoard frmKeyBoard = new FrmKeyBoard();
     if(frmKeyBoard.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         if(!Printers.ContainsKey(frmKeyBoard.value))
         {
             Printer printer = new Printer(frmKeyBoard.value,"","","NONE",false,false,false);
             printer.isNew = true;
             Printers.Add(frmKeyBoard.value,printer);
             listBox1.Items.Add(frmKeyBoard.value);
             listBox1.SelectedIndex = listBox1.Items.Count - 1;
         }
         else
         {
             Alert.Show("Tên máy in đã có rồi",Color.Red);
         }
     }
 }
Пример #25
0
 private void button61_Click(object sender, EventArgs e)
 {
     ArrayList myItems = myCash1.get_RowSelected();
     MyItem myItem = (MyItem)myItems[0];
     FrmKeyBoard frmKeyBoard = new FrmKeyBoard(myCash1.listInvoiceItem.Rows[myItem.Id - 1]["Kit_ItemNum"].ToString());
     if (frmKeyBoard.ShowDialog() == DialogResult.OK)
     {
         foreach (MyItem item in myItems)
         {
             myCash1.listInvoiceItem.Rows[item.Id - 1]["Kit_ItemNum"] = frmKeyBoard.value;
         }
     }
    
 }
Пример #26
0
 private void button1_Click(object sender, EventArgs e)
 {
     FrmKeyBoard frmKeyBoard = new FrmKeyBoard(true);
     if(frmKeyBoard.ShowDialog() == DialogResult.OK)
     {
         DataTable dataTable = get_service.getCustBySwipe(frmKeyBoard.value);
         if (dataTable.Rows.Count > 0)
         {
             Alert.Show("Thẻ từ đã tồn tại !",Color.Red);
             return;
         }
         Persistence.CustomerSwipe customerSwipe = new CustomerSwipe(frmKeyBoard.value);
         customerSwipe.isNew = true;
         listBox1.Items.Add(customerSwipe);
         swipeList.Add(customerSwipe);
     }
 }
Пример #27
0
 private void button57_Click(object sender, EventArgs e)
 {
     FrmKeyBoard kb = new FrmKeyBoard();
     if(kb.ShowDialog() == DialogResult.OK)
     {
         foreach (MyItem item in myCash1.get_RowSelected())
         {
             myCash1.listInvoiceItem.Rows[item.Id - 1][3] = kb.value;
         }
         UpdateItemSelect();
     }
 }
Пример #28
0
 private void textBox1_DoubleClick(object sender, EventArgs e)
 {
     if(tableType == "Invoices")
     {
         FrmKeyBoard frmKeyBoard = new FrmKeyBoard();
         if(frmKeyBoard.ShowDialog() == DialogResult.OK)
         {
             textBox1.Text = frmKeyBoard.value;
         }
     }
     else
     {
         try
         {
             Process p = new Process();
             //p.StartInfo.WorkingDirectory = @"C:\whatever";
             p.StartInfo.FileName = Application.StartupPath + @"\FreeVK.exe";
             p.StartInfo.CreateNoWindow = true;
             p.Start();
             textBox1.Focus();
             //p.WaitForExit();
         }
         catch (Exception)
         {
             Alert.Show("Chương trình FreeVK.exe\n không tồn tại.", Color.Red);
         }
     }
     
 }
Пример #29
0
 private void button3_Click(object sender, EventArgs e)
 {
     decimal costPer = 0;
     string desc = "";
     string quan = "";
     FrmKeyboardNumber frmKeyboardNumber = new FrmKeyboardNumber("Số lượng");
     if(frmKeyboardNumber.ShowDialog() == DialogResult.OK)
     {
         quan = frmKeyboardNumber.value;
         FrmKeyBoard frmKeyBoard = new FrmKeyBoard();
         frmKeyBoard.label1.Text = "Ghi chú";
         if(frmKeyBoard.ShowDialog() == DialogResult.OK)
         {
             desc = frmKeyBoard.value;
             FrmKeyboardNumber frmKeyboardNumber1 = new FrmKeyboardNumber("Giá",txtGia.Text);
             if(frmKeyboardNumber1.ShowDialog() == DialogResult.OK)
             {
                 costPer = Convert.ToDecimal(frmKeyboardNumber1.value);
                 decimal newCostPer = (Convert.ToDecimal(txtKho.Text)*Convert.ToDecimal(txtGia.Text) +
                                       Convert.ToDecimal(quan)*costPer)/
                                      (Convert.ToDecimal(txtKho.Text) + Convert.ToDecimal(quan));
                 decimal sumQuan = Convert.ToDecimal(txtKho.Text) + Convert.ToDecimal(quan);
                 get_service.UpdateInStock(StaticClass.storeId,txtInvenId.Text,sumQuan.ToString());
                 get_service.UpdateCostPer(StaticClass.storeId,txtInvenId.Text,newCostPer.ToString());
                 get_service.InsertInventory_In(txtInvenId.Text, StaticClass.storeId, quan, costPer.ToString(), DateTime.Now.ToString(), "True", desc, StaticClass.cashierId);
                 txtKho.Text = String.Format("{0:0.##}", sumQuan);
                 txtGia.Text = String.Format("{0:#,#}", newCostPer);
                 inventory = get_service.GetAllInventory(StaticClass.storeId);
             }
         }
     }
 }