protected void btnUpdate_Click(object sender, EventArgs e)
    {
        Inv_ProductDetails inv_ProductDetails = new Inv_ProductDetails();

        inv_ProductDetails = Inv_ProductDetailsManager.GetInv_ProductDetailsByID(Int32.Parse(Request.QueryString["inv_ProductDetailsID"]));
        Inv_ProductDetails tempInv_ProductDetails = new Inv_ProductDetails();

        tempInv_ProductDetails.Inv_ProductDetailsID = inv_ProductDetails.Inv_ProductDetailsID;

        tempInv_ProductDetails.ProductID        = Int32.Parse(ddlProduct.SelectedValue);
        tempInv_ProductDetails.ItemID           = Int32.Parse(ddlItem.SelectedValue);
        tempInv_ProductDetails.Costing          = Decimal.Parse(txtCosting.Text);
        tempInv_ProductDetails.QuantityProduced = Decimal.Parse(txtQuantityProduced.Text);
        tempInv_ProductDetails.QuantityUtilized = Decimal.Parse(txtQuantityUtilized.Text);
        tempInv_ProductDetails.ExtraField2      = txtExtraField2.Text;
        tempInv_ProductDetails.ExtraField3      = txtExtraField3.Text;
        tempInv_ProductDetails.ExtraField4      = txtExtraField4.Text;
        tempInv_ProductDetails.ExtraField5      = txtExtraField5.Text;
        tempInv_ProductDetails.AddedBy          = getLogin().LoginID;
        tempInv_ProductDetails.AddedDate        = DateTime.Now;
        tempInv_ProductDetails.UpdatedBy        = getLogin().LoginID;
        tempInv_ProductDetails.UpdatedDate      = DateTime.Now;
        tempInv_ProductDetails.RowStatusID      = 1;
        bool result = Inv_ProductDetailsManager.UpdateInv_ProductDetails(tempInv_ProductDetails);

        Response.Redirect("AdminInv_ProductDetailsDisplay.aspx");
    }
 public Inv_ProductDetails GetInv_ProductDetailsFromReader(IDataReader reader)
 {
     try
     {
         Inv_ProductDetails inv_ProductDetails = new Inv_ProductDetails
                                                 (
             (int)reader["Inv_ProductDetailsID"],
             (int)reader["ProductID"],
             (int)reader["ItemID"],
             (decimal)reader["Costing"],
             (decimal)reader["QuantityProduced"],
             (decimal)reader["QuantityUtilized"],
             reader["ExtraField2"].ToString(),
             reader["ExtraField3"].ToString(),
             reader["ExtraField4"].ToString(),
             reader["ExtraField5"].ToString(),
             (int)reader["AddedBy"],
             (DateTime)reader["AddedDate"],
             (int)reader["UpdatedBy"],
             (DateTime)reader["UpdatedDate"],
             (int)reader["RowStatusID"]
                                                 );
         return(inv_ProductDetails);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
    public bool UpdateInv_ProductDetails(Inv_ProductDetails inv_ProductDetails)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("GP_UpdateInv_ProductDetails", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@Inv_ProductDetailsID", SqlDbType.Int).Value = inv_ProductDetails.Inv_ProductDetailsID;
            cmd.Parameters.Add("@ProductID", SqlDbType.Int).Value            = inv_ProductDetails.ProductID;
            cmd.Parameters.Add("@ItemID", SqlDbType.Int).Value               = inv_ProductDetails.ItemID;
            cmd.Parameters.Add("@Costing", SqlDbType.Decimal).Value          = inv_ProductDetails.Costing;
            cmd.Parameters.Add("@QuantityProduced", SqlDbType.Decimal).Value = inv_ProductDetails.QuantityProduced;
            cmd.Parameters.Add("@QuantityUtilized", SqlDbType.Decimal).Value = inv_ProductDetails.QuantityUtilized;
            cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value     = inv_ProductDetails.ExtraField2;
            cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value     = inv_ProductDetails.ExtraField3;
            cmd.Parameters.Add("@ExtraField4", SqlDbType.NVarChar).Value     = inv_ProductDetails.ExtraField4;
            cmd.Parameters.Add("@ExtraField5", SqlDbType.NVarChar).Value     = inv_ProductDetails.ExtraField5;
            cmd.Parameters.Add("@AddedBy", SqlDbType.Int).Value              = inv_ProductDetails.AddedBy;
            cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value       = inv_ProductDetails.AddedDate;
            cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value            = inv_ProductDetails.UpdatedBy;
            cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value     = inv_ProductDetails.UpdatedDate;
            cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value          = inv_ProductDetails.RowStatusID;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return(result == 1);
        }
    }
Beispiel #4
0
    public static Inv_ProductDetails GetInv_ProductDetailsByID(int id)
    {
        Inv_ProductDetails            inv_ProductDetails            = new Inv_ProductDetails();
        SqlInv_ProductDetailsProvider sqlInv_ProductDetailsProvider = new SqlInv_ProductDetailsProvider();

        inv_ProductDetails = sqlInv_ProductDetailsProvider.GetInv_ProductDetailsByID(id);
        return(inv_ProductDetails);
    }
    private void showInv_ProductDetailsData()
    {
        Inv_ProductDetails inv_ProductDetails = new Inv_ProductDetails();

        inv_ProductDetails = Inv_ProductDetailsManager.GetInv_ProductDetailsByID(Int32.Parse(Request.QueryString["inv_ProductDetailsID"]));

        ddlProduct.SelectedValue   = inv_ProductDetails.ProductID.ToString();
        ddlItem.SelectedValue      = inv_ProductDetails.ItemID.ToString();
        txtCosting.Text            = inv_ProductDetails.Costing.ToString();
        txtQuantityProduced.Text   = inv_ProductDetails.QuantityProduced.ToString();
        txtQuantityUtilized.Text   = inv_ProductDetails.QuantityUtilized.ToString();
        txtExtraField2.Text        = inv_ProductDetails.ExtraField2;
        txtExtraField3.Text        = inv_ProductDetails.ExtraField3;
        txtExtraField4.Text        = inv_ProductDetails.ExtraField4;
        txtExtraField5.Text        = inv_ProductDetails.ExtraField5;
        txtAddedBy.Text            = inv_ProductDetails.AddedBy.ToString();
        txtUpdatedBy.Text          = inv_ProductDetails.UpdatedBy.ToString();
        txtUpdatedDate.Text        = inv_ProductDetails.UpdatedDate;
        ddlRowStatus.SelectedValue = inv_ProductDetails.RowStatusID.ToString();
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        Inv_ProductDetails inv_ProductDetails = new Inv_ProductDetails();

        inv_ProductDetails.ProductID = Int32.Parse(ddlProduct.SelectedValue);
        inv_ProductDetails.ItemID = Int32.Parse(ddlItem.SelectedValue);
        inv_ProductDetails.Costing = Decimal.Parse(txtCosting.Text);
        inv_ProductDetails.QuantityProduced = Decimal.Parse(txtQuantityProduced.Text);
        inv_ProductDetails.QuantityUtilized = Decimal.Parse(txtQuantityUtilized.Text);
        inv_ProductDetails.ExtraField2 = txtExtraField2.Text;
        inv_ProductDetails.ExtraField3 = txtExtraField3.Text;
        inv_ProductDetails.ExtraField4 = txtExtraField4.Text;
        inv_ProductDetails.ExtraField5 = txtExtraField5.Text;
        inv_ProductDetails.AddedBy =getLogin().LoginID;
        inv_ProductDetails.AddedDate = DateTime.Now;
        inv_ProductDetails.UpdatedBy = getLogin().LoginID;
        inv_ProductDetails.UpdatedDate = DateTime.Now;
        inv_ProductDetails.RowStatusID = 1;
        int resutl = Inv_ProductDetailsManager.InsertInv_ProductDetails(inv_ProductDetails);
        Response.Redirect("AdminInv_ProductDetailsDisplay.aspx");
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        Inv_ProductDetails inv_ProductDetails = new Inv_ProductDetails();

        inv_ProductDetails.ProductID        = Int32.Parse(ddlProduct.SelectedValue);
        inv_ProductDetails.ItemID           = Int32.Parse(ddlItem.SelectedValue);
        inv_ProductDetails.Costing          = Decimal.Parse(txtCosting.Text);
        inv_ProductDetails.QuantityProduced = Decimal.Parse(txtQuantityProduced.Text);
        inv_ProductDetails.QuantityUtilized = Decimal.Parse(txtQuantityUtilized.Text);
        inv_ProductDetails.ExtraField2      = txtExtraField2.Text;
        inv_ProductDetails.ExtraField3      = txtExtraField3.Text;
        inv_ProductDetails.ExtraField4      = txtExtraField4.Text;
        inv_ProductDetails.ExtraField5      = txtExtraField5.Text;
        inv_ProductDetails.AddedBy          = getLogin().LoginID;
        inv_ProductDetails.AddedDate        = DateTime.Now;
        inv_ProductDetails.UpdatedBy        = getLogin().LoginID;
        inv_ProductDetails.UpdatedDate      = DateTime.Now;
        inv_ProductDetails.RowStatusID      = 1;
        int resutl = Inv_ProductDetailsManager.InsertInv_ProductDetails(inv_ProductDetails);

        Response.Redirect("AdminInv_ProductDetailsDisplay.aspx");
    }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        Inv_ProductDetails inv_ProductDetails = new Inv_ProductDetails();
        inv_ProductDetails = Inv_ProductDetailsManager.GetInv_ProductDetailsByID(Int32.Parse(Request.QueryString["inv_ProductDetailsID"]));
        Inv_ProductDetails tempInv_ProductDetails = new Inv_ProductDetails();
        tempInv_ProductDetails.Inv_ProductDetailsID = inv_ProductDetails.Inv_ProductDetailsID;

        tempInv_ProductDetails.ProductID = Int32.Parse(ddlProduct.SelectedValue);
        tempInv_ProductDetails.ItemID = Int32.Parse(ddlItem.SelectedValue);
        tempInv_ProductDetails.Costing = Decimal.Parse(txtCosting.Text);
        tempInv_ProductDetails.QuantityProduced = Decimal.Parse(txtQuantityProduced.Text);
        tempInv_ProductDetails.QuantityUtilized = Decimal.Parse(txtQuantityUtilized.Text);
        tempInv_ProductDetails.ExtraField2 = txtExtraField2.Text;
        tempInv_ProductDetails.ExtraField3 = txtExtraField3.Text;
        tempInv_ProductDetails.ExtraField4 = txtExtraField4.Text;
        tempInv_ProductDetails.ExtraField5 = txtExtraField5.Text;
        tempInv_ProductDetails.AddedBy =getLogin().LoginID;
        tempInv_ProductDetails.AddedDate = DateTime.Now;
        tempInv_ProductDetails.UpdatedBy = getLogin().LoginID;
        tempInv_ProductDetails.UpdatedDate = DateTime.Now;
        tempInv_ProductDetails.RowStatusID = 1;
        bool result = Inv_ProductDetailsManager.UpdateInv_ProductDetails(tempInv_ProductDetails);
        Response.Redirect("AdminInv_ProductDetailsDisplay.aspx");
    }
Beispiel #9
0
    public static bool UpdateInv_ProductDetails(Inv_ProductDetails inv_ProductDetails)
    {
        SqlInv_ProductDetailsProvider sqlInv_ProductDetailsProvider = new SqlInv_ProductDetailsProvider();

        return(sqlInv_ProductDetailsProvider.UpdateInv_ProductDetails(inv_ProductDetails));
    }
Beispiel #10
0
    public static int InsertInv_ProductDetails(Inv_ProductDetails inv_ProductDetails)
    {
        SqlInv_ProductDetailsProvider sqlInv_ProductDetailsProvider = new SqlInv_ProductDetailsProvider();

        return(sqlInv_ProductDetailsProvider.InsertInv_ProductDetails(inv_ProductDetails));
    }
 public Inv_ProductDetails GetInv_ProductDetailsFromReader(IDataReader reader)
 {
     try
     {
         Inv_ProductDetails inv_ProductDetails = new Inv_ProductDetails
             (
                 (int)reader["Inv_ProductDetailsID"],
                 (int)reader["ProductID"],
                 (int)reader["ItemID"],
                 (decimal)reader["Costing"],
                 (decimal)reader["QuantityProduced"],
                 (decimal)reader["QuantityUtilized"],
                 reader["ExtraField2"].ToString(),
                 reader["ExtraField3"].ToString(),
                 reader["ExtraField4"].ToString(),
                 reader["ExtraField5"].ToString(),
                 (int)reader["AddedBy"],
                 (DateTime)reader["AddedDate"],
                 (int)reader["UpdatedBy"],
                 (DateTime)reader["UpdatedDate"],
                 (int)reader["RowStatusID"]
             );
          return inv_ProductDetails;
     }
     catch(Exception ex)
     {
         return null;
     }
 }
    public bool UpdateInv_ProductDetails(Inv_ProductDetails inv_ProductDetails)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("GP_UpdateInv_ProductDetails", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@Inv_ProductDetailsID", SqlDbType.Int).Value = inv_ProductDetails.Inv_ProductDetailsID;
            cmd.Parameters.Add("@ProductID", SqlDbType.Int).Value = inv_ProductDetails.ProductID;
            cmd.Parameters.Add("@ItemID", SqlDbType.Int).Value = inv_ProductDetails.ItemID;
            cmd.Parameters.Add("@Costing", SqlDbType.Decimal).Value = inv_ProductDetails.Costing;
            cmd.Parameters.Add("@QuantityProduced", SqlDbType.Decimal).Value = inv_ProductDetails.QuantityProduced;
            cmd.Parameters.Add("@QuantityUtilized", SqlDbType.Decimal).Value = inv_ProductDetails.QuantityUtilized;
            cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = inv_ProductDetails.ExtraField2;
            cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = inv_ProductDetails.ExtraField3;
            cmd.Parameters.Add("@ExtraField4", SqlDbType.NVarChar).Value = inv_ProductDetails.ExtraField4;
            cmd.Parameters.Add("@ExtraField5", SqlDbType.NVarChar).Value = inv_ProductDetails.ExtraField5;
            cmd.Parameters.Add("@AddedBy", SqlDbType.Int).Value = inv_ProductDetails.AddedBy;
            cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = inv_ProductDetails.AddedDate;
            cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value = inv_ProductDetails.UpdatedBy;
            cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = inv_ProductDetails.UpdatedDate;
            cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = inv_ProductDetails.RowStatusID;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return result == 1;
        }
    }
    private void showInv_ProductDetailsData()
    {
        Inv_ProductDetails inv_ProductDetails = new Inv_ProductDetails();
        inv_ProductDetails = Inv_ProductDetailsManager.GetInv_ProductDetailsByID(Int32.Parse(Request.QueryString["inv_ProductDetailsID"]));

        ddlProduct.SelectedValue = inv_ProductDetails.ProductID.ToString();
        ddlItem.SelectedValue = inv_ProductDetails.ItemID.ToString();
        txtCosting.Text = inv_ProductDetails.Costing.ToString();
        txtQuantityProduced.Text = inv_ProductDetails.QuantityProduced.ToString();
        txtQuantityUtilized.Text = inv_ProductDetails.QuantityUtilized.ToString();
        txtExtraField2.Text = inv_ProductDetails.ExtraField2;
        txtExtraField3.Text = inv_ProductDetails.ExtraField3;
        txtExtraField4.Text = inv_ProductDetails.ExtraField4;
        txtExtraField5.Text = inv_ProductDetails.ExtraField5;
        txtAddedBy.Text = inv_ProductDetails.AddedBy.ToString();
        txtUpdatedBy.Text = inv_ProductDetails.UpdatedBy.ToString();
        txtUpdatedDate.Text = inv_ProductDetails.UpdatedDate;
        ddlRowStatus.SelectedValue = inv_ProductDetails.RowStatusID.ToString();
    }