public int FumigationQCdata(MFumigationQC receive) { int result = 0; try { DBParameterCollection paramcollection = new DBParameterCollection(); paramcollection.Add(new DBParameter("FumigationQCId", receive.FumigationQCId)); paramcollection.Add(new DBParameter("FumigationQCDate", receive.FumigationQCDate)); paramcollection.Add(new DBParameter("FumigationQCShiftId", receive.FumigationQCShiftId)); paramcollection.Add(new DBParameter("AreaOfExposure", receive.AreaOfExposure)); paramcollection.Add(new DBParameter("StartingTime", receive.StartingTime)); paramcollection.Add(new DBParameter("EndTime", receive.EndTime)); paramcollection.Add(new DBParameter("ChemicalUsed", receive.ChemicalUsed)); paramcollection.Add(new DBParameter("Merits", receive.Merits)); paramcollection.Add(new DBParameter("Demerits", receive.Demerits)); paramcollection.Add(new DBParameter("DoneBy", receive.DoneBy)); paramcollection.Add(new DBParameter("VerifiedBy", receive.VerifiedBy)); paramcollection.Add(new DBParameter("ApprovedBy", receive.ApprovedBy)); paramcollection.Add(new DBParameter("@flag", receive.flag)); result = _DBHelper.ExecuteNonQuery("sp_Prod_FumigationQCDetails", paramcollection, CommandType.StoredProcedure); } catch (Exception EX) { string MSG = EX.ToString(); } return(result); }
public int FumigationQCdata(MFumigationQC receive) { dafqc = new DAFumigationQC(); int Result = 0; try { Result = dafqc.FumigationQCdata(receive); } catch (Exception) { throw; } return(Result); }
protected void btnAdd_Click(object sender, EventArgs e) { mfqc = new MFumigationQC(); bfqc = new BFumigationQC(); int Result = 0; mfqc.FumigationQCId = 0; mfqc.FumigationQCDate = Convert.ToDateTime(txtDate.Text).ToString("dd-MM-yyyy"); mfqc.FumigationQCShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value); mfqc.AreaOfExposure = string.IsNullOrEmpty(txtAreaOfExposure.Text) ? string.Empty : txtAreaOfExposure.Text; mfqc.StartingTime = string.IsNullOrEmpty(txtStartingTime.Text) ? string.Empty : txtStartingTime.Text; mfqc.EndTime = string.IsNullOrEmpty(txtEndTime.Text) ? string.Empty : txtEndTime.Text; mfqc.ChemicalUsed = string.IsNullOrEmpty(txtChemicalUsed.Text) ? string.Empty : txtChemicalUsed.Text; mfqc.Merits = string.IsNullOrEmpty(txtMerits.Text) ? string.Empty : txtMerits.Text; mfqc.Demerits = string.IsNullOrEmpty(txtDemerits.Text) ? string.Empty : txtDemerits.Text; mfqc.DoneBy = string.IsNullOrEmpty(txtDoneBy.Text) ? string.Empty : txtDoneBy.Text; mfqc.VerifiedBy = string.IsNullOrEmpty(txtVerifiedBy.Text) ? string.Empty : txtVerifiedBy.Text; mfqc.ApprovedBy = string.IsNullOrEmpty(txtApprovedBy.Text) ? string.Empty : txtApprovedBy.Text; mfqc.flag = "Insert"; Result = bfqc.FumigationQCdata(mfqc); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "FumigationQC Data Added Successfully"; ScriptManager.RegisterStartupScript(this, this.GetType(), "sel3", "$('#bx2').removeClass('collapsed-box');", true); pnlError.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblSuccess.Text = "Something went wrong plz contact site admin"; pnlError.Update(); } }
protected void btnUpdate_Click(object sender, EventArgs e) { mfqc = new MFumigationQC(); bfqc = new BFumigationQC(); int Result = 0; mfqc.FumigationQCId = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value); mfqc.FumigationQCDate = Convert.ToDateTime(txtDate.Text).ToString("dd-MM-yyyy"); mfqc.FumigationQCShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value); mfqc.AreaOfExposure = string.IsNullOrEmpty(txtAreaOfExposure.Text) ? string.Empty : txtAreaOfExposure.Text; mfqc.StartingTime = string.IsNullOrEmpty(txtStartingTime.Text) ? string.Empty : txtStartingTime.Text; mfqc.EndTime = string.IsNullOrEmpty(txtEndTime.Text) ? string.Empty : txtEndTime.Text; mfqc.ChemicalUsed = string.IsNullOrEmpty(txtChemicalUsed.Text) ? string.Empty : txtChemicalUsed.Text; mfqc.Merits = string.IsNullOrEmpty(txtMerits.Text) ? string.Empty : txtMerits.Text; mfqc.Demerits = string.IsNullOrEmpty(txtDemerits.Text) ? string.Empty : txtDemerits.Text; mfqc.DoneBy = string.IsNullOrEmpty(txtDoneBy.Text) ? string.Empty : txtDoneBy.Text; mfqc.VerifiedBy = string.IsNullOrEmpty(txtVerifiedBy.Text) ? string.Empty : txtVerifiedBy.Text; mfqc.ApprovedBy = string.IsNullOrEmpty(txtApprovedBy.Text) ? string.Empty : txtApprovedBy.Text; mfqc.flag = "Update"; Result = bfqc.FumigationQCdata(mfqc); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "FumigationQC Data Updated Successfully"; pnlError.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblSuccess.Text = "Something went wrong plz contact site admin"; pnlError.Update(); } }