private void SearchTable() { TableBusiness tdata = new TableBusiness(); var tlist = tdata.SearchTable(maindb, txtname.Text.Trim()); dgvallTables.DataSource = tlist; }
private void LoadTables() { TableBusiness tdata = new TableBusiness(); var tlist = tdata.GetTableList(maindb); dgvallTables.DataSource = tlist; }
private void button2_Click(object sender, EventArgs e) { TableBusiness tb = new TableBusiness(); TableBusiness.curentTable.Taken = false; tb.UpdateTable(TableBusiness.curentTable); BillBusiness bb = new BillBusiness(); BillBusiness.currentBill.Paid = true; bb.UpdateCaffeBill(BillBusiness.currentBill); this.Hide(); }
protected void Button3_ServerClick(object sender, EventArgs e) { TableBusiness tb = new TableBusiness(); BillBusiness bb = new BillBusiness(); TableBusiness.curentTable.Taken = false; tb.UpdateTable(TableBusiness.curentTable); BillBusiness.currentBill.Paid = true; bb.UpdateCaffeBill(BillBusiness.currentBill); BillBusiness.currentBill = null; Response.Redirect("Home.aspx"); }
private void B_Click(object sender, EventArgs e) { BillBusiness b11 = new BillBusiness(); Button b1 = sender as Button; TableBusiness tb = new TableBusiness(); CaffeTable t = tb.getCaffeTables().Where(x => x.Table_ID == (Convert.ToInt32(b1.ID))).ToList()[0]; tb.UpdateTable(t); BillBusiness.currentBill = b11.getCaffeBills().Where(x => x.Paid == false && t.Table_ID == x.Table_ID).ToList()[0]; TableBusiness.curentTable = t; Response.Redirect("Bill.aspx"); }
public void InitControl(SqlConnectionStringBuilder conn, string schema) { groupBox1.Controls.Clear(); TableBusiness tableBusiness = new TableBusiness(); try { List <Table> lstTable = tableBusiness.ListTables(conn, schema); TreeView tree = new TreeView(); tree.ImageList = lstImage; tree.Name = "tvTables"; tree.CheckBoxes = true; tree.AfterCheck += new TreeViewEventHandler(tree_AfterCheck); tree.Dock = DockStyle.Fill; AdvancedTreeNode node; AdvancedTreeNode nodeSon; foreach (Table table in lstTable) { node = new AdvancedTreeNode(); node.Checked = true; node.Text = table.Name; node.Value = table; node.SelectedImageIndex = (int)DBImage.TABLE; node.ImageIndex = (int)DBImage.TABLE; tree.Nodes.Add(node); foreach (Column column in table.Columns) { nodeSon = new AdvancedTreeNode(); nodeSon.Checked = true; nodeSon.Text = column.Name + " (" + ListarAtributos(column) + ")"; nodeSon.Value = column; nodeSon.SelectedImageIndex = GetImageIndex(column); nodeSon.ImageIndex = GetImageIndex(column); node.Nodes.Add(nodeSon); } } groupBox1.Controls.Add(tree); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
protected void Page_Load(object sender, EventArgs e) { currwork.InnerText = WorkerBusiness.currentWoker.User_Name; int i = 1; TableBusiness tb = new TableBusiness(); foreach (CaffeTable c in tb.getCaffeTables()) { column = new HtmlGenericControl("div"); column.Attributes.Add("class", "col-3 text-center"); Button b = new Button(); b.Text = "Račun"; b.Click += B_Click; b.ID = c.Table_ID.ToString(); b.Attributes.Add("class", "btn btn-outline-danger btnBillTaken"); b.Attributes.Add("style", "background:white;opacity:0.6"); b.CommandArgument = i.ToString(); Button b1 = new Button(); b1.Text = "Zauzmi"; b1.Click += B1_Click; b1.ID = (c.Table_ID + 99).ToString(); b1.CommandArgument = i.ToString(); b1.Attributes.Add("class", "btnBillFree btn btn-outline-success "); b1.Attributes.Add("style", "background:white;opacity:0.6"); if (c.Taken) { column.InnerHtml += $"<p style='background:red;border-radius: 0.5rem'>Sto: {i} <br><i class='fa fa-coffee fa-3x' aria-hidden='true'></i><br> Broj mesta: {c.Number_Of_Seats}<p>"; column.Controls.Add(b); } else { column.InnerHtml += $"<p style='background:green;border-radius: 0.5rem'>Sto: {i} <br><i class='fa fa-coffee fa-3x' aria-hidden='true'></i><br> Broj mesta: {c.Number_Of_Seats}<p>"; column.Controls.Add(b1); } maindiv.Controls.Add(column); i++; } }
private void button13_Click(object sender, EventArgs e) { BillBusiness b11 = new BillBusiness(); TableBusiness tb = new TableBusiness(); CaffeTable t = tb.getCaffeTables().Where(x => x.Table_ID == Convert.ToInt32(button13.Text)).ToList()[0]; TableBusiness.curentTable = t; t.Taken = true; tb.UpdateTable(t); try { BillBusiness.currentBill = b11.getCaffeBills().Where(x => x.Paid == false && t.Table_ID == x.Table_ID).ToList()[0]; } catch (Exception ex) { b11.InsertCaffeBill(new CaffeBill(999, t.Table_ID, 0, DateTime.Now, false)); BillBusiness.currentBill = b11.getCaffeBills().Where(x => x.Paid == false && t.Table_ID == x.Table_ID).ToList()[0]; } Bill b = new Bill(); b.Show(); }
public TreeView InitTreeView(string seach) { TableBusiness tableBusiness = new TableBusiness(); TreeView tree = new TreeView(); tree.Name = "tvTables"; tree.CheckBoxes = true; try { AdvancedTreeNode node; AdvancedTreeNode nodeSon; List <Table> lstTable = tableBusiness.ListTables(ConnBuilder, seach); foreach (Table table in lstTable) { node = new AdvancedTreeNode(); node.Checked = true; node.Text = table.Name; node.Value = table; node.SelectedImageIndex = (int)DBImage.TABLE; node.ImageIndex = (int)DBImage.TABLE; tree.Nodes.Add(node); foreach (Column column in table.Columns) { nodeSon = new AdvancedTreeNode(); nodeSon.Checked = true; nodeSon.Text = column.Name + " (" + ListarAtributos(column) + ")"; nodeSon.Value = column; nodeSon.SelectedImageIndex = GetImageIndex(column); nodeSon.ImageIndex = GetImageIndex(column); node.Nodes.Add(nodeSon); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return(tree); }
private void B1_Click(object sender, EventArgs e) { BillBusiness b11 = new BillBusiness(); Button b1 = sender as Button; TableBusiness tb = new TableBusiness(); CaffeTable t = tb.getCaffeTables().Where(x => x.Table_ID == (Convert.ToInt32(b1.ID) - 99)).ToList()[0]; t.Taken = true; tb.UpdateTable(t); try { BillBusiness.currentBill = b11.getCaffeBills().Where(x => x.Paid == false && t.Table_ID == x.Table_ID).ToList()[0]; } catch (Exception ex) { b11.InsertCaffeBill(new CaffeBill(999, (Convert.ToInt32(b1.ID) - 99), 0, DateTime.Now, false)); BillBusiness.currentBill = b11.getCaffeBills().Where(x => x.Paid == false && t.Table_ID == x.Table_ID).ToList()[0]; } t.Table_ID = Convert.ToInt32(b1.CommandArgument); TableBusiness.curentTable = t; Response.Redirect("Bill.aspx"); }
public TableController() { _tableBus = new TableBusiness(); _db = new SqlContext(); }