protected void btnAdd_Click(object sender, EventArgs e) { { mpast = new MPastProcess(); bpast = new BPastProcess(); int Result = 0; mpast.pastProcessId = 0; mpast.RMRId = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value); foreach (RepeaterItem item in rpPastProcessList.Items) { HiddenField hdfID = item.FindControl("hfStdId") as HiddenField; if (hdfID != null) { mpast.StdId = string.IsNullOrEmpty(hdfID.Value) ? 0 : Convert.ToInt32(hdfID.Value); } } mpast.PastProcessDate = Convert.ToDateTime(txtDate.Text).ToString("dd-MM-yyyy"); mpast.PastShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value); mpast.IBTTemperature = string.IsNullOrEmpty(txtIBTTemperature.Text) ? 0 : Convert.ToDouble(txtIBTTemperature.Text); mpast.PastStartTime = string.IsNullOrEmpty(txtPasteurizationstarttime.Text) ? string.Empty : txtPasteurizationstarttime.Text; mpast.PastTempHeat1 = string.IsNullOrEmpty(txtHeatFirst.Text) ? 0 : Convert.ToDouble(txtHeatFirst.Text); mpast.Cool1 = string.IsNullOrEmpty(txtCool1.Text) ? 0 : Convert.ToDouble(txtCool1.Text); mpast.PastTempHeat2 = string.IsNullOrEmpty(txtHeatSecond.Text) ? 0 : Convert.ToDouble(txtHeatSecond.Text); mpast.Cool2 = string.IsNullOrEmpty(txtCool2.Text) ? 0 : Convert.ToDouble(txtCool2.Text); mpast.PastTempHeat3 = string.IsNullOrEmpty(txtHeatThird.Text) ? 0 : Convert.ToDouble(txtHeatThird.Text); mpast.Cool3 = string.IsNullOrEmpty(txtCool3.Text) ? 0 : Convert.ToDouble(txtCool3.Text); mpast.PastTempHeat4 = string.IsNullOrEmpty(txtHeatForth.Text) ? 0 : Convert.ToDouble(txtHeatForth.Text); mpast.Cool4 = string.IsNullOrEmpty(txtCool4.Text) ? 0 : Convert.ToDouble(txtCool4.Text); mpast.PastTempHeat5 = string.IsNullOrEmpty(txtHeatFive.Text) ? 0 : Convert.ToDouble(txtHeatFive.Text); mpast.Cool5 = string.IsNullOrEmpty(txtCool5.Text) ? 0 : Convert.ToDouble(txtCool5.Text); mpast.MilkClosingTime = string.IsNullOrEmpty(txtMilkClosingTime.Text) ? string.Empty : txtMilkClosingTime.Text; mpast.DoneBy = string.IsNullOrEmpty(txtDoneBy.Text) ? string.Empty : txtDoneBy.Text; mpast.pastProcessStatusId = Convert.ToInt32(dpPastProcessDone.SelectedItem.Value); mpast.flag = "Insert"; Result = bpast.pastdata(mpast); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "PasteurizationProcess Data Add Successfully"; ScriptManager.RegisterStartupScript(this, this.GetType(), "sel3", "$('#bx1').addClass('collapsed-box');", true); pnlError.Update(); string dates; dates = string.IsNullOrEmpty(txtSearchDate.Text) ? string.Empty: Convert.ToDateTime(txtSearchDate.Text).ToString("dd-MM-yyyy"); GetPastDetails(dates); uprouteList.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 pastdata(MPastProcess receive) { dapast = new DAPastProcess(); int Result = 0; try { Result = dapast.pastdata(receive); } catch (Exception) { throw; } return(Result); }
// public int pastdata(MPastProcess receive) { int result = 0; try { DBParameterCollection paramcollection = new DBParameterCollection(); paramcollection.Add(new DBParameter("@RMRId", receive.RMRId)); paramcollection.Add(new DBParameter("@StdId", receive.StdId)); paramcollection.Add(new DBParameter("@pastProcessId", receive.pastProcessId)); paramcollection.Add(new DBParameter("@PastProcessDate", receive.PastProcessDate)); paramcollection.Add(new DBParameter("@PastShiftId", receive.PastShiftId)); paramcollection.Add(new DBParameter("@IBTTemperature", receive.IBTTemperature)); paramcollection.Add(new DBParameter("@PastStartTime", receive.PastStartTime)); paramcollection.Add(new DBParameter("@PastTempHeat1", receive.PastTempHeat1)); paramcollection.Add(new DBParameter("@Cool1", receive.Cool1)); paramcollection.Add(new DBParameter("@PastTempHeat2", receive.PastTempHeat2)); paramcollection.Add(new DBParameter("@Cool2", receive.Cool2)); paramcollection.Add(new DBParameter("@PastTempHeat3", receive.PastTempHeat3)); paramcollection.Add(new DBParameter("@Cool3", receive.Cool3)); paramcollection.Add(new DBParameter("@PastTempHeat4", receive.PastTempHeat4)); paramcollection.Add(new DBParameter("@Cool4", receive.Cool4)); paramcollection.Add(new DBParameter("@PastTempHeat5", receive.PastTempHeat5)); paramcollection.Add(new DBParameter("@Cool5", receive.Cool5)); paramcollection.Add(new DBParameter("@MilkClosingTime", receive.MilkClosingTime)); paramcollection.Add(new DBParameter("@DoneBy", receive.DoneBy)); paramcollection.Add(new DataAcess.DBParameter("@PastProcessStatusId", receive.pastProcessStatusId)); paramcollection.Add(new DBParameter("@flag", receive.flag)); result = _DBHelper.ExecuteNonQuery("sp_Prod_PasteurizationProcessDetails", paramcollection, CommandType.StoredProcedure); } catch (Exception EX) { string MSG = EX.ToString(); } return(result); }