public void GetPersonalHygieneCheckListQCDetails() { bphcqc = new BPersonalHygieneCheckListQC(); DataSet DS = new DataSet(); DS = bphcqc.GetPersonalHygieneCheckListQCDetails(); if (!Comman.Comman.IsDataSetEmpty(DS)) { rpPersonalHygieneCheckListQC.DataSource = DS; rpPersonalHygieneCheckListQC.DataBind(); } }
public void GetPersonalHygieneCheckListQCDetails(int PersonalHygieneCheckListQCId) { DataSet DS = new DataSet(); bphcqc = new BPersonalHygieneCheckListQC(); DS = bphcqc.GetPersonalHygieneCheckListQCDetailsById(PersonalHygieneCheckListQCId); if (!Comman.Comman.IsDataSetEmpty(DS)) { string DATE = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["PersonalHygieneCheckListQCDate"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["PersonalHygieneCheckListQCDate"].ToString(); if (DATE == "") { txtDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); } else { DateTime date1 = Convert.ToDateTime(DATE, System.Globalization.CultureInfo.GetCultureInfo("ur-PK").DateTimeFormat); txtDate.Text = (Convert.ToDateTime(date1).ToString("yyyy-MM-dd")); } dpEmployee.ClearSelection(); if (dpEmployee.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["EmployeeId"]).ToString()) != null) { dpEmployee.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["EmployeeId"]).ToString()).Selected = true; } dpDesignation.ClearSelection(); if (dpDesignation.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["DesignationId"]).ToString()) != null) { dpDesignation.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["DesignationId"]).ToString()).Selected = true; } txtUniformCleaning.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["UniformCleaning"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["UniformCleaning"].ToString(); txtNail.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Nail"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Nail"].ToString(); txtCap.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Cap"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Cap"].ToString(); txtApronLab.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["ApronLab"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["ApronLab"].ToString(); txtBeardCrimp.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["BeardCrimp"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["BeardCrimp"].ToString(); txtHandGloves.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["HandGloves"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["HandGloves"].ToString(); txtMask.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Mask"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Mask"].ToString(); } }
protected void btnAdd_Click1(object sender, EventArgs e) { mphcqc = new MPersonalHygieneCheckListQC(); bphcqc = new BPersonalHygieneCheckListQC(); int Result = 0; mphcqc.PersonalHygieneCheckListQCId = 0; mphcqc.PersonalHygieneCheckListQCDate = Convert.ToDateTime(txtDate.Text.ToString()); mphcqc.EmployeeId = Convert.ToInt32(dpEmployee.SelectedItem.Value); mphcqc.DesignationId = Convert.ToInt32(dpDesignation.SelectedItem.Value); if (chkUniform.Checked) { mphcqc.UniformCleaning = true; } else { mphcqc.UniformCleaning = false; } if (chkNail.Checked) { mphcqc.Nail = true; } else { mphcqc.Nail = false; } if (chkCap.Checked) { mphcqc.Cap = true; } else { mphcqc.Cap = false; } if (chkApronLab.Checked) { mphcqc.ApronLab = true; } else { mphcqc.ApronLab = false; } if (chkBeardCrimp.Checked) { mphcqc.BeardCrimp = true; } else { mphcqc.BeardCrimp = false; } if (chkHandGloves.Checked) { mphcqc.HandGloves = true; } else { mphcqc.HandGloves = false; } if (chkMask.Checked) { mphcqc.Mask = true; } else { mphcqc.Mask = false; } mphcqc.flag = "Insert"; Result = bphcqc.personalhygieneqcdata(mphcqc); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Personal Hygiene CheckListQC 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_Click1(object sender, EventArgs e) { mphcqc = new MPersonalHygieneCheckListQC(); bphcqc = new BPersonalHygieneCheckListQC(); int Result = 0; mphcqc.PersonalHygieneCheckListQCId = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value); mphcqc.PersonalHygieneCheckListQCDate = Convert.ToDateTime(txtDate.Text.ToString()); mphcqc.EmployeeId = Convert.ToInt32(dpEmployee.SelectedItem.Value); mphcqc.DesignationId = Convert.ToInt32(dpDesignation.SelectedItem.Value); if (chkUniform.Checked) { mphcqc.UniformCleaning = true; } else { mphcqc.UniformCleaning = false; } if (chkNail.Checked) { mphcqc.Nail = true; } else { mphcqc.Nail = false; } if (chkCap.Checked) { mphcqc.Cap = true; } else { mphcqc.Cap = false; } if (chkApronLab.Checked) { mphcqc.ApronLab = true; } else { mphcqc.ApronLab = false; } if (chkBeardCrimp.Checked) { mphcqc.BeardCrimp = true; } else { mphcqc.BeardCrimp = false; } if (chkHandGloves.Checked) { mphcqc.HandGloves = true; } else { mphcqc.HandGloves = false; } if (chkMask.Checked) { mphcqc.Mask = true; } else { mphcqc.Mask = false; } mphcqc.flag = "Update"; Result = bphcqc.personalhygieneqcdata(mphcqc); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Personal Hygiene CheckListQC 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(); } }