public int openingstockdata(MOpeningStockForMilkAndAllProducts receive) { int result = 0; try { DBParameterCollection paramcollection = new DBParameterCollection(); paramcollection.Add(new DBParameter("@RMRId", receive.RMRId)); paramcollection.Add(new DBParameter("@OpeningStockForMilkAndAllProductsId", receive.OpeningStockForMilkAndAllProductsId)); paramcollection.Add(new DBParameter("@OpeningStockForMilkAndAllProductsDate", receive.OpeningStockForMilkAndAllProductsDate)); paramcollection.Add(new DBParameter("@OpeningStockForMilkAndAllProductsShiftId", receive.OpeningStockForMilkAndAllProductsShiftId)); paramcollection.Add(new DBParameter("@SiloNoForMilk", receive.SiloNoForMilk)); paramcollection.Add(new DBParameter("@MilkType", receive.MilkType)); paramcollection.Add(new DBParameter("@Quantity", receive.Quantity)); paramcollection.Add(new DBParameter("@FAT", receive.FAT)); paramcollection.Add(new DBParameter("@SNF", receive.SNF)); paramcollection.Add(new DBParameter("@CLR", receive.CLR)); paramcollection.Add(new DBParameter("@Temperature", receive.Temperature)); paramcollection.Add(new DBParameter("@Acidity", receive.Acidity)); paramcollection.Add(new DBParameter("@MBRT", receive.MBRT)); paramcollection.Add(new DBParameter("@HomoEfficiency", receive.HomoEfficiency)); paramcollection.Add(new DBParameter("@Remarks", receive.Remarks)); paramcollection.Add(new DBParameter("@OpeningStockForMilkAndAllProductsStatus", receive.OpeningStockForMilkAndAllProductsStatus)); paramcollection.Add(new DBParameter("@flag", receive.flag)); result = _DBHelper.ExecuteNonQuery("prod_spOpeningStockForMilkAndAllProductsDetails ", paramcollection, CommandType.StoredProcedure); } catch (Exception EX) { String MSG = EX.ToString(); } return(result); }
public int openingstockdata(MOpeningStockForMilkAndAllProducts receive) { daosfmaap = new DAOpeningStockForMilkAndAllProducts(); int Result = 0; try { Result = daosfmaap.openingstockdata(receive); } catch (Exception) { throw; } return(Result); }
protected void btnUpdate_Click(object sender, EventArgs e) { { mosfmaap = new MOpeningStockForMilkAndAllProducts(); bosfmaap = new BOpeningStockForMilkAndAllProducts(); int Result = 0; mosfmaap.OpeningStockForMilkAndAllProductsId = 0; mosfmaap.RMRId = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value); mosfmaap.OpeningStockForMilkAndAllProductsDate = Convert.ToDateTime(txtDate.Text.ToString()); mosfmaap.OpeningStockForMilkAndAllProductsShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value); mosfmaap.SiloNoForMilk = string.IsNullOrEmpty(txtSiloNoForMilk.Text) ? 0 : Convert.ToInt32(txtSiloNoForMilk.Text); mosfmaap.MilkType = txtMilkType.Text; mosfmaap.Quantity = string.IsNullOrEmpty(txtQuantity.Text) ? 0 : Convert.ToDouble(txtQuantity.Text); mosfmaap.FAT = string.IsNullOrEmpty(txtFAT.Text) ? 0 : Convert.ToDouble(txtFAT.Text); mosfmaap.SNF = string.IsNullOrEmpty(txtSNF.Text) ? 0 : Convert.ToDouble(txtSNF.Text); mosfmaap.CLR = string.IsNullOrEmpty(txtCLR.Text) ? 0 : Convert.ToDouble(txtCLR.Text); mosfmaap.Temperature = string.IsNullOrEmpty(txtTemperature.Text) ? 0 : Convert.ToDouble(txtTemperature.Text); mosfmaap.Acidity = string.IsNullOrEmpty(txtAcidity.Text) ? 0 : Convert.ToDouble(txtAcidity.Text); mosfmaap.MBRT = string.IsNullOrEmpty(txtMBRT.Text) ? 0 : Convert.ToDouble(txtMBRT.Text); mosfmaap.HomoEfficiency = string.IsNullOrEmpty(txtHomoEfficiency.Text) ? 0 : Convert.ToDouble(txtHomoEfficiency.Text); mosfmaap.Remarks = txtRemarks.Text; mosfmaap.OpeningStockForMilkAndAllProductsStatus = Convert.ToInt32(dpStatusDetails.SelectedItem.Value); mosfmaap.flag = "Update"; Result = bosfmaap.openingstockdata(mosfmaap); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Opening Stock For Milk And All Products Data Update Successfully"; pnlError.Update(); // GetPastDetails(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblSuccess.Text = "Something went wrong plz contact site admin"; pnlError.Update(); } //return Result; } }