public void AddState(int i) { button3.Enabled = false; button4.Enabled = false; button5.Enabled = false; button6.Enabled = false; button8.Enabled = false; button9.Enabled = false; button10.Enabled = false; //cmbCate.SelectedIndex = 0; ckb_Sua.Enabled = false; button11.Text = "Lưu lại"; button7.Text = "Hủy"; txtInvenId.Text = ""; txtInvenId.Enabled = true; txtInvenId.Focus(); if (i == 1) { txtGioiHanDat.Text = "0"; txtSolgDat.Text = "0"; txtInventDesc.Text = ""; creListBox1.Items.Clear(); InventPrinters.Clear(); creListBox2.Items.Clear(); creListBox3.Items.Clear(); creListBox4.Items.Clear(); dataGridView1.Rows.Clear(); InventIngredients = new ArrayList(); specialPricing = new SpecialPricing(); start_state(); } this.Refresh(); }
internal override decimal CalculateTotal() { if (SpecialPricing != null) { return(SpecialPricing.CalculateSpecial(_quantity, GetCurrentPrice())); } return(_quantity * GetCurrentPrice()); }
private void changeState(DataTable table, int rowIndex) { currentIndex = rowIndex; SetCurrentIndexComboBox(table, rowIndex); txtInvenId.Text = table.Rows[rowIndex][Const.Inventory.ItemNum].ToString(); txtInventDesc.Text = table.Rows[rowIndex][Const.Inventory.ItemName].ToString(); label1.Text = text_header + "'" + table.Rows[rowIndex][Const.Inventory.ItemName] + "'"; bool Modifier_Item = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.IsModifier]); bool Exclude = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.Exclude_Acct_Limit]); bool CheckId = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.Check_ID]); bool CheckId2 = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.Check_ID2]); bool CountThisItem = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.Count_This_Item]); bool PrintOnRe = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.Print_On_Receipt]); bool AllowBuy = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.Allow_BuyBack]); bool PromptPrice = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.Prompt_Price]); bool PromptQua = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.Prompt_Quantity]); // bool DisableItem = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.Inactive]); // bool SpecialPer = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.Special_Permission]); bool UseSerial = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.Use_Serial_Numbers]); bool Auto = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.AutoWeigh]); bool Food = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.FoodStampable]); byte Type = Convert.ToByte(table.Rows[rowIndex][Const.Inventory.ItemType]); string cost = table.Rows[rowIndex][Const.Inventory.Cost].ToString(); string price = table.Rows[rowIndex][Const.Inventory.Price].ToString(); string stock = table.Rows[rowIndex][Const.Inventory.In_Stock].ToString(); bool tax1 = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.Tax_1]); bool tax2 = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.Tax_2]); bool tax3 = Convert.ToBoolean(table.Rows[rowIndex][Const.Inventory.Tax_3]); txtGioiHanDat.Text = table.Rows[rowIndex][Const.Inventory.Reorder_Level].ToString(); txtSolgDat.Text = table.Rows[rowIndex][Const.Inventory.Reorder_Quantity].ToString(); float Instock = Convert.ToSingle(table.Rows[rowIndex][Const.Inventory.In_Stock]); txtKho.Text = Instock.ToString(); checkedAttribute(Modifier_Item, Exclude, CheckId, CheckId2, CountThisItem, PrintOnRe, AllowBuy, PromptPrice, PromptQua, DisableItem, SpecialPer, UseSerial, Auto, Food, Type, cost, price, tax1, tax2, tax3); InventPrinters = serviceGet.getAllInventPrinter(StaticClass.storeId, table.Rows[rowIndex][Const.Inventory.ItemNum].ToString()); creListBox1.Items.Clear(); for (int i = 0; i < InventPrinters.Count; i++) { Printer printer = (Printer)InventPrinters[i]; creListBox1.Items.Add(printer); //creListBox1.DisplayMember = "PrinterName"; } specialPricing = new SpecialPricing(table.Rows[rowIndex][Const.Inventory.ItemNum].ToString()); LoadSalePricing(); LoadIngredient(table.Rows[rowIndex][Const.Inventory.ItemNum].ToString()); }