Пример #1
0
        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());
        }
Пример #2
0
        ///////////////////////////////////////////////////////////
        void tmp1_Click(object sender, EventArgs e)
        {
            DataRow invent = getGui.GetInventoryByItemNum(StaticClass.storeId, ((button)sender).Ident).Rows[0];
            float quant = PromptQuant(invent);
            if(quant <= 0 )
            {
                return;
            }

            if (CheckInStock(StaticClass.storeId, ((button)sender).Ident, 0, quant))
            {
                string itemName = invent[1].ToString();
                Decimal price = PromptPrice(invent);
                if(price == Convert.ToDecimal(-0.1234))
                {
                    return;
                }

                SpecialPricing specialPricing = new SpecialPricing(((button)sender).Ident);
                decimal newPrice =  specialPricing.CalculatePrice(1, price, Convert.ToDateTime(myCash1.invoiceTotal.Rows[0]["DateTime"]));

                //bool Tax1 = (bool)invent[9];
                //bool Tax2 = (bool)invent[10];
                //bool Tax3 = (bool)invent[11];
                Decimal Tax1Per = 0;
                Decimal Tax2Per = 0;
                Decimal Tax3Per = 0;
                //Decimal Tax1Rate = Convert.ToDecimal(StaticClass.taxRate[1]);
                //Decimal Tax2Rate = Convert.ToDecimal(StaticClass.taxRate[2]);
                //Decimal Tax3Rate = Convert.ToDecimal(StaticClass.taxRate[7]);
                //if (Tax1)
                //{
                //    Tax1Per = price * Tax1Rate;
                //}
                //if (Tax2)
                //{
                //    Tax2Per = price * Tax2Rate;
                //}
                //if (Tax3)
                //{
                //    Tax3Per = price * Tax3Rate;
                //}
                decimal costper = Convert.ToDecimal(invent[3]);
                object[] newrow = new object[] { invoiceNum, (myCash1.listInvoiceItem.Rows.Count + 1).ToString(), ((button)sender).Ident, quant.ToString(), costper, newPrice, Tax1Per, Tax2Per, Tax3Per, null, null, null, 0.00, itemName, null, null, null, null, StaticClass.storeId, newPrice, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null };
                myCash1.listInvoiceItem.Rows.Add(newrow);
                myCash1.addRow(itemName, String.Format("{0:0.##}", quant), String.Format("{0:0,0}", newPrice * Convert.ToDecimal(quant)));
                UpdateInfo();
                specialPricing = null;
                invent = null;
            }
        }
Пример #3
0
 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();
 }