public void getMenu() { int Category = int.Parse(Request.QueryString["Category"]); if (Category > 0) { CommonClassLibrary.CommonDataSet.CategoryDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.CategoryTableAdapter().GetDataByID(Category); foreach (CommonClassLibrary.CommonDataSet.CategoryRow item in collection) { CommonClassLibrary.CommonDataSet.TextContentDataTable collection3 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(long.Parse(item.Name)); foreach (CommonClassLibrary.CommonDataSet.TextContentRow item3 in collection3) { this.Menu2_Label.Text = item3.Thai; this.BackMenu_HyperLink.Text = item3.English; } //this.Menu_Label.Text = item.Name; //this.Menu2_Label.Text = item.Name; //this.BackMenu_HyperLink.Text = item.Name; } } else { this.Menu2_Label.Text = "รายการอาหารเเละเครื่องดื่มทั้งหมด"; this.BackMenu_HyperLink.Text = "รายการอาหารเเละเครื่องดื่มทั้งหมด"; } }
public void Showdata() { string nameEn = ""; string name = ""; //string detail = ""; //string price = ""; //string promotion = ""; DataTable dt = new DataTable(); dt.Columns.Add("IDProduct"); dt.Columns.Add("Name"); dt.Columns.Add("NameEN"); CommonClassLibrary.CommonDataSet.TableDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.TableTableAdapter().GetData(); foreach (CommonClassLibrary.CommonDataSet.TableRow item in collection) { CommonClassLibrary.CommonDataSet.TextContentDataTable collection3 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(long.Parse(item.Name)); foreach (CommonClassLibrary.CommonDataSet.TextContentRow item3 in collection3) { name = item3.Thai; nameEn = item3.English; } dt.Rows.Add(item.Id, name, nameEn); } this.CategoryTa.DataSource = dt; this.CategoryTa.DataBind(); }
public void getcategorycheckbox() { string nameEn = ""; string nameCH = ""; string name = ""; string imageUrl = "Image/no_image_available.jpg"; DataTable dt = new DataTable(); dt.Columns.Add("Id"); dt.Columns.Add("Name"); dt.Columns.Add("ImageURL"); dt.Columns.Add("NameEN"); dt.Columns.Add("NameCN"); CommonClassLibrary.CommonDataSet.CategoryDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.CategoryTableAdapter().GetDataByStatus(1); foreach (CommonClassLibrary.CommonDataSet.CategoryRow item in collection) { CommonClassLibrary.CommonDataSet.TextContentDataTable collection3 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(long.Parse(item.Name)); foreach (CommonClassLibrary.CommonDataSet.TextContentRow item3 in collection3) { name = item3.Thai; nameEn = item3.English; } imageUrl = item.ImageURL; dt.Rows.Add(item.Id, name, imageUrl, nameEn, nameCH); } this.radiobutton.DataSource = dt; this.radiobutton.DataTextField = "Name"; this.radiobutton.DataValueField = "Id"; this.radiobutton.DataBind(); }
public void getdatarepeater1() { DataTable dt = new DataTable(); dt.Columns.Add("Product"); //dt.Columns.Add("ProductDetail"); dt.Columns.Add("Price"); dt.Columns.Add("Checkin"); dt.Columns.Add("Checkout"); dt.Columns.Add("Quantity"); dt.Columns.Add("Total"); dt.Columns.Add("ProductOrderID"); decimal total = 0; long ID = long.Parse(Request.QueryString["Id"]); CommonClassLibrary.CommonDataSet.ProductOrderDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.ProductOrderTableAdapter().GetDataByTicket2(ID); foreach (CommonClassLibrary.CommonDataSet.ProductOrderRow item in collection) { CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowName(item.Product); foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item2 in collection2) { string name = ""; CommonClassLibrary.CommonDataSet.TextContentDataTable dt1 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(long.Parse(item2.KeyValue)); name = dt1.Rows[0]["Thai"].ToString(); total += item.Total; dt.Rows.Add(name, item.Price.ToString("#,###") + ".-", item.CreatedDate.ToString("dd-MM-yyyy") + " " + item.CreatedDate.ToString("HH:mm" + " น."), item.LastUpdated.ToString("dd-MM-yyyy") + " " + item.LastUpdated.ToString("HH:mm" + " น."), item.Quantity, item.Total.ToString("#,###") + ".-", item.Id); } } this.DetailTicketOrderRepeater1.DataSource = dt; this.DetailTicketOrderRepeater1.DataBind(); this.Total_Label.Text = total.ToString("#,###") + ".-"; }
protected void CategoryTa_ItemCommand(object source, RepeaterCommandEventArgs e) { Label idlabel = (Label)e.Item.FindControl("idLabel"); this.aaa_TextBox.Text = idlabel.Text; if (e.CommandName == "EditBtn") { //this.getImage(); CommonClassLibrary.CommonDataSet.TableDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.TableTableAdapter().GetDataById(int.Parse(idlabel.Text)); foreach (CommonClassLibrary.CommonDataSet.TableRow item in collection) { this.Labelidname.Text = item.Name; } this.EditPanel.Visible = true; this.AddPanel.Visible = false; this.ShowPanel.Visible = false; CommonClassLibrary.CommonDataSet.TextContentDataTable collection1 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(int.Parse(Labelidname.Text)); foreach (CommonClassLibrary.CommonDataSet.TextContentRow item1 in collection1) { editName_TextBox.Text = item1.Thai; editNameEN_TextBox.Text = item1.English; } this.EditPanel.Visible = true; this.AddPanel.Visible = false; this.ShowPanel.Visible = false; } else if (e.CommandName == "DeleteBtn") { try { if (new CommonClassLibrary.CommonDataSetTableAdapters.TableTableAdapter().DeleteQuery(int.Parse(aaa_TextBox.Text)) == 1) { this.SuccessPanel.Visible = true; this.ErrorPanel.Visible = false; this.SuccessLabel.Text = "ลบข้อมูลสำเร็จ"; } else { this.SuccessPanel.Visible = false; this.ErrorPanel.Visible = true; this.ErrorLabel.Text = "ลบข้อมูลไม่สำเร็จ"; } } catch (Exception) { } this.Showdata(); } }
public void getMenu() { int Category = int.Parse(Request.QueryString["Category"]); string IDProduct = Request.QueryString["IDProduct"]; this.BackMenu_HyperLink.NavigateUrl = "~/MenuBeverage.aspx?IDProduct=" + IDProduct + "&Category=" + Category; CommonClassLibrary.CommonDataSet.CategoryDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.CategoryTableAdapter().GetDataByID(Category); foreach (CommonClassLibrary.CommonDataSet.CategoryRow item in collection) { CommonClassLibrary.CommonDataSet.TextContentDataTable collection222 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(long.Parse(item.Name)); foreach (CommonClassLibrary.CommonDataSet.TextContentRow item222 in collection222) { this.Menu2_Label.Text = "แก้ไข " + item222.Thai; this.BackMenu_HyperLink.Text = item222.Thai; this.Menu1_Label.Text = "แก้ไข " + item222.Thai; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { System.Web.UI.HtmlControls.HtmlGenericControl Services = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("Li5"); Services.Attributes.Add("class", "active"); int IDProduct = int.Parse(Request.QueryString["IDProduct"]); CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowName(IDProduct); foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item in collection) { Label4.Text = item.KeyValue; CommonClassLibrary.CommonDataSet.TextContentDataTable collection111 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(long.Parse(item.KeyValue)); foreach (CommonClassLibrary.CommonDataSet.TextContentRow item111 in collection111) { this.Name_TextBox.Text = item111.Thai; this.NameEN_TextBox.Text = item111.English; } } CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowDetail(IDProduct); foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item2 in collection2) { Label5.Text = item2.KeyValue; CommonClassLibrary.CommonDataSet.TextContentDataTable collection222 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(long.Parse(item2.KeyValue)); foreach (CommonClassLibrary.CommonDataSet.TextContentRow item222 in collection222) { this.Detail_TextBox.Text = item222.Thai; this.DetailEN_TextBox.Text = item222.English; } } getImage(); } }
public void getbeveragerepeater() { string nameEn = ""; string nameCH = ""; int Category = int.Parse(Request.QueryString["Category"]); DataTable dt = new DataTable(); dt.Columns.Add("IDProduct"); dt.Columns.Add("Name"); dt.Columns.Add("ImageURL"); dt.Columns.Add("Detail"); dt.Columns.Add("Price"); dt.Columns.Add("PromotionPrice"); dt.Columns.Add("NameEn"); CommonClassLibrary.CommonDataSet.ProductCateDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.ProductCateTableAdapter().GetDataByCategory(Category); foreach (CommonClassLibrary.CommonDataSet.ProductCateRow item in collection) { string name = ""; string imageUrl = "Image/no_image_available.jpg"; string detail = ""; string price = ""; string promotion = ""; CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProduct(item.Product); foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item2 in collection2) { if (item2.KeyName == "Name") { name = item2.KeyValue; CommonClassLibrary.CommonDataSet.TextContentDataTable collection3 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(long.Parse(item2.KeyValue)); foreach (CommonClassLibrary.CommonDataSet.TextContentRow item3 in collection3) { name = item3.Thai; nameEn = item3.English; } } else if (item2.KeyName == "Picture") { if (item2.KeyValue == "") { imageUrl = "no_image_available.jpg"; } else { imageUrl = item2.KeyValue; } } else if (item2.KeyName == "Detail") { detail = item2.KeyValue; } else if (item2.KeyName == "Price") { price = double.Parse(item2.KeyValue).ToString("#.###") + ".-"; } else if (item2.KeyName == "PromotionPrice") { if (item2.KeyValue == "-") { promotion = (item2.KeyValue); } else { promotion = double.Parse(item2.KeyValue).ToString("#.###") + ".-"; } } } dt.Rows.Add(item.Product, name, imageUrl, detail, price, promotion, nameEn); } this.BeverageRepeater.DataSource = dt; this.BeverageRepeater.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { System.Web.UI.HtmlControls.HtmlGenericControl Services = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("Li1"); Services.Attributes.Add("class", "active"); int IDProduct = int.Parse(Request.QueryString["IDProduct"]); getcategorycheckbox(); CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowName(IDProduct); foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item in collection) { Label4.Text = item.KeyValue; CommonClassLibrary.CommonDataSet.TextContentDataTable collection111 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(long.Parse(item.KeyValue)); foreach (CommonClassLibrary.CommonDataSet.TextContentRow item111 in collection111) { this.Name_TextBox.Text = item111.Thai; this.NameEN_TextBox.Text = item111.English; } } CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowDetail(IDProduct); foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item2 in collection2) { Label5.Text = item2.KeyValue; CommonClassLibrary.CommonDataSet.TextContentDataTable collection222 = new CommonClassLibrary.CommonDataSetTableAdapters.TextContentTableAdapter().GetDataById(long.Parse(item2.KeyValue)); foreach (CommonClassLibrary.CommonDataSet.TextContentRow item222 in collection222) { this.Detail_TextBox.Text = item222.Thai; this.DetailEN_TextBox.Text = item222.English; } } CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection3 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowPrice(IDProduct); foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item3 in collection3) { this.Price_TextBox.Text = item3.KeyValue; } CommonClassLibrary.CommonDataSet.ProductDetailDataTable collection4 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductDetailTableAdapter().GetDataByProductShowPromotionPrice(IDProduct); foreach (CommonClassLibrary.CommonDataSet.ProductDetailRow item4 in collection4) { if (item4.KeyValue != "-") { this.PromotionPrice_TextBox.Text = item4.KeyValue; } } CommonClassLibrary.CommonDataSet.ProductCateDataTable collection6 = new CommonClassLibrary.CommonDataSetTableAdapters.ProductCateTableAdapter().GetDataByProduct(IDProduct); foreach (CommonClassLibrary.CommonDataSet.ProductCateRow item6 in collection6) { radiobutton.SelectedValue = Request.QueryString["Category"]; //setselect } getImage(); getMenu(); } }