예제 #1
0
    protected void btnDisapprove_Click1(object sender, EventArgs e)
    {
        using (clsATW atw = new clsATW())
        {
            atw.ATWCode = Request.QueryString["atwcode"];
            atw.Fill();
            atw.ApproverDivisionRemarks = txtRemarksD.Text;
            atw.ApproverDivisionDate    = DateTime.Now;
            atw.DisapproveDivision();

            foreach (DataGridItem itm in dgSchedule.Items)
            {
                HiddenField phdnATWDCode = (HiddenField)itm.FindControl("hdnATWDCode");
                CheckBox    pchkApprove  = (CheckBox)itm.FindControl("chkApprove");
                TextBox     ptxtRemarks  = (TextBox)itm.FindControl("txtRemarks");

                using (clsATWDetails atwd = new clsATWDetails())
                {
                    atwd.ATWDCode = phdnATWDCode.Value;
                    atwd.Status   = (pchkApprove.Checked ? "1" : "0");
                    atwd.Remarks  = ptxtRemarks.Text + " ";
                    atwd.Update();
                }
            }
        }
        Response.Redirect("ATWMenu.aspx");
    }
예제 #2
0
    protected void btnApprove_Click1(object sender, EventArgs e)
    {
        string strErrorMessage = "";

        if (CountCheckedSchedule() == 0)
        {
            strErrorMessage += "<br>You should approve atleast 1 schedule.";
        }

        if (strErrorMessage.Length == 0)
        {
            using (clsATW atw = new clsATW())
            {
                atw.ATWCode = Request.QueryString["atwcode"];
                atw.Fill();
                atw.ApproverDivisionDate    = DateTime.Now;
                atw.ApproverDivisionRemarks = txtRemarksD.Text;
                atw.ApproveDivision();

                foreach (DataGridItem itm in dgSchedule.Items)
                {
                    HiddenField phdnATWDCode = (HiddenField)itm.FindControl("hdnATWDCode");
                    CheckBox    pchkApprove  = (CheckBox)itm.FindControl("chkApprove");
                    TextBox     ptxtRemarks  = (TextBox)itm.FindControl("txtRemarks");

                    using (clsATWDetails atwd = new clsATWDetails())
                    {
                        atwd.ATWDCode = phdnATWDCode.Value;
                        atwd.Status   = (pchkApprove.Checked ? "1" : "0");
                        atwd.Remarks  = ptxtRemarks.Text + " ";
                        atwd.Update();
                    }
                }
            }
            Response.Redirect("ATWMenu.aspx");
        }
        else
        {
            divError.Visible = true;
            lblErrMsg.Text   = strErrorMessage;
        }
    }