Пример #1
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            DTO.LicenseTypet licensetype = new DTO.LicenseTypet();
            licensetype.AGENT_TYPE        = ddlAgentTypeUpdate.SelectedValue;
            licensetype.INSURANCE_TYPE    = ddlInsuranUpdate.SelectedValue;
            licensetype.LICENSE_TYPE_CODE = hdTypeCode.Value;
            licensetype.LICENSE_TYPE_NAME = txtUpdatename.Text;
            var res = biz.UpdateLicenseType(licensetype);

            if (res.ErrorMsg != null)
            {
                UCModalError1.ShowMessageError = res.ErrorMsg;
                UCModalError1.ShowModalError();
            }
            else
            {
                txtLicenseName.Text = "";
                BindDrop();
                ddlInsuran.SelectedValue           = "";
                ddlAgentype.SelectedValue          = "";
                UCModalSuccess1.ShowMessageSuccess = Resources.infoSetSubject_002;
                UCModalSuccess1.ShowModalSuccess();
            }
            ModalPopupUpdate.Hide();
        }
Пример #2
0
 protected void btnsave_Click(object sender, EventArgs e)
 {
     if (list_add_association.Count == 0 && list_delete_association.Count == 0)
     {
         UCModalError1.ShowMessageError = "ไม่ข้อมูลการทำรายการของคุณ";
         UCModalError1.ShowModalError();
     }
     else
     {
         var res = biz.AddAssocitionApplove(list_add_association, list_delete_association, base.UserId);//
         ModalPopup.Hide();
         GvCheckDoc.DataSource = biz.SelectApploveDocumentType("").DataResponse;
         GvCheckDoc.DataBind();
         if (res.IsError)
         {
             UCModalError1.ShowMessageError = "บันทึกข้อมูลไม่สำเร็จ";
             UCModalError1.ShowModalError();
         }
         else
         {
             UCModalSuccess1.ShowMessageSuccess = "บันทึกข้อมูลสำเร็จ";
             UCModalSuccess1.ShowModalSuccess();
         }
     }
 }
Пример #3
0
 protected void btnSaveCourse_Click(object sender, EventArgs e)
 {
     if (hidNewCourse.Value == "")
     {
         UCModalError1.ShowMessageError = "คุณยังไม่ได้เลือกหลักสูตรใหม่";
         UCModalError1.ShowModalError();
     }
     else if (hidNewCourse.Value == hidOldCourse.Value)
     {
         UCModalError1.ShowMessageError = "หลักสูตรที่คุณเลือกได้ถูกใช้อยู่แล้ว";
         UCModalError1.ShowModalError();
     }
     else
     {
         var res = biz.ActiveConditionGroup(hidNewCourse.Value, ddlType.SelectedValue);
         if (res.ErrorMsg == null)
         {
             UCModalSuccess1.ShowMessageSuccess = "บันทึกข้อมูลสำเร็จ";
             UCModalSuccess1.ShowModalSuccess();
         }
         else
         {
             UCModalError1.ShowMessageError = res.ErrorMsg;
             UCModalError1.ShowModalError();
         }
     }
 }
Пример #4
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string validate = Validation.Validate(Page, "a");

            if (validate != "")
            {
                UCModalError1.ShowMessageError = validate;
                UCModalError1.ShowModalError();
                return;
            }
            GBHoliday holiday = new GBHoliday();

            holiday.HL_DATE = Convert.ToDateTime(txtDateHoliday.Text);
            holiday.HL_DESC = txtNameHoliday.Text;
            var res = biz.AddHoliday(holiday);

            if (res.ErrorMsg == null)
            {
                UCModalSuccess1.ShowMessageSuccess = Resources.infoSetHoliday_001;
                UCModalSuccess1.ShowModalSuccess();
                BindGrid();
                txtDateHoliday.Text = "";
                txtNameHoliday.Text = "";
            }
            else
            {
                UCModalError1.ShowMessageError = res.ErrorMsg;
                UCModalError1.ShowModalError();
            }
        }
Пример #5
0
        protected void btnSaveDoctype_Click(object sender, EventArgs e)
        {
            var list = new List <DTO.ApploveDocumnetType>();

            foreach (GridViewRow row in GvCheckDoc.Rows)
            {
                Label               lbldoccode = (Label)row.FindControl("lbldoccode");
                CheckBox            check      = (CheckBox)row.FindControl("check");
                ApploveDocumnetType doc        = new ApploveDocumnetType();
                doc.APPROVE_DOC_TYPE = lbldoccode.Text;
                if (check.Checked)
                {
                    doc.ITEM_VALUE = "Y";
                }
                else
                {
                    doc.ITEM_VALUE = "N";
                }
                list.Add(doc);
            }
            var res = biz.UpdateApploveDoctype(list, base.UserId);//

            if (res.IsError)
            {
                UCModalError1.ShowMessageError = "บันทึกข้อมูลไม่สำเร็จ";
                UCModalError1.ShowModalError();
            }
            else
            {
                UCModalSuccess1.ShowMessageSuccess = "บันทึกข้อมูลสำเร็จ";
                UCModalSuccess1.ShowModalSuccess();
            }
        }
Пример #6
0
        protected void hplCancel_Click(object sender, EventArgs e)
        {
            try
            {
                var                        gr          = (GridViewRow)((LinkButton)sender).NamingContainer;
                var                        lblTimeCode = (Label)gr.FindControl("lblPlaceCode");
                string                     Key         = lblTimeCode.Text;
                ExamScheduleBiz            biz         = new ExamScheduleBiz();
                DTO.ResponseMessage <bool> DelP        = biz.DelPlace(Key, base.UserId.ToString());

                Boolean Del_time = DelP.ResultMessage;
                if (!Del_time)
                {
                    UCModalSuccess1.ShowMessageSuccess = "บันทึกสำเร็จ";
                    UCModalSuccess1.ShowModalSuccess();
                }
                else
                {
                    UCModalError1.ShowMessageError = "ไม่สามารถบันทึกได้";
                    UCModalError1.ShowModalError();
                }
                btn_Search_Click(sender, e);
            }
            catch
            {
            }
        }
Пример #7
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            var validate = Validation.Validate(this, "a");

            if (validate != "")
            {
                UCModalError1.ShowMessageError = validate;
                UCModalError1.ShowModalError();
            }
            else
            {
                DTO.GroupSubject group = new DTO.GroupSubject();
                group.GROUP_NAME = txtGroupName.Text.Trim();
                group.EXAM_PASS  = txtExamPass.Text.ToDecimal();

                var res = biz.AddSubjectGroup(group);
                if (res.ErrorMsg == null)
                {
                    txtExamPass.Text  = string.Empty;
                    txtGroupName.Text = string.Empty;
                    BindGrid();
                    UCModalSuccess1.ShowMessageSuccess = "บันทีกข้อมูลสำเร็จ";
                    UCModalSuccess1.ShowModalSuccess();
                }
                else
                {
                    UCModalError1.ShowMessageError = res.ErrorMsg;
                    UCModalError1.ShowModalError();
                }
            }
        }
Пример #8
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            var validate = Validation.Validate(this, "b");

            if (validate != "")
            {
                UCModalError1.ShowMessageError = validate;
                UCModalError1.ShowModalError();
            }
            else
            {
                DTO.GroupSubject group = new DTO.GroupSubject();
                group.ID         = HID.Value.ToDecimal();
                group.GROUP_NAME = txtUpdateGroupName.Text;
                group.EXAM_PASS  = txtUpdatePass.Text.ToDecimal();
                group.STATUS     = "A";
                var res = biz.UpdateSubjectGroup(group);
                if (res.ErrorMsg == null)
                {
                    BindGrid();
                    UCModalSuccess1.ShowMessageSuccess = "แก้ไขข้อมูลสำเร็จ";
                    UCModalSuccess1.ShowModalSuccess();
                }
                else
                {
                    UCModalError1.ShowMessageError = "แก้ไขข้อมูลไม่สำเร็จ";
                    UCModalError1.ShowModalError();
                }
            }
        }
Пример #9
0
 protected void btn_Save_Click(object sender, EventArgs e)
 {
     try
     {
         if (ddlPlaceGroup.SelectedValue != "")
         {
             if (txtSeat.Text.Trim() == "" || txtPlace.Text.Trim() == "" || txtCode.Text.Trim() == "")
             {
                 UCModalError1.ShowMessageError = "กรุณาระบุข้อมูลให้ครบ";
                 UCModalError1.ShowModalError();
             }
             else
             {
                 if (txtSeat.Text.ToInt() > 30000)
                 {
                     UCModalError1.ShowMessageError = "สนามสอบแต่ละแห่งสามารถรองรับผู้สมัครสอบได้สูงสุด 30,000 คน เท่านั้น";
                     UCModalError1.ShowModalError();
                 }
                 else
                 {
                     if (txtCode.Text.Length == 5)
                     {
                         Boolean addnew = true;
                         if (txtCode.Enabled == false)
                         {
                             addnew = false;
                         }
                         ExamScheduleBiz            biz    = new ExamScheduleBiz();
                         DTO.ResponseMessage <bool> SaveOK = biz.SavePlace(ddlPlaceG.SelectedValue.ToString(), ddlProvince.SelectedValue.ToString(), txtCode.Text, txtPlace.Text, txtSeat.Text, chkFree.Checked, base.UserId.ToString(), addnew, ddlPlaceGroup.SelectedValue.ToString());
                         if (SaveOK.ResultMessage == true)
                         {
                             UCModalSuccess1.ShowMessageSuccess = SysMessage.SaveSucess;
                             UCModalSuccess1.ShowModalSuccess();
                             btn_Search_Click(sender, e);
                             btn_Cancle_Click(sender, e);
                             UpdatePanelUpload.Update();
                         }
                         else
                         {
                             UCModalError1.ShowMessageError = SaveOK.ErrorMsg;
                             UCModalError1.ShowModalError();
                         }
                     }
                     else
                     {
                         UCModalError1.ShowMessageError = "รหัสสนามสอบต้องมีจำนวน 5 ตัวอักษรเท่านั้น";
                         UCModalError1.ShowModalError();
                     }
                 }
             }
         }
     }
     catch
     {
     }
 }
Пример #10
0
        protected void btn_Add_Click(object sender, EventArgs e)
        {
            try
            {
                if (Convert.ToInt32(st_hr.SelectedValue) > Convert.ToInt32(en_hr.SelectedValue))
                {
                    UCModalError1.ShowMessageError = "เวลาเริ่มต้นมากกว่าเวลาสิ้นสุด";
                    UCModalError1.ShowModalError();
                    return;
                }
                else if (st_hr.SelectedValue.ToString() == en_hr.SelectedValue.ToString())
                {
                    UCModalError1.ShowMessageError = "เวลาเริ่มต้นเท่ากับเวลาสิ้นสุด";
                    UCModalError1.ShowModalError();
                    return;
                }
                ExamRoomBiz biz = new ExamRoomBiz();
                DTO.ResponseMessage <bool> AddTime = biz.Add_Time(st_hr.SelectedValue.ToString(), st_min.SelectedValue.ToString(),
                                                                  en_hr.SelectedValue.ToString(), en_min.SelectedValue.ToString(), base.UserId.ToString());

                Boolean add_time = AddTime.ResultMessage;
                if (add_time)
                {
                    UCModalSuccess1.ShowMessageSuccess = "บันทึกสำเร็จ";
                    UCModalSuccess1.ShowModalSuccess();
                }
                else
                {
                    UCModalError1.ShowMessageError = "ไม่สามารถบันทึกได้";
                    UCModalError1.ShowModalError();
                }
                btn_Add.Visible    = false;
                btn_Search.Visible = true;
                //st_hr.SelectedIndex = 0;
                //st_min.SelectedIndex = 0;
                //en_hr.SelectedIndex = 0;
                //en_min.SelectedIndex = 0;
                st_hr.Enabled  = true;
                st_min.Enabled = true;
                en_min.Enabled = true;
                en_hr.Enabled  = true;
                btn_Search_Click(sender, e);
                UpdatePanelGridviewExamTime.Update();
            }
            catch
            {
            }
        }
Пример #11
0
        protected void lbtDelete_Click(object sender, EventArgs e)
        {
            var res = biz.DeleteSubjectGroup(((Label)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("lblId")).Text);

            if (res.ErrorMsg == null)
            {
                BindGrid();
                UCModalSuccess1.ShowMessageSuccess = "ลบข้อมูลสำเร็จ";
                UCModalSuccess1.ShowModalSuccess();
            }
            else
            {
                UCModalError1.ShowMessageError = "ลบข้อมูลไม่สำเร็จ";
                UCModalError1.ShowModalError();
            }
        }
Пример #12
0
        protected void lbtDelete_Click(object sender, EventArgs e)
        {
            string date = ((Label)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("lbldate")).Text;
            var    res  = biz.DeleteHoliday(date);

            if (res.ErrorMsg == null)
            {
                UCModalSuccess1.ShowMessageSuccess = Resources.infoSetHoliday_002;
                UCModalSuccess1.ShowModalSuccess();
                BindGrid();
            }
            else
            {
                UCModalError1.ShowMessageError = res.ErrorMsg;
                UCModalError1.ShowModalError();
            }
        }
Пример #13
0
        protected void lbtDelete_Click(object sender, EventArgs e)
        {
            string licensecode = ((Label)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("lblTypeCode")).Text;
            var    res         = biz.DeleteLicenseType(licensecode);

            if (res.ErrorMsg != null)
            {
                UCModalError1.ShowMessageError = res.ErrorMsg;
                UCModalError1.ShowModalError();
            }
            else
            {
                BindDrop();
                UCModalSuccess1.ShowMessageSuccess = Resources.infoSetSubject_003;
                UCModalSuccess1.ShowModalSuccess();
            }
        }
Пример #14
0
        protected void lblDelete_Click(object sender, EventArgs e)
        {
            string assocition = ((Label)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("lblAssoCode")).Text;

            list_delete_association.Add(new ASSOCIATION_APPROVE {
                APPROVE_DOC_TYPE = hdTypeCode.Value, ASSOCIATION_CODE = assocition
            });
            list_association.Remove(list_association.FirstOrDefault(x => x.ASSOCIATION_CODE == assocition && x.APPROVE_DOC_TYPE == hdTypeCode.Value));
            gvAsso.DataSource = list_association;
            if (list_add_association.FirstOrDefault(x => x.ASSOCIATION_CODE == assocition && x.APPROVE_DOC_TYPE == hdTypeCode.Value) != null)
            {
                list_add_association.Remove(list_add_association.FirstOrDefault(x => x.ASSOCIATION_CODE == assocition && x.APPROVE_DOC_TYPE == hdTypeCode.Value));
            }
            gvAsso.DataBind();
            ModalPopup.Show();
            UCModalSuccess1.ShowMessageSuccess = "ลบข้อมูลออกจากรายการแล้ว";
            UCModalSuccess1.ShowModalSuccess();
        }
Пример #15
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            ModalPopupUpdate.Hide();
            DTO.GBHoliday holiday = new GBHoliday();
            holiday.HL_DATE = Convert.ToDateTime(lbldatate.Text);
            holiday.HL_DESC = txtUpdatename.Text;
            var res = biz.UpdateHoliday(holiday);

            if (res.ErrorMsg == null)
            {
                UCModalSuccess1.ShowMessageSuccess = Resources.infoSetHoliday_003;
                UCModalSuccess1.ShowModalSuccess();
            }
            else
            {
                UCModalError1.ShowMessageError = res.ErrorMsg;
                UCModalError1.ShowModalError();
            }
        }
Пример #16
0
        protected void lbtDelete_Click(object sender, EventArgs e)
        {
            DTO.Subjectr subject = new DTO.Subjectr();
            subject.LICENSE_TYPE_CODE = ((Label)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("lblLicenCode")).Text;
            subject.SUBJECT_CODE      = ((Label)((GridViewRow)((LinkButton)sender).Parent.Parent).FindControl("lblSubjectCode")).Text;
            var res = biz.DeleteSubject(subject);

            if (res.ErrorMsg != null)
            {
                UCModalError1.ShowMessageError = res.ErrorMsg;
                UCModalError1.ShowModalError();
            }
            else
            {
                BinGrid();
                UCModalSuccess1.ShowMessageSuccess = Resources.infoSetSubject_003;
                UCModalSuccess1.ShowModalSuccess();
            }
        }
Пример #17
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Dictionary <string, string> dic = new Dictionary <string, string>();

            foreach (GridViewRow item in GvLicense.Rows)
            {
                Label        lbl_Id     = (Label)item.FindControl("lbl_Id");
                DropDownList ddl_select = (DropDownList)item.FindControl("ddl_select");
                dic.Add(lbl_Id.Text, ddl_select.SelectedValue);
            }
            var res = biz.AddLincse0304(dic);

            if (res.IsError)
            {
                UCModalError1.ShowMessageError = res.ErrorMsg;
                UCModalError1.ShowModalError();
            }
            else
            {
                UCModalSuccess1.ShowMessageSuccess = "บันทึกข้อมูลสำเร็จ";
                UCModalSuccess1.ShowModalSuccess();
            }
        }
Пример #18
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            DTO.LicenseTypet licensetype = new DTO.LicenseTypet();
            licensetype.AGENT_TYPE        = ddlAgentype.SelectedValue;
            licensetype.INSURANCE_TYPE    = ddlInsuran.SelectedValue;
            licensetype.LICENSE_TYPE_NAME = txtLicenseName.Text;
            var res = biz.AddLicenseType(licensetype);

            if (res.ErrorMsg != null)
            {
                UCModalError1.ShowMessageError = res.ErrorMsg;
                UCModalError1.ShowModalError();
            }
            else
            {
                txtLicenseName.Text = "";
                BindDrop();
                ddlInsuran.SelectedValue           = "";
                ddlAgentype.SelectedValue          = "";
                UCModalSuccess1.ShowMessageSuccess = "";
                UCModalSuccess1.ShowModalSuccess();
            }
        }
Пример #19
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            if (ddlAsso.SelectedValue == "")
            {
                UCModalError1.ShowMessageError = "กรุณาเลือกสมาคม";
                UCModalError1.ShowModalError();
                ModalPopup.Show();
            }
            else
            {
                if (list_association.FirstOrDefault(x => x.ASSOCIATION_CODE == ddlAsso.SelectedValue) == null)
                {
                    list_association.Add(new ASSOCIATION_APPROVE {
                        APPROVE_DOC_TYPE = hdTypeCode.Value, ASSOCIATION_CODE = ddlAsso.SelectedValue, ASSOCIATION_NAME = ddlAsso.SelectedItem.Text
                    });
                    list_add_association.Add(new ASSOCIATION_APPROVE {
                        APPROVE_DOC_TYPE = hdTypeCode.Value, ASSOCIATION_CODE = ddlAsso.SelectedValue
                    });

                    if (list_delete_association.FirstOrDefault(x => x.ASSOCIATION_CODE == ddlAsso.SelectedValue && x.APPROVE_DOC_TYPE == hdTypeCode.Value) != null)
                    {
                        list_delete_association.Remove(list_delete_association.FirstOrDefault(x => x.ASSOCIATION_CODE == ddlAsso.SelectedValue && x.APPROVE_DOC_TYPE == hdTypeCode.Value));
                    }
                    gvAsso.DataSource = list_association;
                    gvAsso.DataBind();
                    ModalPopup.Show();
                    UCModalSuccess1.ShowMessageSuccess = "เพิ่มเข้าในรายการแล้ว";
                    UCModalSuccess1.ShowModalSuccess();
                }
                else
                {
                    ModalPopup.Show();
                    UCModalError1.ShowMessageError = "สมาคมที่คุณเลือกมีแล้วในรายการ";
                    UCModalError1.ShowModalError();
                }
            }
        }
Пример #20
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (btnSave.Text == "บันทึก")
            {
                string validate = Validation.Validate(Page, "a");
                if (validate != "")
                {
                    UCModalError1.ShowMessageError = validate;
                    UCModalError1.ShowModalError();
                }
                else
                {
                    DTO.Subjectr subject = new DTO.Subjectr();
                    subject.LICENSE_TYPE_CODE = ddlType.SelectedValue;
                    subject.SUBJECT_NAME      = txtSubjectName.Text;
                    subject.SUBJECT_CODE      = txtSubjectCode.Text;
                    subject.GROUP_ID          = ddlGroup.SelectedValue.ToShort();
                    // subject.EXAM_PASS = txtPass.Text.ToShort();
                    subject.MAX_SCORE = txtMaxScore.Text.ToShort();
                    subject.USER_ID   = base.UserId;
                    var res = biz.AddSubject(subject);
                    if (res.ErrorMsg != null)
                    {
                        UCModalError1.ShowMessageError = res.ErrorMsg;
                        UCModalError1.ShowModalError();
                    }
                    else
                    {
                        BinGrid();
                        UCModalSuccess1.ShowMessageSuccess = Resources.infoSetSubject_001;
                        UCModalSuccess1.ShowModalSuccess();
                        txtSubjectCode.Text = "";
                        txtSubjectName.Text = "";
                        txtMaxScore.Text    = "";
                        //  txtPass.Text = "";
                        ddlGroup.SelectedValue = "";
                    }
                }
            }
            else //แก้ไขข้อมูล
            {
                string validate = Validation.Validate(Page, "a");
                if (validate != "")
                {
                    UCModalError1.ShowMessageError = validate;
                    UCModalError1.ShowModalError();
                }
                else
                {
                    DTO.Subjectr subject = new DTO.Subjectr();
                    subject.LICENSE_TYPE_CODE = ddlType.SelectedValue;
                    subject.SUBJECT_NAME      = txtSubjectName.Text;
                    subject.SUBJECT_CODE      = LabelSubjectId.Text;
                    subject.MAX_SCORE         = txtMaxScore.Text.ToShort();
                    // subject.EXAM_PASS = txtPass.Text.ToShort();
                    // subject.GROUP_ID = ddlGroup.SelectedValue.ToShort();

                    var res = biz.UpdateSubject(subject);
                    if (res.ErrorMsg != null)
                    {
                        UCModalError1.ShowMessageError = res.ErrorMsg;
                        UCModalError1.ShowModalError();
                    }
                    else
                    {
                        BinGrid();
                        UCModalSuccess1.ShowMessageSuccess = Resources.infoSetSubject_002;
                        UCModalSuccess1.ShowModalSuccess();
                    }
                }
            }
        }
Пример #21
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            var validate = Validation.Validate(this, "a");

            if (validate != "")
            {
                UCModalError1.ShowMessageError = validate;
                UCModalError1.ShowModalError();
            }
            else
            {
                DTO.ConditionGroup  conditiongroup = new DTO.ConditionGroup();
                List <DTO.Subjectr> subject        = new List <DTO.Subjectr>();
                conditiongroup.LICENSE_TYPE_CODE = ddlType.SelectedValue;
                conditiongroup.NOTE       = txtNote.Text;
                conditiongroup.START_DATE = Convert.ToDateTime(txtStartDate.Text);
                conditiongroup.USER_ID    = base.UserId;
                conditiongroup.USER_DATE  = DateTime.Now;

                if (check.Checked)
                {
                    conditiongroup.STATUS = "A";
                }
                else
                {
                    conditiongroup.STATUS = "I";
                }


                if (txtEndDate.Text != "")
                {
                    conditiongroup.END_DATE = Convert.ToDateTime(txtEndDate.Text);
                    if (conditiongroup.START_DATE > conditiongroup.END_DATE)
                    {
                        UCModalError1.ShowMessageError = "วันที่มีผลบังคับใช้ต้องมากกว่าถึงวันที่";
                        UCModalError1.ShowModalError();
                        return;
                    }
                }
                else
                {
                    conditiongroup.END_DATE = null;
                }

                foreach (GridViewRow item in GvGroup.Rows)
                {
                    subject.Add(new DTO.Subjectr
                    {
                        LICENSE_TYPE_CODE = ddlType.SelectedValue,
                        SUBJECT_CODE      = ((Label)(item.FindControl("lblSubjectCode"))).Text,
                        MAX_SCORE         = ((Label)(item.FindControl("lblMaxScore"))).Text.ToShort(),
                        GROUP_ID          = ((Label)(item.FindControl("lblGroup"))).Text.ToDecimal()
                    });
                }
                conditiongroup.Subject = subject;
                var res = biz.AddExamGroup(conditiongroup);
                if (res.ErrorMsg == null)
                {
                    txtEndDate.Text   = string.Empty;
                    txtStartDate.Text = string.Empty;
                    check.Checked     = false;
                    UCModalSuccess1.ShowMessageSuccess = "บันทึกข้อมูลเรียบร้อย";
                    UCModalSuccess1.ShowModalSuccess();
                    gvSearch.DataSource = biz.GetSubjectGroupSearch(ddlType.SelectedValue, 1, 100).DataResponse;
                    gvSearch.DataBind();

                    txtNote.Text         = "";
                    fieldSubject.Visible = false;
                }
                else
                {
                    if (res.ErrorMsg == "1")
                    {
                        UCModalError1.ShowMessageError = "วันที่มีผลบังคับใช้ต้องมากกว่าหรือเท่ากับหลักสูตรล่าสุด";
                        UCModalError1.ShowModalError();
                    }
                    else if (res.ErrorMsg == "2")
                    {
                        UCModalError1.ShowMessageError = "วันที่มีผลบังคับใช้ต้องน้อยกว่าหรือเท่าถึงวันที่ของหลักสูตรล่าสุด";
                        UCModalError1.ShowModalError();
                    }
                    else
                    {
                        UCModalError1.ShowMessageError = res.ErrorMsg;
                        UCModalError1.ShowModalError();
                    }
                }
            }
        }
Пример #22
0
        private void SaveListExam()
        {
            string       group     = string.Empty;
            ApplicantBiz biz       = new ApplicantBiz();
            string       strAmount = biz.GetQuantityBillPerPageByConfig();

            if (ListApplicant.Count != 0 && ListApplicant.Count <= Convert.ToInt32(strAmount))
            {
                List <DTO.ApplicantTemp> lst = new List <ApplicantTemp>();
                for (int i = 0; i < ListApplicant.Count; i++)
                {
                    DTO.ApplicantTemp app = new ApplicantTemp();
                    app.TESTING_NO      = ListApplicant[i].ExamNumber;
                    app.TESTING_DATE    = ListApplicant[i].ExamDate;
                    app.EXAM_PLACE_CODE = ListApplicant[i].ExamPlaceCode;
                    app.APPLY_DATE      = DateTime.Today;
                    app.INSUR_COMP_CODE = ListApplicant[i].InSurCompCode;
                    app.USER_ID         = UserProfile.Id;     // base.UserId;  140324110012352
                    app.ID_CARD_NO      = UserProfile.IdCard; // base.IdCard;    4199682095940
                    app.APPLY_DATE      = ListApplicant[i].ApplyDate;
                    app.TEST_TIME_CODE  = ListApplicant[i].TestTimeCode;


                    app.RUN_NO = Convert.ToString(i + 1);
                    lst.Add(app);
                }
                string passGroup = string.Empty;

                //Check
                // var checkBeforeSubmit = biz.GeneralValidateApplicantSingleBeforeSubmit(lst);
                //if (checkBeforeSubmit.ResultMessage == true)
                //{
                //    UCModalError1.ShowMessageError = "รอบสอบที่คุณเลือกในรายการมีรายการที่คุณได้สมัครสอบแล้ว";
                //    UCModalError1.ShowModalError();
                //}
                //
                //else
                //{
                var res = biz.InsertSingleApplicant(lst, base.UserId);
                if (res.IsError)
                {
                    UCModalError1.ShowMessageError = res.ErrorMsg;
                    UCModalError1.ShowModalError();
                }
                else
                {
                    ListApplicant = new List <AddApplicant>();
                    this.ModalListExam.Hide();
                    Session["lstApplicant"]            = null;
                    UCModalSuccess1.ShowMessageSuccess = SysMessage.SuccessInsertApplicant;
                    UCModalSuccess1.ShowModalSuccess();
                    group     = res.DataResponse;
                    passGroup = group + " " + base.UserId;

                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "", "OpenPopupSingle('" + passGroup + "')", true);
                }
                //}
            }
            else
            {
                UCModalError1.ShowMessageError = "กรุณาตรวจสอบจำนวนรายการที่สอบ";
                UCModalError1.ShowModalError();
                ModalListExam.Show();
            }
        }