Beispiel #1
0
        private void FrmBanHang_Load(object sender, EventArgs e)
        {
            myCash1.Label_Ban.Text      = tableName;
            myCash1.Label_ServerId.Text = StaticClass.thongTinNV["EmpName"].ToString();
            myCash1.listInvoiceItem     = getGui.GetInvoiceItemized(StaticClass.storeId, this.invoiceNum);
            myCash1.invoiceTotal        = getGui.GetInvoiceTotal(StaticClass.storeId, invoiceNum);
            taxInvoice1     = Convert.ToDecimal(myCash1.invoiceTotal.Rows[0]["InvoiceTax"]);
            numOfItemSended = myCash1.listInvoiceItem.Rows.Count;

            if (isOnHold)

            {
                foreach (DataRow c in myCash1.listInvoiceItem.Rows)
                {
                    Decimal quan     = Convert.ToDecimal(c[3]);
                    Decimal pricePer = Convert.ToDecimal(c[5]);
                    Decimal price    = quan * pricePer;
                    myCash1.addRow(">" + c[13].ToString(), String.Format("{0:0.##}", c[3]), String.Format("{0:0,0}", price));
                }
            }
            for (int i = 1; i < 8; i++)
            {
                string buttonName = "button" + i.ToString();
                button tmp        = (button)panel1.Controls[buttonName];
                tmp.Click += new EventHandler(tmp_Click);
                tmp.changeColor(Color.White, Color.Orange);
            }
            for (int i = 15; i < 43; i++)
            {
                button tmp1 = (button)panel2.Controls["button" + i.ToString()];
                tmp1.changeColor(Color.White, Color.Gray);
                tmp1.Click += new EventHandler(tmp1_Click);
            }
            UpdateInfo();
        }