Ejemplo n.º 1
0
        private void chon_Click(object sender, EventArgs e)
        {
            Button b   = sender as Button;
            var    pr  = b.Parent;
            var    num = pr.Controls.Find("SL", false).First() as NumericUpDown;

            if (num.Value > 0)
            {
                Detail.AddOrUpdateDetail(Convert.ToInt32(b.Tag.ToString()), ID_Bill, Convert.ToInt32(num.Value));
                pr.BackColor             = Color.Yellow;
                dataGridView1.DataSource = Bill.GetBill(ID_Bill);
                dataGridView1.Columns["Price"].DefaultCellStyle.Format = "#,##0";
                dataGridView1.Columns["Total"].DefaultCellStyle.Format = "#,##0";
                textBox2.Text = string.Format("{0:#,##0}", Bill.TotalByBill(ID_Bill));
            }
        }