private void Btn_ThemMon_Click(object sender, EventArgs e) { UserControl_Order usercontrol_order = new UserControl_Order(); usercontrol_order.SetChildListAdd(); LinkedListNode <UserControl_Order> node = FormOrder.List_Order.First; while (node != null) { if (node.Value.GetID_Order() == usercontrol_order.GetID_Order()) { node.Value.Update(usercontrol_order.ChildListAdd); break; } else { node = node.Next; } } FormMain._FormAdd.Panel_Button.Visible = true; FormMain._FormAdd.Panel_Button.BringToFront(); FormMain._FormAdd.Panel_ButtonThem.Visible = false; FormMain._FormAdd.Label_ID_Order.Visible = false; FormMain._FormAdd.gunaLabel3.Visible = false; FormMain._FormAdd.Combobox_ID_Table.Enabled = true; this.SetDefault(); }
private void Btn_Delete_Click(object sender, EventArgs e) { bool found = false; foreach (UserControl_Add control in FormMain._FormAdd.FlowLayoutPanel_ListAdd.Controls) { if (control == this) { foreach (UserControl_Item item in FormMain.List_Item) { if (item.UserControlAdd == control) { item.gunaGradientButton_tick.Visible = false; item.gunaLinePanel_tick.Visible = false; break; } } control.SetQuantity(0); FormAdd.List_Add.Remove(control); control.Dispose(); found = true; break; } } if (found == false) { foreach (UserControl_Add control in FormMain._FormOrder.FlowLayoutPanel_Bill.Controls) { if (control == this) { control.SetQuantity(0); UserControl_Order usercontrol_order = new UserControl_Order(); usercontrol_order.Remove_UserControlAdd(control); control.Dispose(); found = true; break; } } } if (found == false) { foreach (UserControl_Add control in FormMain._FormTable.FlowLayoutPanel_Bill.Controls) { if (control == this) { control.SetQuantity(0); UserControl_Table usercontrol_table = new UserControl_Table(); usercontrol_table.Remove_UserControlAdd(control); control.Dispose(); break; } } } }
private void Btn_TaoOrder_Click(object sender, EventArgs e) { if (FormAdd.List_Add.Count == 0) { this.SetDefault(); } else { SetIdOrder(); UserControl_Order usercontrol_order = new UserControl_Order(); usercontrol_order.Label_ID_Table.Text = this.Combobox_ID_Table.Text; usercontrol_order.SetTotal(FormMain._FormAdd.Label_Total.Text); usercontrol_order.SetChildListAdd(); FormOrder.List_Order.AddLast(usercontrol_order); FormMain._FormOrder.FlowLayoutPanel_Order.Controls.Add(FormOrder.List_Order.Last.Value); this.SetDefault(); } }