private string getSalesType() { if (Common.usrDefaultSalesType == "") { DataTable dt = new DataTable(); DataColumn colCode = new DataColumn("Code", Type.GetType("System.String")); DataColumn colName = new DataColumn("Name", Type.GetType("System.String")); dt.Columns.Add(colCode); dt.Columns.Add(colName); DataRow drow = dt.NewRow(); drow["Code"] = "1"; drow["Name"] = "Dine in"; dt.Rows.Add(drow); drow = dt.NewRow(); drow["Code"] = "2"; drow["Name"] = "Take away"; dt.Rows.Add(drow); drow = dt.NewRow(); drow["Code"] = "3"; drow["Name"] = "Delivery"; dt.Rows.Add(drow); SimpleSearchView frm = new SimpleSearchView(dt, "Sales Type", "Name", "Code"); if (frm.ShowDialog() == DialogResult.OK) { return(frm.SelectedCode); } else { return(""); } } else { return(Common.usrDefaultSalesType); } }
private void btnFloor_Click(object sender, EventArgs e) { string sql = "Select `FloorCode` as Code ,`FloorName` as Name FROM `tblfloor` "; DataTable dt = new DataTable(); dt = DbHelper.FillData(sql); SimpleSearchView frm = new SimpleSearchView(dt, "Floor", "Name", "Code"); if (frm.ShowDialog() == DialogResult.OK) { btnFloor.Text = frm.SelectedName; btnFloor.Tag = frm.SelectedCode; PopulateTables(frm.SelectedCode); } }