protected void lbDelete_Click(object sender, EventArgs e) { LinkButton linkButton = new LinkButton(); linkButton = (LinkButton)sender; bool result = Pos_ProductCostManager.DeletePos_ProductCost(Convert.ToInt32(linkButton.CommandArgument)); showPos_ProductCostGrid(); }
private void showPos_ProductCostData() { Pos_ProductCost pos_ProductCost = new Pos_ProductCost(); pos_ProductCost = Pos_ProductCostManager.GetPos_ProductCostByID(Int32.Parse(Request.QueryString["pos_ProductCostID"])); ddlPos_CostType.SelectedValue = pos_ProductCost.Pos_CostTypeID.ToString(); ddlProduct.SelectedValue = pos_ProductCost.ProductID.ToString(); txtAmount.Text = pos_ProductCost.Amount.ToString(); txtExtraField1.Text = pos_ProductCost.ExtraField1; txtExtraField2.Text = pos_ProductCost.ExtraField2; txtExtraField3.Text = pos_ProductCost.ExtraField3; }
protected void btnAdd_Click(object sender, EventArgs e) { Pos_ProductCost pos_ProductCost = new Pos_ProductCost(); pos_ProductCost.Pos_CostTypeID = Int32.Parse(ddlPos_CostType.SelectedValue); pos_ProductCost.ProductID = Int32.Parse(ddlProduct.SelectedValue); pos_ProductCost.Amount = Decimal.Parse(txtAmount.Text); pos_ProductCost.ExtraField1 = txtExtraField1.Text; pos_ProductCost.ExtraField2 = txtExtraField2.Text; pos_ProductCost.ExtraField3 = txtExtraField3.Text; int resutl = Pos_ProductCostManager.InsertPos_ProductCost(pos_ProductCost); Response.Redirect("AdminPos_ProductCostDisplay.aspx"); }
protected void btnUpdate_Click(object sender, EventArgs e) { Pos_ProductCost pos_ProductCost = new Pos_ProductCost(); pos_ProductCost = Pos_ProductCostManager.GetPos_ProductCostByID(Int32.Parse(Request.QueryString["pos_ProductCostID"])); Pos_ProductCost tempPos_ProductCost = new Pos_ProductCost(); tempPos_ProductCost.Pos_ProductCostID = pos_ProductCost.Pos_ProductCostID; tempPos_ProductCost.Pos_CostTypeID = Int32.Parse(ddlPos_CostType.SelectedValue); tempPos_ProductCost.ProductID = Int32.Parse(ddlProduct.SelectedValue); tempPos_ProductCost.Amount = Decimal.Parse(txtAmount.Text); tempPos_ProductCost.ExtraField1 = txtExtraField1.Text; tempPos_ProductCost.ExtraField2 = txtExtraField2.Text; tempPos_ProductCost.ExtraField3 = txtExtraField3.Text; bool result = Pos_ProductCostManager.UpdatePos_ProductCost(tempPos_ProductCost); Response.Redirect("AdminPos_ProductCostDisplay.aspx"); }