Esempio n. 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);
            }
        }