コード例 #1
0
        private void button11_Click(object sender, EventArgs e)
        {
            if (button11.Text.Equals("Lưu lại"))
            {
                if (txtInvenId.Text.Equals(""))
                {
                    Alert.Show("Bạn phải nhập mã đã!", Color.Red);
                    return;
                }
                //cmbCate.SelectedIndex = 0;
                DataRowView item = (DataRowView)cmbDept.SelectedItem;
                DataTable   tmp1 = get_service.GetAllDepartmentsByDeptId(txtInvenId.Text, StaticClass.storeId);
                DataTable   tmp  = get_service.GetInventoryByItemNum(StaticClass.storeId, txtInvenId.Text);
                if (tmp.Rows.Count > 0 || tmp1.Rows.Count > 0)
                {
                    Alert.Show("Mã này đã tồn tại", Color.Red);
                    return;
                }

                int function = 0;
                //MessageBox.Show(tmp.Rows[0]["ItemName"].ToString());
                get_service.CreateInventory(txtInvenId.Text, txtInventDesc.Text, StaticClass.storeId, (txtGia.Text),
                                            (txtGiaMua.Text), Convert.ToSingle(txtKho.Text), ckbTax1.Checked, ckbTax2.Checked,
                                            ckbTax3.Checked, item.Row[Const.Department.Dept_ID].ToString(), creCheckBox1.Checked,
                                            creCheckBox2.Checked, creCheckBox13.Checked, false,
                                            creCheckBox14.Checked, creCheckBox15.Checked, 0, creCheckBox8.Checked, creCheckBox9.Checked, creCheckBox3.Checked, Convert.ToInt16(creCheckBox10.Checked), creCheckBox7.Checked,
                                            "", creCheckBox12.Checked, creCheckBox4.Checked, creCheckBox5.Checked, creCheckBox6.Checked, StaticClass.stationIdForInvent, 0, item.Row[Const.Department.Dept_ID].ToString(), StaticClass.BackColor,
                                            StaticClass.ForeColor, txtGioiHanDat.Text, txtSolgDat.Text);
                inventory = get_service.GetAllInventory(StaticClass.storeId);
                limit     = inventory.Rows.Count - 1;
                serviceGet.UpdateInventPrinter(InventPrinters, txtInvenId.Text);
                specialPricing.ItemNum = txtInvenId.Text;
                specialPricing.Update();
                Ingredientupdate(txtInvenId.Text);
            }
            if (sender.Equals(button4))
            {
                AddState(0);
            }
            else
            {
                AddState(1);
            }
        }
コード例 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (button1.Text.Equals("Lưu lại"))
     {
         if (txtDeptID.Text.Equals(""))
         {
             Alert.Show("Bạn phải nhập mã", Color.Red);
             return;
         }
         //cmbCate.SelectedIndex = 0;
         DataRowView item = (DataRowView)cmbCate.SelectedItem;
         DataTable   tmp  = get_service.GetAllDepartmentsByDeptId(txtDeptID.Text, StaticClass.storeId);
         DataTable   tmp1 = get_service.GetInventoryByItemNum(StaticClass.storeId, txtDeptID.Text);
         if (tmp.Rows.Count > 0 || tmp1.Rows.Count > 0)
         {
             Alert.Show("Mã đã tồn tại", Color.Red);
             return;
         }
         int function = 0;
         get_service.CreateDepartment(txtDeptID.Text, StaticClass.storeId, item.Row[0].ToString(),
                                      txtDeptDesc.Text, getType(), checkBox1.Checked, textBox1.Text,
                                      checkBox2.Checked, checkBox3.Checked, checkBox4.Checked,
                                      Convert.ToDouble(creTextBox1.Text), Convert.ToInt32(creTextBox2.Text),
                                      StaticClass.stationId, "", function, "", StaticClass.BackColorDept,
                                      StaticClass.ForeColor);
         departs = get_service.GetAllDepartments2(StaticClass.storeId);
         limit   = departs.Rows.Count - 1;
     }
     if (sender.Equals(button4))
     {
         AddState(0);
     }
     else
     {
         AddState(1);
     }
 }