protected void btnUpdate_Click(object sender, EventArgs e)
    {
        Inv_Product inv_Product = new Inv_Product();

        inv_Product = Inv_ProductManager.GetInv_ProductByID(Int32.Parse(Request.QueryString["inv_ProductID"]));
        Inv_Product tempInv_Product = new Inv_Product();

        tempInv_Product.Inv_ProductID = inv_Product.Inv_ProductID;

        tempInv_Product.ProductID   = Int32.Parse(ddlProduct.SelectedValue);
        tempInv_Product.ProductCode = Int32.Parse(txtProductCode.Text);
        tempInv_Product.AvgCosting  = Decimal.Parse(txtAvgCosting.Text);
        tempInv_Product.SalePrice   = Decimal.Parse(txtSalePrice.Text);
        tempInv_Product.ExtraField2 = txtExtraField2.Text;
        tempInv_Product.ExtraField3 = txtExtraField3.Text;
        tempInv_Product.ExtraField4 = txtExtraField4.Text;
        tempInv_Product.ExtraField5 = txtExtraField5.Text;
        tempInv_Product.AddedBy     = getLogin().LoginID;
        tempInv_Product.AddedDate   = DateTime.Now;
        tempInv_Product.UpdatedBy   = getLogin().LoginID;
        tempInv_Product.UpdatedDate = DateTime.Now;
        tempInv_Product.RowStatusID = 1;
        bool result = Inv_ProductManager.UpdateInv_Product(tempInv_Product);

        Response.Redirect("AdminInv_ProductDisplay.aspx");
    }
Esempio n. 2
0
    protected void lbDelete_Click(object sender, EventArgs e)
    {
        LinkButton linkButton = new LinkButton();

        linkButton = (LinkButton)sender;
        bool result = Inv_ProductManager.DeleteInv_Product(Convert.ToInt32(linkButton.CommandArgument));

        showInv_ProductGrid();
    }
    private void showInv_ProductData()
    {
        Inv_Product inv_Product = new Inv_Product();

        inv_Product = Inv_ProductManager.GetInv_ProductByID(Int32.Parse(Request.QueryString["inv_ProductID"]));

        ddlProduct.SelectedValue   = inv_Product.ProductID.ToString();
        txtProductCode.Text        = inv_Product.ProductCode.ToString();
        txtAvgCosting.Text         = inv_Product.AvgCosting.ToString();
        txtSalePrice.Text          = inv_Product.SalePrice.ToString();
        txtExtraField2.Text        = inv_Product.ExtraField2;
        txtExtraField3.Text        = inv_Product.ExtraField3;
        txtExtraField4.Text        = inv_Product.ExtraField4;
        txtExtraField5.Text        = inv_Product.ExtraField5;
        txtAddedBy.Text            = inv_Product.AddedBy.ToString();
        txtUpdatedBy.Text          = inv_Product.UpdatedBy.ToString();
        txtUpdatedDate.Text        = inv_Product.UpdatedDate;
        ddlRowStatus.SelectedValue = inv_Product.RowStatusID.ToString();
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        Inv_Product inv_Product = new Inv_Product();

        inv_Product.ProductID   = Int32.Parse(ddlProduct.SelectedValue);
        inv_Product.ProductCode = Int32.Parse(txtProductCode.Text);
        inv_Product.AvgCosting  = Decimal.Parse(txtAvgCosting.Text);
        inv_Product.SalePrice   = Decimal.Parse(txtSalePrice.Text);
        inv_Product.ExtraField2 = txtExtraField2.Text;
        inv_Product.ExtraField3 = txtExtraField3.Text;
        inv_Product.ExtraField4 = txtExtraField4.Text;
        inv_Product.ExtraField5 = txtExtraField5.Text;
        inv_Product.AddedBy     = getLogin().LoginID;
        inv_Product.AddedDate   = DateTime.Now;
        inv_Product.UpdatedBy   = getLogin().LoginID;
        inv_Product.UpdatedDate = DateTime.Now;
        inv_Product.RowStatusID = 1;
        int resutl = Inv_ProductManager.InsertInv_Product(inv_Product);

        Response.Redirect("AdminInv_ProductDisplay.aspx");
    }
Esempio n. 5
0
 private void showInv_ProductGrid()
 {
     gvInv_Product.DataSource = Inv_ProductManager.GetAllInv_Products();
     gvInv_Product.DataBind();
 }