コード例 #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
ファイル: FrmSetupStation.cs プロジェクト: hpbaotho/thanhtuan
        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
ファイル: FrmAdminPass.cs プロジェクト: hpbaotho/thanhtuan
 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
ファイル: FrmGeneralSetup.cs プロジェクト: hpbaotho/thanhtuan
 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
ファイル: FrmBanHang.cs プロジェクト: hpbaotho/thanhtuan
 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
ファイル: FrmEditLayout.cs プロジェクト: hpbaotho/thanhtuan
 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
ファイル: FrmEditLayout.cs プロジェクト: hpbaotho/thanhtuan
        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
ファイル: FrmSetupPrinter.cs プロジェクト: hpbaotho/thanhtuan
 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
ファイル: FrmBanHang.cs プロジェクト: hpbaotho/thanhtuan
 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
ファイル: FrmCustomer.cs プロジェクト: hpbaotho/thanhtuan
 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
ファイル: FrmBanHang.cs プロジェクト: hpbaotho/thanhtuan
 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
ファイル: FrmSearch.cs プロジェクト: hpbaotho/thanhtuan
 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
ファイル: FrmInventory.cs プロジェクト: hpbaotho/thanhtuan
 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);
             }
         }
     }
 }