public void h_change(DBS.Menu menu) { textBox_Name.Text = menu.name; textBox_Price.Text = Function.int2string(menu.price); h_kind_search(menu.kind_key); button_Update.Text = "변경"; m_change_menu = menu; }
public void h_menu_date() { string time = dateTimePicker.Value.ToString("yyyy/MM/dd"); List <DBS.Receipt> receipt_list = DBS.Receipt.find_time(time); List <int> menu_key_list = new List <int>(); List <List <DBS.Order> > menu2order_list = new List <List <DBS.Order> >(); foreach (DBS.Receipt e in receipt_list) { foreach (DBS.Order a in DBS.Order.find_receipt(e.key)) { if (a.status == "판매") { bool triger = true; for (int i = 0; i < menu_key_list.Count; i++) { if (menu_key_list[i] == a.menu_key) { menu2order_list[i].Add(a); triger = false; } } if (triger) { menu_key_list.Add(a.menu_key); List <DBS.Order> orders = new List <DBS.Order>(); orders.Add(a); menu2order_list.Add(orders); } } } } DataTable table = new DataTable(); table.Columns.Add(new DataColumn("메뉴 이름", typeof(string))); table.Columns.Add(new DataColumn("판매수", typeof(float))); table.Columns.Add(new DataColumn("판매가격", typeof(float))); for (int i = 0; i < menu_key_list.Count; i++) { DataRow row = table.NewRow(); DBS.Menu menu = DBS.Menu.find(menu_key_list[i]); int count__ = menu2order_list[i].Count; int price__ = count__ * menu.price; row["메뉴 이름"] = menu.name; row["판매수"] = count__; row["판매가격"] = price__; table.Rows.Add(row); } dataGridView.DataSource = table; }
private void button_Menu_Add_Click(object sender, EventArgs e) { if (m_menu_current != null) { DBS.Menu menu = new DBS.Menu(m_menu_current); m_sale_menu_list.Add(menu); h_sale_item_update(); } else { MessageBox.Show("메뉴를 선택해 주세요"); } }
private void button_Update_Click(object sender, EventArgs e) { if (textBox_Name.Text == "") { MessageBox.Show("메뉴 이름을 입력하세요"); } if (comboBox_Kind.SelectedIndex < 0) { MessageBox.Show("종류를 선택하세요"); } DBS.Menu menu = new DBS.Menu(); menu.name = textBox_Name.Text; menu.price = Function.string2int(textBox_Price.Text); menu.kind_key = m_kind_list[comboBox_Kind.SelectedIndex].key; menu.status = "판매"; menu.save(); if (m_change_menu != null) { m_change_menu.chage_status("절판"); } Close(); }
public Menu_Create_Form() { InitializeComponent(); h_kind_set(); m_change_menu = null; }