protected void btnAddMaterialAmount_Click(object sender, EventArgs e) { PackageMaterialAmount materialAmount = new PackageMaterialAmount(); materialAmount.Amount = Convert.ToDecimal(txtAmount.Text); string lenght = txtLength.Text; string width = txtWidth.Text; if (!String.IsNullOrEmpty(lenght)) { materialAmount.Length = Convert.ToDecimal(lenght); } if (!String.IsNullOrEmpty(width)) { materialAmount.Width = Convert.ToDecimal(width); } materialAmount.PackageID = packageID; materialAmount.PartID = Convert.ToInt64(hidPartID.Value); materialAmount.MaterialID = Convert.ToInt64(hidMaterialID.Value); materialAmount.Add(); Response.Redirect(Request.RawUrl); }
protected void btnEditMatrialAmount_Click(object sender, EventArgs e) { long partID = Convert.ToInt64(hidPartID.Value); long materialID = Convert.ToInt64(hidMaterialID.Value); decimal length = Convert.ToDecimal(hidLength.Value); decimal width = Convert.ToDecimal(hidWidth.Value); PackageMaterialAmount materialAmount = new PackageMaterialAmount(packageID, partID, materialID, length, width); materialAmount.Amount = Convert.ToDecimal(txtEditAmount.Text); materialAmount.Save(); Response.Redirect(Request.RawUrl); }