Exemplo n.º 1
0
        void tmp1_Click(object sender, EventArgs e)
        {
            DataRow invent   = getGui.GetInventoryByItemNum(StaticClass.storeId, ((button)sender).Ident).Rows[0];
            string  itemName = invent[1].ToString();
            Decimal price    = Convert.ToDecimal(invent[4]);
            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;
            }
            object[] newrow = new object[] { invoiceNum, (myCash1.listInvoiceItem.Rows.Count + 1).ToString(), ((button)sender).Ident, "1", null, price, Tax1Per, Tax2Per, Tax3Per, null, null, null, 0.00, itemName, null, null, null, null, StaticClass.storeId, price, 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, "1", String.Format("{0:0,0}", price));
            UpdateInfo();
        }