// public int packeddata(MMilkPackedData receive) { int result = 0; try { DBParameterCollection paramcollection = new DBParameterCollection(); paramcollection.Add(new DBParameter("@PackedDataId", receive.PackedDataId)); paramcollection.Add(new DBParameter("@RMRId", receive.RMRId)); paramcollection.Add(new DBParameter("@ShiftId", receive.ShiftId)); paramcollection.Add(new DBParameter("@PackedDate", receive.PackedDate)); paramcollection.Add(new DBParameter("@PackingOperatorName", receive.PackingOperatorName)); paramcollection.Add(new DBParameter("@ReceivedBy", receive.ReceivedBy)); paramcollection.Add(new DBParameter("@TypeOfMilk", receive.TypeOfMilk)); paramcollection.Add(new DBParameter("@QuantityIn1000ML", receive.QuantityIn1000ML)); paramcollection.Add(new DBParameter("@QuantityIn500ML", receive.QuantityIn500ML)); paramcollection.Add(new DBParameter("@QuantityIn450ML", receive.QuantityIn450ML)); paramcollection.Add(new DBParameter("@QuantityIn250ML", receive.QuantityIn250ML)); paramcollection.Add(new DBParameter("@QuantityIn200ML", receive.QuantityIn200ML)); paramcollection.Add(new DBParameter("@Curd500ml", receive.Curd500MLQty)); paramcollection.Add(new DBParameter("@Curd450ml", receive.Curd450MLQty)); paramcollection.Add(new DBParameter("@ButterMilk200ml", receive.ButterMilk200ML)); paramcollection.Add(new DBParameter("@TotalQtyOfMilk", receive.TotalQtyOfMilk)); paramcollection.Add(new DBParameter("@ColdRoomNo", receive.ColdRoomNo)); paramcollection.Add(new DBParameter("@PackingDetailStatusId", receive.PackingDetailStatusId)); paramcollection.Add(new DBParameter("@flag", receive.flag)); result = _DBHelper.ExecuteNonQuery("sp_Prod_MilkPackedDataDetails", paramcollection, CommandType.StoredProcedure); } catch (Exception EX) { string MSG = EX.ToString(); } return(result); }
protected void btnAdd_Click1(object sender, EventArgs e) { { mpacked = new MMilkPackedData(); bpacked = new BMilkPackedData(); int Result = 0; mpacked.PackedDataId = 0; mpacked.RMRId = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value); mpacked.PackedDate = Convert.ToDateTime(txtDate.Text.ToString()); mpacked.ShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value); mpacked.PackingOperatorName = string.IsNullOrEmpty(txtPackingOperatorName.Text) ? string.Empty : txtPackingOperatorName.Text; mpacked.ReceivedBy = string.IsNullOrEmpty(txtReceivedBy.Text) ? string.Empty : txtReceivedBy.Text; mpacked.TypeOfMilk = string.IsNullOrEmpty(txtTypeOfMilk.Text) ? string.Empty : txtTypeOfMilk.Text; mpacked.QuantityIn1000ML = string.IsNullOrEmpty(txtQuantityIn1000.Text) ? 0 : Convert.ToDouble(txtQuantityIn1000.Text); mpacked.QuantityIn500ML = string.IsNullOrEmpty(txtQuantityIn500.Text) ? 0 : Convert.ToDouble(txtQuantityIn500.Text); mpacked.QuantityIn450ML = string.IsNullOrEmpty(txtQuantityIn450.Text) ? 0 : Convert.ToDouble(txtQuantityIn450.Text); mpacked.QuantityIn250ML = string.IsNullOrEmpty(txtQuantityIn250.Text) ? 0 : Convert.ToDouble(txtQuantityIn250.Text); mpacked.QuantityIn200ML = string.IsNullOrEmpty(txtQuantityIn200.Text) ? 0 : Convert.ToDouble(txtQuantityIn200.Text); mpacked.Curd500MLQty = string.IsNullOrEmpty(txtcurd500.Text) ? 0 : Convert.ToDouble(txtcurd500.Text); mpacked.Curd450MLQty = string.IsNullOrEmpty(txtcurd450.Text) ? 0 : Convert.ToDouble(txtcurd450.Text); mpacked.ButterMilk200ML = string.IsNullOrEmpty(txtbuttermilk200.Text) ? 0 : Convert.ToDouble(txtbuttermilk200.Text); mpacked.TotalQtyOfMilk = string.IsNullOrEmpty(txtTotalOfMilk.Text) ? 0 : Convert.ToDouble(txtTotalOfMilk.Text); mpacked.ColdRoomNo = string.IsNullOrEmpty(txtColdRoomNo.Text) ? string.Empty : txtColdRoomNo.Text; mpacked.PackingDetailStatusId = Convert.ToInt32(dpPackingDetailStatus.SelectedItem.Value); mpacked.flag = "Insert"; Result = bpacked.packeddata(mpacked); 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"); //GetCreamDetails(dates); RMRecieve R = new RMRecieve(); R.RMRDate = Convert.ToDateTime(txtSearchDate.Text); GetCreamDetails(R); uprouteList.Update(); lblSuccess.Text = "Packed Data Add 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 packeddata(MMilkPackedData receive) { dapackeddata = new DAMilkPackedData(); int Result = 0; try { Result = dapackeddata.packeddata(receive); } catch (Exception) { throw; } return(Result); }