public int milkproductdata(MMilkProductsTestBeforePackingQC receive) { int result = 0; try { DBParameterCollection paramcollection = new DBParameterCollection(); paramcollection.Add(new DBParameter("@MilkProductsTestBeforePackingQCId", receive.MilkProductsTestBeforePackingQCId)); paramcollection.Add(new DBParameter("@RMRId", receive.RMRId)); paramcollection.Add(new DBParameter("@MilkProductsTestBeforePackingQCDate", receive.MilkProductsTestBeforePackingQCDate)); paramcollection.Add(new DBParameter("@MilkProductsTestBeforePackingQCShiftId", receive.MilkProductsTestBeforePackingQCShiftId)); paramcollection.Add(new DBParameter("@Particular", receive.Particular)); paramcollection.Add(new DBParameter("@Quantity", receive.Quantity)); paramcollection.Add(new DBParameter("@TestName", receive.TestName)); paramcollection.Add(new DBParameter("@Result", receive.Result)); paramcollection.Add(new DBParameter("@Remarks", receive.Remarks)); paramcollection.Add(new DBParameter("@MilkProdTestBeforePackingQCStatusId", receive.MilkProdTestBeforePackingQCStatusId)); paramcollection.Add(new DBParameter("@flag", receive.flag)); result = _DBHelper.ExecuteNonQuery("sp_Prod_MilkProductsTestBeforePackingQCDetails ", paramcollection, CommandType.StoredProcedure); } catch (Exception EX) { String MSG = EX.ToString(); } return(result); }
protected void btnAdd_Click(object sender, EventArgs e) { { mmptbpqc = new MMilkProductsTestBeforePackingQC(); bmptbpqc = new BMilkProductsTestBeforePackingQC(); int Result = 0; mmptbpqc.MilkProductsTestBeforePackingQCId = 0; mmptbpqc.RMRId = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value); mmptbpqc.MilkProductsTestBeforePackingQCDate = Convert.ToDateTime(txtDate.Text.ToString()); mmptbpqc.MilkProductsTestBeforePackingQCShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value); mmptbpqc.Particular = string.IsNullOrEmpty(txtparticular.Text) ? string.Empty : txtparticular.Text; mmptbpqc.Quantity = string.IsNullOrEmpty(txtQuantity.Text) ? 0 : Convert.ToDouble(txtQuantity.Text); mmptbpqc.TestName = string.IsNullOrEmpty(txtTestName.Text) ? string.Empty : txtTestName.Text; mmptbpqc.Result = string.IsNullOrEmpty(txtResult.Text) ? string.Empty : txtResult.Text; mmptbpqc.Remarks = string.IsNullOrEmpty(txtRemarks.Text) ? string.Empty : txtRemarks.Text; mmptbpqc.MilkProdTestBeforePackingQCStatusId = Convert.ToInt32(dpQCStatusId.SelectedItem.Value); mmptbpqc.flag = "Insert"; Result = bmptbpqc.milkproductdata(mmptbpqc); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; ScriptManager.RegisterStartupScript(this, this.GetType(), "sel3", "$('#bx1').addClass('collapsed-box');", true); //string dates; //dates = string.IsNullOrEmpty(txtSearchDate.Text) ? string.Empty : Convert.ToDateTime(txtSearchDate.Text).ToString("dd-MM-yyyy"); //GetMilkProductsTestBeforePackingQCDetails(dates); RMRecieve R = new RMRecieve(); R.RMRDate = Convert.ToDateTime(txtSearchDate.Text); GetMilkProductsTestBeforePackingQCDetails(R); uprouteList.Update(); lblSuccess.Text = "Milk Packing QC Data Added Successfully"; pnlError.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblSuccess.Text = "Something went wrong plz contact site admin"; pnlError.Update(); } //return Result; } }
public int milkproductdata(MMilkProductsTestBeforePackingQC receive) { damptbpqc = new DAMilkProductsTestBeforePackingQC(); int Result = 0; try { Result = damptbpqc.milkproductdata(receive); } catch (Exception) { throw; } return(Result); }