private void btnSave_Click(object sender, EventArgs e) { if (chkMaterial.Checked == true) { BatchFormulaMaterial obj = new BatchFormulaMaterial(); obj.AddedBy = CurrentUser.EmployeeID; obj.BatchID = objBatch.BatchID; obj.MaterialCode = cmbMaterial.SelectedValue.ToString(); obj.Part = txtPart.Text; obj.Qty = Convert.ToDecimal(txtNewQty.Text); obj.Remarks = txtRemarks.Text; objBatchFormulaMaterial_DL.Update(obj); Load_FormulaMaterial(); } if (chkSemiFinished.Checked == true) { BatchFormulaBasicProducts obj = new BatchFormulaBasicProducts(); obj.AddedBy = CurrentUser.EmployeeID; obj.BatchID = objBatch.BatchID; obj.BasicProductCode = cmbSemiFinished.SelectedValue.ToString(); obj.Part = txtPart.Text; obj.Qty = Convert.ToDecimal(txtNewQty.Text); obj.Remarks = txtRemarks.Text; objBatchFormulaBasicProducts_DL.Update(obj); Load_FormulaSemi(); } }
public int Update(BatchFormulaMaterial obj) { try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@MaterialCode", obj.MaterialCode), new SqlParameter("@Qty", obj.Qty), new SqlParameter("@BatchID", obj.BatchID), new SqlParameter("@Part", obj.Part), new SqlParameter("@AddedBy", obj.AddedBy), new SqlParameter("@Remarks", obj.Remarks) }; return(Execute.RunSP_Int(Connection, "SPUPDATE_BatchFormulaMaterial", paramList)); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }