protected void rbtlTableList_SelectedIndexChanged(object sender, EventArgs e) { int auxNumTable = this.rbtlTableList2.SelectedIndex + 1; this.ITableNumberGV = new MTableNumber(); TableNumber auxTableNumber = ITableNumberGV.getTable(auxNumTable); this.txtTableNumber.Text = auxNumTable.ToString(); this.sltTableStatus.SelectedIndex = auxTableNumber.IdTableStatus - 1; }
protected void btnUpdate_Click(object sender, EventArgs e) { try { if (txtTableNumber.Text != "Unselected table") { this.ITableNumberGV = new MTableNumber(); TableNumber pTable = new TableNumber(Convert.ToInt32(this.txtTableNumber.Text), this.sltTableStatus.SelectedIndex + 1); ITableNumberGV.ModifyTable(pTable); } } catch (Exception) { throw; } }
protected void btnAdd_Click(object sender, EventArgs e) { try { if (txtTableNumber.Text != "Unselected table") { this.ITableNumberGV = new MTableNumber(); TableNumber pTable = new TableNumber(); pTable.IdTableStatus = 1; //Free status ITableNumberGV.addTable(pTable); Response.Redirect("Addtables.aspx"); } } catch (Exception) { throw; } }
protected void Page_Load(object sender, EventArgs e) { try { //Load the created tables from DB if (!IsPostBack) { this.ITableNumberGV = new MTableNumber(); TL = ITableNumberGV.TableList(); rbtlTableList2.DataValueField = "idTable"; rbtlTableList2.DataTextField = "idTable"; rbtlTableList2.DataSource = TL; rbtlTableList2.DataBind(); //Fill the select (dropDown) with the Table Status created on db this.ITableStatus = new MTableStatus(); sltTableStatus.DataValueField = "description"; sltTableStatus.DataTextField = "idStatus"; this.TS = ITableStatus.TableStatusList(); sltTableStatus.DataSource = TS; sltTableStatus.DataBind(); } } catch (Exception) { throw; } }