Ejemplo n.º 1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            mphcl = new MPersonalHygieneCheckList();
            bphcl = new BPersonalHygieneCheckList();
            int Result = 0;

            mphcl.PersonalHygieneCheckListId   = 0;
            mphcl.PersonalHygieneCheckListDate = Convert.ToDateTime(txtDate.Text.ToString());
            mphcl.EmployeeId    = Convert.ToInt32(dpEmployee.SelectedItem.Value);
            mphcl.DesignationId = Convert.ToInt32(dpDesignation.SelectedItem.Value);
            if (chkUniform.Checked)
            {
                mphcl.UniformCleaning = true;
            }
            else
            {
                mphcl.UniformCleaning = false;
            }

            if (chkBeardCrimp.Checked)
            {
                mphcl.BeardCrimp = true;
            }
            else
            {
                mphcl.BeardCrimp = false;
            }

            if (chkNail.Checked)
            {
                mphcl.Nail = true;
            }
            else
            {
                mphcl.Nail = false;
            }

            if (chkCap.Checked)
            {
                mphcl.Cap = true;
            }
            else
            {
                mphcl.Cap = false;
            }

            if (chkApronLab.Checked)
            {
                mphcl.ApronLab = true;
            }
            else
            {
                mphcl.ApronLab = false;
            }

            if (chkHandGloves.Checked)
            {
                mphcl.HandGloves = true;
            }
            else
            {
                mphcl.HandGloves = false;
            }

            if (chkMask.Checked)
            {
                mphcl.Mask = true;
            }
            else
            {
                mphcl.Mask = false;
            }

            mphcl.flag = "insert";
            Result     = bphcl.personalhygienedata(mphcl);
            if (Result > 0)
            {
                divDanger.Visible  = false;
                divwarning.Visible = false;

                divSusccess.Visible = true;
                lblSuccess.Text     = "Personal Hygiene CheckList 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();
            }
        }
Ejemplo n.º 2
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            mphcl = new MPersonalHygieneCheckList();
            bphcl = new BPersonalHygieneCheckList();
            int Result = 0;

            mphcl.PersonalHygieneCheckListId   = string.IsNullOrEmpty(hId.Value)?0:Convert.ToInt32(hId.Value);
            mphcl.PersonalHygieneCheckListDate = Convert.ToDateTime(txtDate.Text.ToString());
            mphcl.EmployeeId    = Convert.ToInt32(dpEmployee.SelectedItem.Value);
            mphcl.DesignationId = Convert.ToInt32(dpDesignation.SelectedItem.Value);
            if (chkUniform.Checked)
            {
                mphcl.UniformCleaning = true;
            }
            else
            {
                mphcl.UniformCleaning = false;
            }

            if (chkBeardCrimp.Checked)
            {
                mphcl.BeardCrimp = true;
            }
            else
            {
                mphcl.BeardCrimp = false;
            }

            if (chkNail.Checked)
            {
                mphcl.Nail = true;
            }
            else
            {
                mphcl.Nail = false;
            }

            if (chkCap.Checked)
            {
                mphcl.Cap = true;
            }
            else
            {
                mphcl.Cap = false;
            }

            if (chkApronLab.Checked)
            {
                mphcl.ApronLab = true;
            }
            else
            {
                mphcl.ApronLab = false;
            }

            if (chkHandGloves.Checked)
            {
                mphcl.HandGloves = true;
            }
            else
            {
                mphcl.HandGloves = false;
            }

            if (chkMask.Checked)
            {
                mphcl.Mask = true;
            }
            else
            {
                mphcl.Mask = false;
            }

            mphcl.flag = "Update";
            Result     = bphcl.personalhygienedata(mphcl);
            if (Result > 0)
            {
                divDanger.Visible  = false;
                divwarning.Visible = false;

                divSusccess.Visible = true;
                lblSuccess.Text     = "Personal Hygiene CheckList 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();
            }
        }