Exemplo n.º 1
0
    protected void btnSAVE_Click(object sender, EventArgs e)
    {
        try
        {
            uint chknum;

            if (txtACADEMIC_YEAR.Text.Length != 4)
            {
                MsgValidate("โปรดระบุ ปีการศึกษาเป็นตัวเลขจำนวน 4 ตัว");
            }
            else if (!uint.TryParse(txtACADEMIC_YEAR.Text, out chknum))
            {
                MsgValidate("โปรดระบุ ปีการศึกษาเป็นตัวเลขเท่านั้น");
            }
            else
            {
                config_data.AcademicYear = txtACADEMIC_YEAR.Text;
                config_data.Semester     = ddlSEMESTER.SelectedValue;
                string result = new TeachExamConfig().updateYearSemesterConfig(config_data);

                if (result == "OK")
                {
                    // Application["teachexam_academic_year"] = config_data.AcademicYear;
                    // Application["teachexam_semester"] = config_data.Semester;
                    divSuccess.Visible = true;
                }
            }
        }
        catch
        {
            divFail.Visible    = true;
            divSuccess.Visible = false;
        }
    }
Exemplo n.º 2
0
    protected void btnSAVE_Click(object sender, EventArgs e)
    {
        DateTime dt;
        utility  utlObj = new utility();

        if (!DateTime.TryParseExact(txtStartDate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out dt))
        {
            MsgValidate("รูปแบบวันเริ่มต้นการจัดตาราสอน/ตาราสอบ วัน/เดือน/ปี เช่น 01/10/2015");
        }
        else if (!DateTime.TryParseExact(txtStopDate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out dt))
        {
            MsgValidate("รูปแบบวันสุดท้ายการจัดตาราสอน/ตาราสอบ วัน/เดือน/ปี เช่น 01/10/2015");
        }
        else if (utlObj.getDiffDate(txtStartDate.Text, txtStopDate.Text) > 0)
        {
            MsgValidate("วันเริ่มแรกและวันสุดท้ายของการขึ้นทะเบียน ไม่สอดคล้องกัน");
        }
        else
        {
            config_data.Date_Start = txtStartDate.Text;
            config_data.Date_Stop  = txtStopDate.Text;
            string result = new TeachExamConfig().updateDateConfig(config_data);
            if (result == "OK")
            {
                fail.Visible    = false;
                success.Visible = true;
            }
            else
            {
                fail.Visible    = true;
                success.Visible = false;
            }
        }
    }
Exemplo n.º 3
0
    protected void btnSAVE_Click(object sender, EventArgs e)
    {
        utility  utlObj = new utility();
        DateTime dt;

        if (ddlDepartment.SelectedItem.Value == "0")
        {
            MsgValidate("โปรดระบุ ภาควิชา");
        }
        else if (!DateTime.TryParseExact(txtStartDate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out dt))
        {
            MsgValidate("รูปแบบวันเริ่มต้นการจัดตาราสอน/ตาราสอบ วัน/เดือน/ปี เช่น 01/10/2015");
        }
        else if (!DateTime.TryParseExact(txtStopDate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out dt))
        {
            MsgValidate("รูปแบบวันสุดท้ายการจัดตาราสอน/ตาราสอบ วัน/เดือน/ปี เช่น 01/10/2015");
        }
        else if (utlObj.getDiffDate(txtStartDate.Text, txtStopDate.Text) > 0)
        {
            MsgValidate("วันเริ่มแรกและวันสุดท้ายของการขึ้นทะเบียน ไม่สอดคล้องกัน");
        }
        else
        {
            string result = "";
            config_data.Faculty_Code    = ddlFACULTY.SelectedItem.Value;
            config_data.Department_Code = ddlDepartment.SelectedItem.Value;
            config_data.Date_Start      = txtStartDate.Text;
            config_data.Date_Stop       = txtStopDate.Text;

            configData = new TeachExamConfig().getExtendTeachExamConfig(ddlDepartment.SelectedItem.Value);

            if (configData.Department_Code == null)
            {
                result          = new TeachExamConfig().extendDateConfig(config_data);
                lblSuccess.Text = "เพิ่มข้อมูลสำเร็จ";
            }
            else
            {
                config_data.Department_Code = configData.Department_Code;
                result          = new TeachExamConfig().updateExtendDateConfig(config_data);
                lblSuccess.Text = "แก้ไขข้อมูลสำเร็จ";
            }

            if (result == "OK")
            {
                success.Visible = true;
                fail.Visible    = false;
            }
            else
            {
                success.Visible = false;
                fail.Visible    = true;
            }
        }
    }
Exemplo n.º 4
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        string result = new TeachExamConfig().deleteExtendDateConfig(department_code);

        if (result == "OK")
        {
            Response.Redirect("extend_Schedule.aspx");
        }
        else
        {
            lblResult.Text = result;
        }
    }