Example #1
0
        private void btn_xoa_Click(object sender, EventArgs e)
        {
            //MessageBox.Show(creComboBox1.SelectedText);
            //MessageBox.Show(creComboBox1.GetItemText(creComboBox1.SelectedItem));
            string CatId = creComboBox1.GetItemText(creComboBox1.SelectedItem);

            if (CatId.Equals("NONE"))
            {
                //MessageBox.Show("Bạn không được xóa thư mục này");
                Alert.Show("Bạn không được xóa thư mục này", Color.Red);
                return;
            }
            DataTable tmp = services.GetAllDepartmentsBySubType(StaticClass.storeId, CatId);

            if (tmp.Rows.Count > 0)
            {
                if (MessBox2Choice.ShowBox("neu xoa thi nhung mat hang thuoc loai nay se dc set None", Color.YellowGreen).Equals(System.Windows.Forms.DialogResult.Yes))
                {
                    services.DeleteCategory(creComboBox1.GetItemText(creComboBox1.SelectedItem), StaticClass.storeId);
                }
                return;
            }

            services.DeleteCategory(creComboBox1.GetItemText(creComboBox1.SelectedItem), StaticClass.storeId);
            catagries = services.GetAllCategories(StaticClass.storeId);
            limit     = catagries.Rows.Count - 1;
            dataBinding();
            button1_Click(button1, null);
        }
Example #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            //DataRowView item = (DataRowView) txtDeptID.SelectedItem;

            //MessageBox.Show(item.Row[0].ToString());
            //string CatId = item.Row[0].ToString();
            if (txtDeptID.Text.Equals("NONE"))
            {
                Alert.Show("Bạn không được xóa mặt hàng này", Color.Red);
                return;
            }
            DataTable tmp = get_service.GetAllInventoryByDept(StaticClass.storeId, txtDeptID.Text);

            if (tmp.Rows.Count > 0)
            {
                if (MessBox2Choice.ShowBox("neu xoa thi nhung mat hang thuoc loai nay se dc set None", Color.YellowGreen).Equals(System.Windows.Forms.DialogResult.Yes))
                {
                    get_service.DeleteDept(txtDeptID.Text, StaticClass.storeId);
                }
                return;
            }

            get_service.DeleteDept(txtDeptID.Text, StaticClass.storeId);
            departs = get_service.GetAllDepartments2(StaticClass.storeId);
            limit   = departs.Rows.Count - 1;
            button8_Click(button8, null);
        }
Example #3
0
 public static DialogResult ShowBox(string txtMessage, Color c)
 {
     newMessageBox             = new MessBox2Choice();
     newMessageBox.label1.Text = txtMessage;
     newMessageBox.label1.Left = (newMessageBox.Width - newMessageBox.label1.Width) / 2;
     newMessageBox.BackColor   = c;
     newMessageBox.ShowDialog();
     return(Button_id);
 }
Example #4
0
 public static DialogResult ShowBox(string txtMessage, Color c)
 {
     newMessageBox = new MessBox2Choice();
     newMessageBox.label1.Text = txtMessage;
     newMessageBox.label1.Left = (newMessageBox.Width - newMessageBox.label1.Width)/2;
     newMessageBox.BackColor = c;
     newMessageBox.ShowDialog();
     return Button_id;
 }
Example #5
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (serviceGet.getGui.OnholdNumber(StaticClass.storeId) != 0)
     {
         Alert.Show("Vẫn còn hóa đơn chưa\n thanh toán.", Color.Red);
         return;
     }
     if (MessBox2Choice.ShowBox("Bạn có muốn xóa tất cả \nhóa đơn không ?", Color.Red) == DialogResult.Yes)
     {
         serviceGet.getGui.ClearAllInvoice(StaticClass.storeId);
         string path = Application.StartupPath + @"\logfile.txt";
         if (File.Exists(path))
         {
             File.Delete(path);
         }
         Alert.Show("Xóa thành công");
     }
 }
Example #6
0
        private void button5_Click(object sender, EventArgs e)
        {
            DataTable InventoryItemize = get_service.GetInvoiceItemizedByItemNum(StaticClass.storeId, txtInvenId.Text);

            if (inventory.Rows.Count > 0)
            {
                DialogResult t =
                    MessBox2Choice.ShowBox("Mặt hàng mà bạn xóa \nhiện đã có người đang đặt.\n Bạn có muốn xóa không", Color.YellowGreen);
                if (t.Equals(System.Windows.Forms.DialogResult.No))
                {
                    return;
                }
            }
            get_service.DeleteInventory(txtInvenId.Text, StaticClass.storeId);
            inventory = get_service.GetAllInventory(StaticClass.storeId);
            limit     = inventory.Rows.Count - 1;
            button8_Click(button8, null);
        }
Example #7
0
        private void button5_Click(object sender, EventArgs e)
        {
            if (StaticClass.cashierId == txtEmpID.Text)
            {
                Alert.Show("Bạn đang đăng nhập\n vào tài khoản này !", Color.Red);
                return;
            }
            DataTable ExistEmployee = get_service.GetEmployeeInInvoiceTotal(txtEmpID.Text);

            if (ExistEmployee.Rows.Count > 0)
            {
                DialogResult t =
                    MessBox2Choice.ShowBox("Nhân viên mà bạn xóa \nHiện không xóa được.\n Bạn có muốn xóa không", Color.YellowGreen);
                if (t.Equals(System.Windows.Forms.DialogResult.No))
                {
                    return;
                }
            }
            get_service.DeleteEmployee(txtEmpID.Text, StaticClass.storeId);
            Employees = get_service.GetAllEmployee(StaticClass.storeId);
            limit     = Employees.Rows.Count - 1;
            button8_Click(button8, null);
        }
Example #8
0
        private void xóaHóaĐơnToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmAdminPass adminPass = new FrmAdminPass();

            if (adminPass.ShowDialog() == DialogResult.OK)
            {
                if (serviceGet.checkAdminPass(adminPass.text, "1001"))
                {
                    if (getGui.OnholdNumber(StaticClass.storeId) != 0)
                    {
                        Alert.Show("Vẫn còn hóa đơn chưa\n thanh toán.", Color.Red);
                        return;
                    }
                    if (MessBox2Choice.ShowBox("Bạn có muốn xóa tất cả \nhóa đơn không ?", Color.Red) == DialogResult.Yes)
                    {
                        getGui.ClearAllInvoice(StaticClass.storeId);
                    }
                }
                else
                {
                    Alert.Show("Bạn đã nhập sai \nmật khẩu !", Color.Red);
                }
            }
        }