protected void lbDelete_Click(object sender, EventArgs e) { LinkButton linkButton = new LinkButton(); linkButton = (LinkButton)sender; bool result = Pos_SizeManager.DeletePos_Size(Convert.ToInt32(linkButton.CommandArgument)); showPos_SizeGrid(); }
private void showPos_SizeData() { Pos_Size pos_Size = new Pos_Size(); pos_Size = Pos_SizeManager.GetPos_SizeByID(Int32.Parse(Request.QueryString["pos_SizeID"])); txtSizeName.Text = pos_Size.SizeName; txtCode.Text = pos_Size.Code; }
protected void btnAdd_Click(object sender, EventArgs e) { Pos_Size pos_Size = new Pos_Size(); pos_Size.SizeName = txtSizeName.Text; pos_Size.Code = txtCode.Text; int resutl = Pos_SizeManager.InsertPos_Size(pos_Size); Response.Redirect("AdminPos_SizeDisplay.aspx"); }
private void loadPos_Size() { ListItem li = new ListItem("Select size...", "0"); //ddlPos_Size.Items.Add(li); List <Pos_Size> pos_Sizes = new List <Pos_Size>(); pos_Sizes = Pos_SizeManager.GetAllPos_Sizes(); foreach (Pos_Size pos_Size in pos_Sizes) { ListItem item = new ListItem(pos_Size.SizeName.ToString(), pos_Size.Pos_SizeID.ToString()); ddlPos_Size.Items.Add(item); } }
protected void btnUpdate_Click(object sender, EventArgs e) { Pos_Size pos_Size = new Pos_Size(); pos_Size = Pos_SizeManager.GetPos_SizeByID(Int32.Parse(Request.QueryString["pos_SizeID"])); Pos_Size tempPos_Size = new Pos_Size(); tempPos_Size.Pos_SizeID = pos_Size.Pos_SizeID; tempPos_Size.SizeName = txtSizeName.Text; tempPos_Size.Code = txtCode.Text; bool result = Pos_SizeManager.UpdatePos_Size(tempPos_Size); Response.Redirect("AdminPos_SizeDisplay.aspx"); }
private void showPos_SizeGrid() { gvPos_Size.DataSource = Pos_SizeManager.GetAllPos_Sizes(); gvPos_Size.DataBind(); }