protected void btnAdd_Click(object sender, EventArgs e) { { mtracqc = new MTraceabilityMilkQC(); btracqc = new BTraceabilityMilkQC(); int Result = 0; mtracqc.TraceabilityMilkQCId = 0; mtracqc.RMRId = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value); mtracqc.CreamAndSkimDate = Convert.ToDateTime(txtSkimDate.Text.ToString()); mtracqc.PackingDate = Convert.ToDateTime(txtPackingDate.Text.ToString()); mtracqc.TraceabilitMilkQCShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value); mtracqc.TankerCode = string.IsNullOrEmpty(txtTankerCode.Text) ? string.Empty : txtTankerCode.Text; mtracqc.SMPBatchCode = string.IsNullOrEmpty(txtSMPBatchcode.Text) ? string.Empty : txtSMPBatchcode.Text; mtracqc.TankerPampingTime = string.IsNullOrEmpty(txtPumpinghr.Text) ? string.Empty : txtPumpinghr.Text; mtracqc.ChilledMilkSiloNo = string.IsNullOrEmpty(txtChilledMilkSiloNo.Text) ? string.Empty : txtChilledMilkSiloNo.Text; mtracqc.ProcessSiloNo = string.IsNullOrEmpty(txtProcessSiloNo.Text) ?string.Empty : txtProcessSiloNo.Text; mtracqc.CreamTemperature = string.IsNullOrEmpty(txtCreamTemperature.Text) ? 0 : Convert.ToDouble(txtCreamTemperature.Text); mtracqc.SkimTemperature = string.IsNullOrEmpty(txtSkimTemperature.Text) ? 0 : Convert.ToDouble(txtSkimTemperature.Text); mtracqc.FAT = string.IsNullOrEmpty(txtFAT.Text) ? 0 : Convert.ToDouble(txtFAT.Text); mtracqc.Taste = string.IsNullOrEmpty(txtTaste.Text) ? string.Empty : txtTaste.Text; mtracqc.Smell = string.IsNullOrEmpty(txtSmell.Text) ? string.Empty : txtSmell.Text; mtracqc.Color = string.IsNullOrEmpty(txtColor.Text) ? string.Empty : txtColor.Text; mtracqc.PhosphatasTest = string.IsNullOrEmpty(txtPhosphataseTest.Text)?string.Empty :txtPhosphataseTest.Text; mtracqc.Acidity = string.IsNullOrEmpty(txtAcidity.Text) ? 0 : Convert.ToDouble(txtAcidity.Text); mtracqc.CLR = string.IsNullOrEmpty(txtCLR.Text) ? 0 : Convert.ToDouble(txtCLR.Text); //mtracqc.Color = string.IsNullOrEmpty(txtColor.Text) ? 0 : Convert.ToDouble(txtColor.Text); mtracqc.PackedCode = string.IsNullOrEmpty(txtPacketCode.Text)? string.Empty : txtPacketCode.Text; mtracqc.SNF = string.IsNullOrEmpty(txtSNF.Text) ? 0 : Convert.ToDouble(txtSNF.Text); mtracqc.Technician = string.IsNullOrEmpty(txtTechnician.Text) ? string.Empty : txtTechnician.Text; mtracqc.TraceabilityStatusId = Convert.ToInt32(dpStatus.SelectedItem.Value); mtracqc.flag = "Insert"; Result = btracqc.tracqcdata(mtracqc); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; ScriptManager.RegisterStartupScript(this, this.GetType(), "sel3", "$('#bx1').addClass('collapsed-box');", true); RMRecieve R = new RMRecieve(); R.RMRDate = Convert.ToDateTime(txtSkimDate.Text); GetTraceabilityDetails(R); string dates; dates = string.IsNullOrEmpty(txtSearchDate.Text) ? string.Empty : Convert.ToDateTime(txtSearchDate.Text).ToString("dd-MM-yyyy"); uprouteList.Update(); lblSuccess.Text = "Traceability 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 tracqcdata(MTraceabilityMilkQC receive) { datracqc = new DATraceabilityMilkQC(); int Result = 0; try { Result = datracqc.tracqcdata(receive); } catch (Exception) { throw; } return(Result); }
public int tracqcdata(MTraceabilityMilkQC receive) { int result = 0; try { DBParameterCollection paramcollection = new DBParameterCollection(); //paramcollection.Add(new DBParameter("@TraceabilityMilkQCId", receive.TraceabilityMilkQCId)); paramcollection.Add(new DBParameter("@RMRId", receive.RMRId)); paramcollection.Add(new DBParameter("@CreamAndSkimDate", receive.CreamAndSkimDate)); paramcollection.Add(new DBParameter("@PackingDate", receive.PackingDate)); paramcollection.Add(new DBParameter("@TraceabilitMilkQCShiftId", receive.TraceabilitMilkQCShiftId)); paramcollection.Add(new DBParameter("@TankerCode", receive.TankerCode)); paramcollection.Add(new DBParameter("@SMPBatchCode", receive.SMPBatchCode)); paramcollection.Add(new DBParameter("@TankerPampingTime", receive.TankerPampingTime)); paramcollection.Add(new DBParameter("@ChilledMilkSiloNo", receive.ChilledMilkSiloNo)); paramcollection.Add(new DBParameter("@ProcessSiloNo", receive.ProcessSiloNo)); paramcollection.Add(new DBParameter("@CreamTemperature", receive.CreamTemperature)); paramcollection.Add(new DBParameter("@SkimTemperature", receive.SkimTemperature)); paramcollection.Add(new DBParameter("@FAT", receive.FAT)); paramcollection.Add(new DBParameter("@Taste", receive.Taste)); paramcollection.Add(new DBParameter("@Smell", receive.Smell)); paramcollection.Add(new DBParameter("@Color", receive.Color)); paramcollection.Add(new DBParameter("@PhosphatasTest", receive.PhosphatasTest)); paramcollection.Add(new DBParameter("@Acidity", receive.Acidity)); paramcollection.Add(new DBParameter("@CLR", receive.CLR)); paramcollection.Add(new DBParameter("@PackedCode", receive.PackedCode)); paramcollection.Add(new DBParameter("@SNF", receive.SNF)); paramcollection.Add(new DBParameter("@Technician", receive.Technician)); paramcollection.Add(new DBParameter("@TraceabilityStatusId", receive.TraceabilityStatusId)); paramcollection.Add(new DBParameter("@flag", receive.flag)); result = _DBHelper.ExecuteNonQuery("sp_Prod_TraceabilityMilkQCDetails", paramcollection, CommandType.StoredProcedure); } catch (Exception EX) { String MSG = EX.ToString(); } return(result); }