Exemplo n.º 1
0
        protected void btnIdCard_Click(object sender, EventArgs e)
        {
            var biz = new BLL.RegistrationBiz();
            var res = biz.VerifyIdCard(txtIdCard.Text);

            Response.Write(res.ResultMessage + " " + res.ErrorMsg);
        }
        public bool VerifyIdCard(string strIdCard)
        {
            BLL.RegistrationBiz biz = new BLL.RegistrationBiz();
            var res = biz.VerifyIdCard(strIdCard);

            return(res.ResultMessage);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Check สถานะการอนุมัติ
        /// ยังไม่ทำการอนุมัติ(สมัคร) > IS_APPROVE="N" && STATUS=1
        /// และ ไม่อนุมัติ(สมัคร) > IS_APPROVE="N" && STATUS=3
        /// </summary>
        private void StatusInit()
        {
            DTO.UserProfile usrProfile = (DTO.UserProfile)Session[PageList.UserProfile];

            if (usrProfile.IS_APPROVE.Equals("N"))
            {
                ResponseService <Registration> res;
                using (BLL.RegistrationBiz biz = new BLL.RegistrationBiz())
                {
                    res = biz.GetById(this.UserProfile.Id);
                }

                if (!res.IsError)
                {
                    if (res.DataResponse.STATUS == DTO.RegistrationStatus.WaitForApprove.GetEnumValue().ToString())
                    {
                        lblMessage.Text    = this.waitApprove;
                        lblMessage.Visible = true;
                    }
                    else if (res.DataResponse.STATUS == DTO.RegistrationStatus.NotApprove.GetEnumValue().ToString())
                    {
                        lblMessage.Text    = this.notApprove;
                        lblMessage.Visible = true;
                    }
                }
            }
        }
Exemplo n.º 4
0
        private void RegistrationSearch(Int32 pageIndex, Int32 pageSize)
        {
            using (BLL.RegistrationBiz biz = new BLL.RegistrationBiz()) {
                var ls = biz.GetRegistrationsByCriteriaAtPage(txtFirstName.Text,
                                                              txtLastName.Text,
                                                              txtIDCard.Text,
                                                              ddlSearchMemberType.SelectedValue,
                                                              txtEmail.Text,
                                                              "",
                                                              ddlSearchStatus.SelectedValue,
                                                              pageIndex,
                                                              pageSize);


                if (ls.DataResponse != null && ls.DataResponse.DataResponse.Tables.Count > 0)
                {
                    DTO.PagingInfo pageInfo = ls.DataResponse.PagingInfo;


                    gvSearchOfficerOIC.DataSource = ls.DataResponse.DataResponse.Tables[0];

                    gvSearchOfficerOIC.DataBind();
                }
            }
        }
Exemplo n.º 5
0
 private void GetData(Int32 pageIndex)
 {
     BLL.RegistrationBiz biz = new BLL.RegistrationBiz();
     gvSearchOfficerOIC.DataSource = biz.GetRegistrationsByCriteriaAtPage
                                         (txtFirstName.Text, txtLastName.Text, txtIDCard.Text, ddlSearchMemberType.SelectedValue, txtEmail.Text,
                                         "", ddlSearchStatus.SelectedValue, 1, Convert.ToInt32(txtPageSize.Text.Trim())).DataResponse.DataResponse;
     gvSearchOfficerOIC.DataBind();
 }
Exemplo n.º 6
0
 protected void btnSearch_Click(object sender, EventArgs e)
 {
     BLL.RegistrationBiz biz = new BLL.RegistrationBiz();
     gvSearchOfficerOIC.DataSource = biz.GetRegistrationsByCriteriaAtPage
                                         (txtFirstName.Text, txtLastName.Text, txtIDCard.Text, ddlSearchMemberType.SelectedValue, txtEmail.Text,
                                         "", ddlSearchStatus.SelectedValue, 1, Convert.ToInt32(txtPageSize.Text.Trim())).DataResponse.DataResponse;
     gvSearchOfficerOIC.DataBind();
 }
Exemplo n.º 7
0
        private void GetAttatchRegisterationFiles()
        {
            var    biz      = new BLL.RegistrationBiz();
            string personID = UserProfileId;

            DTO.ResponseService <DTO.RegistrationAttatchFile[]> res = biz.GetAttatchFilesByRegisterationID(personID);

            var list = res.DataResponse.ToList();

            this.MasterPage.AttachFileControl.AttachFiles = list.ConvertToAttachFilesView();
        }
Exemplo n.º 8
0
        public override void Save()
        {
            BLL.RegistrationBiz biz = new BLL.RegistrationBiz();



            using (RegistrationService.RegistrationServiceClient svc = new RegistrationService.RegistrationServiceClient())
            {
                DTO.ResponseService <DTO.Registration> res = new DTO.ResponseService <DTO.Registration>();
                switch (StateStatus)
                {
                case IAS.BLL.RegistrationIAS.States.RegistrationStatus.NewRegisteration:
                    if (this.StateStatus == States.RegistrationStatus.NewRegisteration)
                    {
                        UploadAttachFiles();
                        res = svc.InsertWithAttatchFile(DTO.RegistrationType.General,
                                                        this.ConvertToDTORegisteration(),
                                                        this.AttachFiles.ConvertToRegistrationAttachFiles().ToArray());
                    }
                    break;

                case IAS.BLL.RegistrationIAS.States.RegistrationStatus.WaitForApprove:
                    break;

                case IAS.BLL.RegistrationIAS.States.RegistrationStatus.Approve:
                    break;

                case IAS.BLL.RegistrationIAS.States.RegistrationStatus.Disapprove:
                    break;

                case IAS.BLL.RegistrationIAS.States.RegistrationStatus.WaitForApproveEdit:
                    break;

                case IAS.BLL.RegistrationIAS.States.RegistrationStatus.ApproveEdit:
                    break;

                case IAS.BLL.RegistrationIAS.States.RegistrationStatus.DisapproveEdit:
                    break;

                case IAS.BLL.RegistrationIAS.States.RegistrationStatus.Cancel:
                    break;

                default:
                    break;
                }



                if (res.IsError)
                {
                    throw new RegistrationException(res.ErrorMsg);
                }
            }
        }
Exemplo n.º 9
0
        public DTO.ResponseMessage <bool> EMailValidation()
        {
            //var res = new DTO.ResponseMessage<bool>();
            BLL.RegistrationBiz biz = new BLL.RegistrationBiz();
            DTO.Registration    ent = new Registration();
            ent.ID_CARD_NO  = txtIDNumber.Text;
            ent.MEMBER_TYPE = ((int)DTO.MemberType.General).ToString();
            ent.NAMES       = txtFirstName.Text;
            ent.LASTNAME    = txtLastName.Text;
            ent.EMAIL       = txtEmail.Text;
            DTO.ResponseMessage <bool> res = biz.EntityValidation(DTO.RegistrationType.General, ent);
            //DTO.ResponseMessage<bool> res = biz.EntityValidation(DTO.RegistrationType.General, GetRegistrationFromDataControl());

            return(res);
        }
Exemplo n.º 10
0
        public DTO.ResponseMessage <bool> EMailValidation()
        {
            //var res = new DTO.ResponseMessage<bool>();
            BLL.RegistrationBiz biz = new BLL.RegistrationBiz();
            DTO.Registration    ent = new Registration();
            ent.ID_CARD_NO  = txtIDCard.Text;
            ent.MEMBER_TYPE = DTO.MemberType.Association.GetEnumValue().ToString();
            ent.NAMES       = txtFirstName.Text;
            ent.LASTNAME    = txtLastName.Text;
            ent.EMAIL       = txtEmail.Text;
            DTO.ResponseMessage <bool> res = biz.EntityValidation(DTO.RegistrationType.Association, ent);
            //DTO.ResponseMessage<bool> res = biz.EntityValidation(DTO.RegistrationType.Association, GetAsscoEntity());

            return(res);
        }
Exemplo n.º 11
0
        private void GetLastReteration()
        {
            BLL.RegistrationBiz regBiz = new BLL.RegistrationBiz();
            var res = regBiz.GetById(this.MasterPage.UserProfile.Id);

            if (res.IsError)
            {
                this.MasterPage.ModelError.ShowMessageError = res.ErrorMsg;
                this.MasterPage.ModelError.ShowModalError();
            }
            this.MasterPage.RegistrationId = res.DataResponse.ID;

            //Get Data to Control
            GetLoadDataToControl(res.DataResponse);
        }
Exemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BLL.RegistrationBiz biz = new BLL.RegistrationBiz();
                DTO.ResponseService <DTO.PagingResponse <DataSet> > res = biz.GetRegistrationsByCriteriaAtPage("", "", "", "", "", "", "2", 1, 12);

                gvSearchOfficerOIC.DataSource = res.DataResponse.DataResponse;

                PagingInfo = res.DataResponse.PagingInfo;

                gvSearchOfficerOIC.DataBind();
                GetSearchOICType();
                GetSearchStatus();
            }
        }
Exemplo n.º 13
0
        public override void Save()
        {
            BLL.RegistrationBiz biz = new BLL.RegistrationBiz();

            UploadAttachFiles();

            using (RegistrationService.RegistrationServiceClient svc = new RegistrationService.RegistrationServiceClient())
            {
                DTO.ResponseService <DTO.Registration> res = svc.InsertWithAttatchFile(DTO.RegistrationType.General,
                                                                                       this.ConvertToDTORegisteration(),
                                                                                       this.AttachFiles.ConvertToRegistrationAttachFiles().ToArray());
                if (res.IsError)
                {
                    throw new RegistrationException(res.ErrorMsg);
                }
            }
        }
Exemplo n.º 14
0
        private void GetAttatchFiles()
        {
            ResponseService <RegistrationAttatchFile[]> res;
            string personID = this.UserProfile.Id;

            using (BLL.RegistrationBiz biz = new BLL.RegistrationBiz())
            {
                res = biz.GetAttatchFilesByRegisterationID(this.RegisterationID);
            }


            List <RegistrationAttatchFile> list = res.DataResponse.ToList();


            ucAttachFileControl1.AttachFiles = list.ConvertToAttachFilesView();

            UpdatePanelUpload.Update();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                RegistrationId = "130924103253839";

                ucAttachFileControl1.RegisterationId = "130924103253839";

                BLL.RegistrationBiz biz = new BLL.RegistrationBiz();

                DTO.ResponseService <DTO.RegistrationAttatchFile[]> res = biz.GetAttatchFilesByRegisterationID(RegistrationId);

                GetAttachFilesType();

                var list = res.DataResponse.ToList();

                ucAttachFileControl1.AttachFiles = list.ConvertToAttachFilesView();
            }
        }
Exemplo n.º 16
0
        protected void BindPage()
        {
            var resultPage = txtNumberGvSearch.Text.ToInt();

            BLL.RegistrationBiz biz = new BLL.RegistrationBiz();
            var res = biz.GetRegistrationsByCriteria(txtFirstName.Text,
                                                     txtLastName.Text,
                                                     null,
                                                     null,
                                                     txtIDCard.Text,
                                                     ddlSearchMemberType.SelectedValue,
                                                     txtEmail.Text,
                                                     "",
                                                     ddlSearchStatus.SelectedValue,
                                                     resultPage,
                                                     PAGE_SIZE, "2");



            gvSearchOfficerOIC.DataSource = res.DataResponse;
            gvSearchOfficerOIC.DataBind();
        }
Exemplo n.º 17
0
        private void EnableControl(Boolean IsEnable)
        {
            foreach (Control item in udpDetailAssoc.Controls[0].Controls)
            {
                if (item.GetType() == typeof(TextBox))
                {
                    ((TextBox)item).Enabled = IsEnable;
                }
                else if (item.GetType() == typeof(DropDownList))
                {
                    ((DropDownList)item).Enabled = IsEnable;
                }
                else if (item.GetType() == typeof(CheckBox))
                {
                    ((CheckBox)item).Enabled = IsEnable;
                }
                else if (item.GetType() == typeof(RadioButtonList))
                {
                    ((RadioButtonList)item).Enabled = IsEnable;
                }
            }
            this.UcAddress.Enabled(IsEnable);
            udpDetailAssoc.Update();

            //Get Status after edit data for disable control
            ResponseService <Registration> res;

            using (BLL.RegistrationBiz biz = new BLL.RegistrationBiz())
            {
                //??
                //res = biz.GetById(this.MasterPage.UserProfile.Id);
                res = biz.GetById(this.MasterPage.RegistrationId);
            }

            string Mode = Request.QueryString["Mode"];

            if (Mode.Equals("E") &&
                res.DataResponse.STATUS.Equals(DTO.RegistrationStatus.NotApprove.GetEnumValue().ToString()))
            {
                Session["Status"]               = this.MasterPage.NullableString(res.DataResponse.STATUS);
                txtAssociation.Enabled          = false;
                txtAssociationRegister.Enabled  = false;
                txtIDCard.Enabled               = false;
                MasterPage.PNLAddButton.Visible = true;
                MasterPage.PNLAddButton.Enabled = true;
                txtEmail.Enabled = false;
                this.MasterPage.AttachFileControl.EnableGridView(true);
                this.MasterPage.AttachFileControl.EnableUpload(true);
            }
            else if (Mode.Equals("E") &&
                     res.DataResponse.STATUS.Equals(DTO.RegistrationStatus.WaitForApprove.GetEnumValue().ToString()))
            {
                Session["Status"]               = this.MasterPage.NullableString(res.DataResponse.STATUS);
                txtAssociation.Enabled          = false;
                txtAssociationRegister.Enabled  = false;
                txtIDCard.Enabled               = false;
                MasterPage.PNLAddButton.Visible = false;
                MasterPage.PNLAddButton.Enabled = false;
                txtEmail.Enabled = false;
                this.MasterPage.AttachFileControl.EnableGridView(false);
                this.MasterPage.AttachFileControl.EnableUpload(false);
            }
            else
            {
                Session["Status"]              = this.MasterPage.NullableString(res.DataResponse.STATUS);
                txtAssociation.Enabled         = IsEnable;
                txtAssociationRegister.Enabled = IsEnable;
                txtIDCard.Enabled              = IsEnable;
                txtEmail.Enabled = IsEnable;
                this.MasterPage.AttachFileControl.EnableGridView(false);
                this.MasterPage.AttachFileControl.EnableUpload(false);
            }

            //this.MasterPage.GetCurrentLicense(this.ucCurrentLicense, res.DataResponse.ID_CARD_NO);
        }
Exemplo n.º 18
0
        protected void btnOk_Click(object sender, EventArgs e)
        {
            BLL.RegistrationBiz biz       = new BLL.RegistrationBiz();
            BLL.PersonBiz       bizPerson = new BLL.PersonBiz();

            var     detail = biz.GetRegistrationsByCriteria(txtFirstName.Text, txtLastName.Text, null, null, txtIDNumber.Text, null, txtEmail.Text, null, Session["RegStatus"].ToString(), 1, 20, "2");
            DataSet ds     = detail.DataResponse;

            #region Get MemberType From Control @Nattapong
            string RegMemType = string.Empty;
            if (txtMemberType.Text != "")
            {
                switch (txtMemberType.Text)
                {
                case "บุคคลทั่วไป":
                    RegMemType = Convert.ToString((int)DTO.MemberType.General.GetEnumValue());
                    break;

                case "บุคคลทั่วไป/ตัวแทน/นายหน้า":
                    RegMemType = Convert.ToString((int)DTO.MemberType.General.GetEnumValue());
                    break;

                case "บริษัทประกัน":
                    RegMemType = Convert.ToString((int)DTO.MemberType.Insurance.GetEnumValue());
                    break;

                case "บริษัท":
                    RegMemType = Convert.ToString((int)DTO.MemberType.Insurance.GetEnumValue());
                    break;

                case "สมาคม":
                    RegMemType = Convert.ToString((int)DTO.MemberType.Association.GetEnumValue());
                    break;
                }
            }

            #endregion

            if (ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];

                var id = dt.AsEnumerable().Select(s => s.Field <string>("ID"));

                List <string> ls = new List <string>();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string strID = Convert.ToString(dt.Rows[i]["ID"]);
                    ls.Add(strID);
                }

                if (ddlStatusApproval.SelectedValue.Equals("2"))
                {
                    //var res = biz.RegistrationApprove(ls, "อนุมัติกลุ่ม");
                    string userid = UserProfile.Id;
                    var    res    = biz.RegistrationApprove(ls, txtResultReg.Text, userid, RegMemType);
                    if (res.IsError)
                    {
                        UCModalError1.ShowMessageError = res.ErrorMsg;
                        UCModalError1.ShowModalError();
                    }
                    else
                    {
                        //UCModalSuccess.ShowMessageSuccess = "ทำรายการเรียบร้อย";
                        //UCModalSuccess.ShowModalSuccess();
                        ////Response.Redirect("~/Register/regSearchOfficerOIC.aspx");
                        //btnOk.Enabled = false;
                        //btnCancel.Text = "ย้อนกลับ";
                        string AlertSussuss = String.Format("alert('{0}');window.location.assign('../Register/regSearchOfficerOIC.aspx?Back=R')", SysMessage.SaveSucess);
                        ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", AlertSussuss, true);
                    }
                }
                else if (ddlStatusApproval.SelectedValue.Equals("3"))
                {
                    //string userid = UserProfile.Id;
                    string userid = Session["PersonalIDCard"].ToString();
                    var    res    = biz.RegistrationNotApprove(ls, txtResultReg.Text.ToString(), userid);
                    if (res.IsError)
                    {
                        UCModalError1.ShowMessageError = res.ErrorMsg;
                        UCModalError1.ShowModalError();
                    }
                    else
                    {
                        //UCModalSuccess.ShowMessageSuccess = "ทำรายการเรียบร้อย";
                        //UCModalSuccess.ShowModalSuccess();
                        ////Response.Redirect("~/Register/regSearchOfficerOIC.aspx");
                        //btnOk.Enabled = false;
                        //btnCancel.Text = "ย้อนกลับ";
                        string AlertSussuss = String.Format("alert('{0}');window.location.assign('../Register/regSearchOfficerOIC.aspx?Back=R')", SysMessage.SaveSucess);
                        ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", AlertSussuss, true);
                    }
                }

                else if (ddlStatusApproval.SelectedValue.Equals(""))
                {
                    UCModalError1.ShowMessageError = Resources.errorEdit_Reg_Person_004;
                    UCModalError1.ShowModalError();
                }
            }
        }
Exemplo n.º 19
0
        private void GetRegistrationDetail()
        {
            var    biz      = new BLL.RegistrationBiz();
            var    dbiz     = new BLL.DataCenterBiz();
            string personID = this.PersonID;
            var    res      = biz.GetById(personID);
            var    comp     = string.Empty;

            if (!string.IsNullOrEmpty(res.DataResponse.COMP_CODE))
            {
                if (res.DataResponse.MEMBER_TYPE.Equals(DTO.MemberType.Association.GetEnumValue().ToString()))
                {
                    DTO.ResponseService <DTO.ASSOCIATION> getass = dbiz.GetInsuranceAssociateNameByID(res.DataResponse.COMP_CODE);
                    if (getass.DataResponse != null)
                    {
                        comp = getass.DataResponse.ASSOCIATION_NAME;
                    }
                    //DTO.ResponseService<string> cc = dbiz.GetAssociateNameById(res.DataResponse.COMP_CODE);
                    //comp = cc.DataResponse.ToString();
                    //string dd = dbiz.GetAssociateNameById(res.DataResponse.COMP_CODE).ToString();
                }
                else
                {
                    comp = dbiz.GetCompanyNameById(res.DataResponse.COMP_CODE);
                }
            }
            if (res != null)
            {
                this.PersonalStatus = res.DataResponse.STATUS;
                int title = Convert.ToInt32(res.DataResponse.PRE_NAME_CODE);
                GetTitleAfter(title);
                if (res.DataResponse.MEMBER_TYPE != null)
                {
                    if (res.DataResponse.MEMBER_TYPE == "2")
                    {
                        txtMemberType.Text      = Resources.propReg_Co_MemberTypeCompany;
                        lblTitleType.Text       = Resources.propregApproveCompany_001;
                        lblTitletypePerson.Text = Resources.propregApproveCompany_002;
                        lblCompanyRegister.Text = Resources.propregApproveCompany_003;
                        lblRegister.Text        = "ลงทะเบียน " + Resources.propReg_Co_MemberTypeCompany + " (อนุมัติ)";
                        lblCompany.Text         = Resources.propReg_Co_MemberTypeCompany;
                    }
                    else if (res.DataResponse.MEMBER_TYPE == "3")
                    {
                        txtMemberType.Text      = Resources.propReg_Assoc_MemberTypeAssoc;
                        lblTitleType.Text       = Resources.propregApproveCompany_004;
                        lblTitletypePerson.Text = Resources.propregApproveCompany_005;
                        lblCompanyRegister.Text = Resources.propregApproveCompany_006;
                        lblRegister.Text        = "ลงทะเบียน " + Resources.propReg_Assoc_MemberTypeAssoc + " (อนุมัติ)";
                        lblCompany.Text         = Resources.propReg_Assoc_MemberTypeAssoc;
                    }
                }
                else
                {
                    //txtTypeMemberBeforeReg.Text = "-";
                }
                if (comp != null)
                {
                    txtCompany.Text = comp;
                }
                else
                {
                    txtCompany.Text = "-";
                }

                if (res.DataResponse.COMP_CODE != null)
                {
                    txtCompanyRegister.Text = res.DataResponse.COMP_CODE;
                }
                else
                {
                    txtCompanyRegister.Text = "-";
                }

                if (res.DataResponse.NAMES != null)
                {
                    txtFirstName.Text = res.DataResponse.NAMES;
                }
                else
                {
                    txtFirstName.Text = "-";
                }

                if (res.DataResponse.LASTNAME != null)
                {
                    txtLastName.Text = res.DataResponse.LASTNAME;
                }
                else
                {
                    txtLastName.Text = "-";
                }

                if (res.DataResponse.SEX != null)
                {
                    rblSex.SelectedValue = res.DataResponse.SEX;
                }
                else
                {
                    rblSex.SelectedIndex = 0;
                }

                if (res.DataResponse.ID_CARD_NO != null)
                {
                    txtIDNumber.Text = res.DataResponse.ID_CARD_NO;
                }
                else
                {
                    txtIDNumber.Text = "-";
                }



                if (res.DataResponse.EMAIL != null)
                {
                    txtEmail.Text = res.DataResponse.EMAIL;
                }
                else
                {
                    txtEmail.Text = "-";
                }

                if (res.DataResponse.LOCAL_TELEPHONE != null)
                {
                    txtCompanyTel.Text    = txtCompanyTel.Text = LocalTelephoneNumberHelper.GetPhoneNumber(res.DataResponse.LOCAL_TELEPHONE);
                    txtCompanyTelExt.Text = LocalTelephoneNumberHelper.GetExtenNumber(res.DataResponse.LOCAL_TELEPHONE);
                }
                else
                {
                    txtCompanyTel.Text = "-";
                }

                if (res.DataResponse.TELEPHONE != null)
                {
                    txtTel.Text    = LocalTelephoneNumberHelper.GetPhoneNumber(res.DataResponse.TELEPHONE);
                    txtTelExt.Text = LocalTelephoneNumberHelper.GetExtenNumber(res.DataResponse.TELEPHONE);
                }
                else
                {
                    txtTel.Text = "-";
                }
                if (res.DataResponse.ADDRESS_1 != null)
                {
                    txtAddress.Text = res.DataResponse.ADDRESS_1;
                }
                else
                {
                    txtAddress.Text = "-";
                }

                string province = res.DataResponse.PROVINCE_CODE;
                GetProvinceCurrentAddressBefore(province);

                string ampur = res.DataResponse.AREA_CODE;
                GetAmpurCurrentAddressBefore(province, ampur);

                string tumbon = res.DataResponse.TUMBON_CODE;
                GetTumbonCurrentAddressBefore(province, ampur, tumbon);

                if (res.DataResponse.LOCAL_ADDRESS1 != null)
                {
                    //txtRegisterAddressBeforeReg.Text = res.DataResponse.LOCAL_ADDRESS1;
                }
                else
                {
                    // txtRegisterAddressBeforeReg.Text = "-";
                }


                string localProvince = res.DataResponse.LOCAL_PROVINCE_CODE;
                // GetProvinceRegisterAddressBefore(localProvince);

                string localampur = res.DataResponse.LOCAL_AREA_CODE;
                //GetAmpurRegisterAddressBefore(localProvince, localampur);

                string localtumbon = res.DataResponse.LOCAL_TUMBON_CODE;
                // GetTumbonRegisterAddressBefore(localProvince, localampur, localtumbon);

                //Add new 28/8/2556
                if (res.DataResponse.ZIP_CODE != null)
                {
                    //txtPostcodeRegisterAddress.Enabled = false;
                    txtPost.Text = res.DataResponse.ZIP_CODE;
                }
                else//milk
                {
                    //txtPostcodeCurrentAddress.Text = "-";
                }

                if (res.DataResponse.LOCAL_ZIPCODE != null)
                {
                    //txtPostcodeCurrentAddress.Enabled = false;

                    //txtPostcodeRegisterAddress.Text = res.DataResponse.LOCAL_ZIPCODE;
                }
                else//milk
                {
                    //txtPostcodeRegisterAddress.Text = "-";
                }

                txtResultReg.Text = res.DataResponse.APPROVE_RESULT;
            }

            if (res.IsError)
            {
                //UCModalError.ShowMessageError = res.ErrorMsg;
                //UCModalError.ShowModalError();
            }
        }
Exemplo n.º 20
0
        private void NewRegister()
        {
            if (MasterPage.AgreementStatus)
            {
                DTO.Registration general = new DTO.Registration();



                //var attachFiles = this.AttachFiles;
                //var personAttachFiles = this.PersonAttachFiles;
                general.ID                  = IAS.BLL.Helpers.GenerateIdHelper.GetGenAutoId();
                general.ID_CARD_NO          = txtIDNumber.Text;
                general.PRE_NAME_CODE       = ddlTitle.SelectedValue;
                general.NAMES               = txtFirstName.Text;
                general.LASTNAME            = txtLastName.Text;
                general.ID_CARD_NO          = txtIDNumber.Text;
                general.BIRTH_DATE          = Convert.ToDateTime(txtBirthDay.Text);
                general.SEX                 = rblSex.SelectedValue;
                general.NATIONALITY         = ddlNationality.SelectedValue;
                general.EDUCATION_CODE      = ddlEducation.SelectedValue;
                general.EMAIL               = txtEmail.Text;
                general.LOCAL_TELEPHONE     = txtTel.Text;
                general.TELEPHONE           = txtMobilePhone.Text;
                general.ADDRESS_1           = ucAddressCurrent.Address;        // txtCurrentAddress.Text;
                general.PROVINCE_CODE       = ucAddressCurrent.ProvinceValue;  // ddlProvinceCurrentAddress.SelectedValue;
                general.AREA_CODE           = ucAddressCurrent.DistrictValue;  // ddlDistrictCurrentAddress.SelectedValue;
                general.TUMBON_CODE         = ucAddressCurrent.ParishValue;    // ddlParishCurrentAddress.SelectedValue;
                general.ZIP_CODE            = ucAddressCurrent.PostCode;       // txtPostcodeCurrentAddress.Text;
                general.LOCAL_ADDRESS1      = ucAddressRegister.Address;       // txtRegisterAddress.Text;
                general.LOCAL_PROVINCE_CODE = ucAddressRegister.ProvinceValue; // ddlProvinceRegisterAddress.SelectedValue;
                general.LOCAL_AREA_CODE     = ucAddressRegister.DistrictValue; // ddlDistrictRegisterAddress.SelectedValue;
                general.LOCAL_TUMBON_CODE   = ucAddressRegister.ParishValue;   // ddlParishRegisterAddress.SelectedValue;
                general.LOCAL_ZIPCODE       = ucAddressRegister.PostCode;      // txtPostcodeRegisterAddress.Text;
                general.CREATED_BY          = "agdoi";
                general.CREATED_DATE        = DateTime.Now;
                general.UPDATED_BY          = "agdoi";
                general.UPDATED_DATE        = DateTime.Now;
                general.REG_PASS            = MasterPage.Password;

                if (MasterPage.Password != MasterPage.ConfirmPassword)
                {
                    MasterPage.ModelError.ShowMessageError = SysMessage.NotSame;
                    MasterPage.ModelError.ShowModalError();
                    return;
                }


                BLL.RegistrationBiz biz = new BLL.RegistrationBiz();
                var result = biz.ValidateBeforeSubmit(DTO.RegistrationType.General, general);

                //    else
                //    {
                //        //AlertMessage.ShowAlertMessage(string.Empty, SysMessage.NotSame);



                //    }


                //    if (item != null)
                //    {



                //        if (result.IsError)
                //        {
                //            UCModalError.ShowMessageError = result.ErrorMsg;
                //            UCModalError.ShowModalError();
                //        }
                //        else
                //        {
                //            if (this.DataAction == DTO.DataActionMode.Add)
                //            {
                //                try
                //                {
                //                    List<DTO.RegistrationAttatchFile> attachFileList = ucAttachFiles.AttachFiles.ConvertToRegistrationAttachFiles().ToList();
                //                    attachFileList.ForEach(a => a.FILE_STATUS = BLL.AttachFilesIAS.States.AttachFileStatus.Active.Value());

                //                    var res = biz.InsertWithAttatchFile(DTO.RegistrationType.General, item, attachFileList);

                //                    if (res.IsError)
                //                    {
                //                        UCModalError.ShowMessageError = res.ErrorMsg;
                //                        UCModalError.ShowModalError();

                //                        PnlCodition.Visible = false;
                //                        PnlAddButton.Visible = true;
                //                    }
                //                    else
                //                    {

                //                        Session.Remove("TempFolderOracle");
                //                        Session.Remove("AttatchFiles");

                //                        Session.Abandon();

                //                        ClearControl();

                //                        UCModalError.Visible = false;
                //                        UCModalSuccess.Visible = false;
                //                        BLL.DataCenterBiz dbiz = new BLL.DataCenterBiz();
                //                        var r = dbiz.GetConfigApproveMember();

                //                        foreach (var items in r.DataResponse)
                //                        {
                //                            if (items.Id == "01" && items.Value == "Y")
                //                            {
                //                                string AlertWaitingForApprove = "alert('ทำการบันทึกข้อมูลเรียบร้อย รอการอนุมัติการสมัครภายหลัง');window.location.assign('../home.aspx')";
                //                                ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", AlertWaitingForApprove, true);
                //                            }
                //                        }
                //                        string Alert = "alert('ทำการบันทึกข้อมูลเรียบร้อย');window.location.assign('../home.aspx')";
                //                        ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", Alert, true);

                //                    }

                //                }
                //                catch (Exception ex)
                //                {
                //                    UCModalError.ShowMessageError = ex.Message;
                //                    UCModalError.ShowModalError();
                //                }

                //            }

                //        }

                //    }
                //    else
                //    {
                //        UCModalError.ShowMessageError = SysMessage.TryAgain;
                //        UCModalError.ShowModalError();
                //    }
                //}
                //else
                //{
                //    UCModalError.ShowMessageError = SysMessage.CheckCondition;
                //    UCModalError.ShowModalError();
            }
        }
Exemplo n.º 21
0
        private void GetSearchOfficerOIC()
        {
            BLL.RegistrationBiz biz = new BLL.RegistrationBiz();
            var resultPage          = txtNumberGvSearch.Text.ToInt();
            var resCount            = biz.GetRegistrationsByCriteria(txtFirstName.Text,
                                                                     txtLastName.Text,
                                                                     null,
                                                                     null,
                                                                     txtIDCard.Text,
                                                                     ddlSearchMemberType.SelectedValue,
                                                                     txtEmail.Text,
                                                                     "",
                                                                     ddlSearchStatus.SelectedValue,
                                                                     resultPage,
                                                                     PAGE_SIZE, "1");
            DataSet   ds           = resCount.DataResponse;
            DataTable dt           = ds.Tables[0];
            DataRow   dr           = dt.Rows[0];
            int       rowcount     = Convert.ToInt32(dr["rowcount"].ToString());
            double    dblPageCount = (double)((decimal)rowcount / PAGE_SIZE);

            TotalPages        = (int)Math.Ceiling(dblPageCount);
            txtTotalPage.Text = Convert.ToString(TotalPages);
            var res = biz.GetRegistrationsByCriteria(txtFirstName.Text,
                                                     txtLastName.Text,
                                                     null,
                                                     null,
                                                     txtIDCard.Text,
                                                     ddlSearchMemberType.SelectedValue,
                                                     txtEmail.Text,
                                                     "",
                                                     ddlSearchStatus.SelectedValue,
                                                     resultPage,
                                                     PAGE_SIZE, "2");

            if (res.ErrorMsg == null)
            {
                if ((ddlSearchStatus.SelectedValue == DTO.RegistrationStatus.WaitForApprove.GetEnumValue().ToString() ||
                     ddlSearchStatus.SelectedValue == DTO.PersonDataStatus.WaitForApprove.GetEnumValue().ToString()))
                {
                    gvSearchOfficerOIC.DataSource = res.DataResponse.Tables[0];
                    gvSearchOfficerOIC.DataBind();
                    if (gvSearchOfficerOIC.Rows.Count > 0)
                    {
                        for (int i = 0; i < gvSearchOfficerOIC.Rows.Count; i++)
                        {
                            gvSearchOfficerOIC.Columns[0].Visible = true;
                        }
                        btnGroupApprove.Visible = true;
                        if (txtTotalPage.Text == "1")
                        {
                            txtNumberGvSearch.Visible = true;
                            txtTotalPage.Visible      = true;
                            lblspace.Visible          = true;
                        }
                        else
                        {
                            txtTotalPage.Visible      = true;
                            lblspace.Visible          = true;
                            txtNumberGvSearch.Visible = true;
                            btnNextGvSearch.Visible   = true;
                        }
                    }
                }
                else
                {
                    if (gvSearchOfficerOIC.Rows.Count > 0)
                    {
                        gvSearchOfficerOIC.DataSource = res.DataResponse.Tables[0];
                        gvSearchOfficerOIC.DataBind();
                        gvSearchOfficerOIC.Columns[0].Visible = false;
                        btnGroupApprove.Visible = false;
                        if (txtTotalPage.Text == "1")
                        {
                            txtNumberGvSearch.Visible = true;
                            txtTotalPage.Visible      = true;
                            lblspace.Visible          = true;
                        }
                        else
                        {
                            txtTotalPage.Visible      = true;
                            lblspace.Visible          = true;
                            txtNumberGvSearch.Visible = true;
                            btnNextGvSearch.Visible   = true;
                        }
                    }
                }
            }
            else
            {
                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// RegistrationService Update
        /// RegistrationApprove()
        /// By NATTAPONG
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnGroupApprove_Click(object sender, EventArgs e)
        {
            #region Get MemberType From Control @Nattapong
            string RegMemType = string.Empty;
            if (ddlSearchMemberType.SelectedItem.Text != "")
            {
                switch (ddlSearchMemberType.SelectedItem.Text)
                {
                case "บุคคลทั่วไป":
                    RegMemType = Convert.ToString((int)DTO.MemberType.General.GetEnumValue());
                    break;

                case "บุคคลทั่วไป/ตัวแทน/นายหน้า":
                    RegMemType = Convert.ToString((int)DTO.MemberType.General.GetEnumValue());
                    break;

                case "บริษัทประกัน":
                    RegMemType = Convert.ToString((int)DTO.MemberType.Insurance.GetEnumValue());
                    break;

                case "บริษัท":
                    RegMemType = Convert.ToString((int)DTO.MemberType.Insurance.GetEnumValue());
                    break;

                case "สมาคม":
                    RegMemType = Convert.ToString((int)DTO.MemberType.Association.GetEnumValue());
                    break;
                }
            }

            #endregion

            for (int i = 0; i < gvSearchOfficerOIC.Rows.Count; i++)
            {
                CheckBox      chkSelect = (CheckBox)gvSearchOfficerOIC.Rows[i].FindControl("chkSelect");
                List <string> ls        = new List <string>();

                if (chkSelect != null)
                {
                    if (chkSelect.Checked)
                    {
                        //string strID = gvSearchOfficerOIC.Rows[i].Cells[2].Text;
                        Label  lbl   = (Label)gvSearchOfficerOIC.Rows[i].FindControl("lblID");
                        string strID = lbl.Text;
                        if (!string.IsNullOrEmpty(strID))
                        {
                            ls.Add(strID);
                            BLL.RegistrationBiz biz = new BLL.RegistrationBiz();
                            string userid           = UserProfile.Id;
                            var    res = biz.RegistrationApprove(ls, "อนุมัติกลุ่ม", userid, RegMemType);
                            if (!string.IsNullOrEmpty(res.ErrorMsg))
                            {
                                UCModalError.ShowMessageError = Resources.errorReg_OIC_Search_001;
                                UCModalError.ShowModalError();
                            }
                            else
                            {
                                UCModalError.ShowMessageError = Resources.errorReg_OIC_Search_002;
                                UCModalError.ShowModalError();
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 23
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (chkCodition.Checked)
            {
                btnSubmit.Enabled = true;

                if (!ValidDateInput())
                {
                    return;
                }

                Registration item = new Registration();

                var attachFiles = this.AttachFiles;

                item.ID = this.UserID;

                item.MEMBER_TYPE = this.MememberTypeGuest;

                item.ID_CARD_NO          = txtIDNumber.Text;
                item.PRE_NAME_CODE       = ddlTitle.SelectedValue;
                item.NAMES               = txtFirstName.Text;
                item.LASTNAME            = txtLastName.Text;
                item.ID_CARD_NO          = txtIDNumber.Text;
                item.BIRTH_DATE          = Convert.ToDateTime(txtBirthDay.Text);
                item.SEX                 = rblSex.SelectedValue;
                item.NATIONALITY         = ddlNationality.SelectedValue;
                item.EDUCATION_CODE      = ddlEducation.SelectedValue;
                item.EMAIL               = txtEmail.Text;
                item.LOCAL_TELEPHONE     = txtTel.Text;
                item.TELEPHONE           = txtMobilePhone.Text;
                item.ADDRESS_1           = txtCurrentAddress.Text;
                item.PROVINCE_CODE       = ddlProvinceCurrentAddress.SelectedValue;
                item.AREA_CODE           = ddlDistrictCurrentAddress.SelectedValue;
                item.TUMBON_CODE         = ddlParishCurrentAddress.SelectedValue;
                item.ZIP_CODE            = txtPostcodeCurrentAddress.Text;
                item.LOCAL_ADDRESS1      = txtRegisterAddress.Text;
                item.LOCAL_PROVINCE_CODE = ddlProvinceRegisterAddress.SelectedValue;
                item.LOCAL_AREA_CODE     = ddlDistrictRegisterAddress.SelectedValue;
                item.LOCAL_TUMBON_CODE   = ddlParishRegisterAddress.SelectedValue;
                item.LOCAL_ZIPCODE       = txtPostcodeRegisterAddress.Text;
                item.CREATED_BY          = "123";
                item.CREATED_DATE        = DateTime.Now;
                item.UPDATED_BY          = "123";
                item.UPDATED_DATE        = DateTime.Now;
                if (txtPassword.Text == txtConfirmPassword.Text)
                {
                    item.REG_PASSWORD = txtPassword.Text;
                }
                else
                {
                    AlertMessage.ShowAlertMessage(string.Empty, SysMessage.NotSame);
                    return;
                }


                if (item != null)
                {
                    //var res = biz.Insert(item);

                    BLL.RegistrationBiz biz = new BLL.RegistrationBiz();

                    var result = biz.ValidateBeforeSubmit(DTO.RegistrationType.General, item);

                    if (result.IsError)
                    {
                        var errorMsg = result.ErrorMsg;
                        AlertMessage.ShowAlertMessage(string.Empty, errorMsg);
                    }
                    else
                    {
                        if (this.AttachFiles.Count != 0)
                        {
                            foreach (var att in this.AttachFiles)
                            {
                                var      isImage     = att.IsImage;
                                FileInfo f           = new FileInfo(att.ATTACH_FILE_PATH);
                                string   surNameFile = f.Extension;

                                if (isImage)
                                {
                                    var      tempPath    = att.TempFilePath;
                                    string[] arrTempPath = tempPath.Split('/');

                                    var source = Server.MapPath(mapPath + arrTempPath[0] + "/" + arrTempPath[1]);
                                    var target = Server.MapPath(mapPath + txtIDNumber.Text + surNameFile);


                                    System.IO.Directory.Move(source, target);
                                }
                                else
                                {
                                    var      tempPath    = att.TempFilePath;
                                    string[] arrTempPath = tempPath.Split('/');

                                    var source = Server.MapPath(mapPath + arrTempPath[0] + "/" + arrTempPath[1]);
                                    var target = Server.MapPath(mapPath + txtIDNumber.Text + "_" + att.ATTACH_FILE_TYPE + surNameFile);

                                    System.IO.Directory.Move(source, target);
                                }
                            }

                            DirectoryInfo deleteDirectory = new DirectoryInfo(Server.MapPath(mapPath) + this.TempFolderOracle);

                            deleteDirectory.Delete();
                        }

                        var res = biz.InsertWithAttatchFile(DTO.RegistrationType.General, item, attachFiles);

                        //ถ้าเกิด Error อะไรให้มาทำในที่นี่ Tob 12022013
                        if (res.IsError)
                        {
                            //Response.Write(res.ErrorMsg);
                            var errorMsg = res.ErrorMsg;

                            AlertMessage.ShowAlertMessage(string.Empty, errorMsg);
                        }
                        else
                        {
                            Session.Remove("TempFolderOracle");
                            Session.Remove("AttatchFiles");

                            ClearControl();

                            //AlertMessage.ShowAlertMessage(string.Empty, SysMessage.SaveSucess);

                            //string strScript = "<script>" + "alert('ทำการบันทึกข้อมูลเรียบร้อย');";
                            //strScript += "window.location='~/home.aspx';";
                            //strScript += "</script>";
                            //Page.ClientScript.RegisterStartupScript(this.GetType(), "Startup", strScript);

                            ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + Resources.infoSysMessage_RegisSuccess2 + "');window.location.href='home.aspx';", true);
                            //Response.Write("<script>alert('ทำการบันทึกข้อมูลเรียบร้อย');window.location.href='home.aspx';</script>");

                            //Response.Redirect("~/home.aspx");

                            //foreach (var att in attachFiles)
                            //{


                            //    var nameFile = att.ATTACH_FILE_PATH;

                            //    string[] arrNameFile = nameFile.Split('/');

                            //    var source = Server.MapPath(mapPath + arrNameFile[0] + "/" + "_" + arrNameFile[1]);
                            //    var target = Server.MapPath(mapPath + arrNameFile[0] + "/" + arrNameFile[1]);


                            //    System.IO.Directory.Move(source, target);
                            //}
                        }
                    }


                    //ถ้าเกิด Error อะไรให้มาทำในที่นี่ Tob 12022013


                    //Response.Write(detail.ErrorMsg);
                }
                else
                {
                    AlertMessage.ShowAlertMessage(SysMessage.Fail, SysMessage.TryAgain);
                }
            }
            else
            {
                AlertMessage.ShowAlertMessage(string.Empty, SysMessage.CheckCondition);

                btnSubmit.Enabled = false;
            }
        }
Exemplo n.º 24
0
        private void EnableControl(Boolean IsEnable)
        {
            foreach (Control item in UpdatePanelUpload.Controls[0].Controls)
            {
                if (item.GetType() == typeof(TextBox))
                {
                    ((TextBox)item).Enabled = IsEnable;
                }
                else if (item.GetType() == typeof(DropDownList))
                {
                    ((DropDownList)item).Enabled = IsEnable;
                }
                else if (item.GetType() == typeof(CheckBox))
                {
                    ((CheckBox)item).Enabled = IsEnable;
                }
                else if (item.GetType() == typeof(RadioButtonList))
                {
                    ((RadioButtonList)item).Enabled = IsEnable;
                }
            }
            chkCopyAdd.Enabled = IsEnable;
            ucAddressCurrent.Enabled(IsEnable);
            ucAddressRegister.Enabled(IsEnable);
            UpdatePanelUpload.Update();

            //Get Status after edit data for disable control
            ResponseService <Registration> res;

            using (BLL.RegistrationBiz biz = new BLL.RegistrationBiz())
            {
                //??
                //res = biz.GetById(this.MasterPage.UserProfile.Id);
                res = biz.GetById(this.MasterPage.RegistrationId);
            }

            string Mode = Request.QueryString["Mode"];

            if (Mode.Equals("E") && res.DataResponse.STATUS.Equals(DTO.RegistrationStatus.NotApprove.GetEnumValue().ToString()))
            {
                //txtBirthDay.ReadOnly = true; //Edited by Nattapong because of can't get the value while ReadOnly
                Session["Status"]               = this.MasterPage.NullableString(res.DataResponse.STATUS);
                txtIDNumber.Enabled             = false;
                MasterPage.PNLAddButton.Visible = true;
                MasterPage.PNLAddButton.Enabled = true;
                txtEmail.Enabled = false;
                this.MasterPage.AttachFileControl.EnableGridView(true);
                this.MasterPage.AttachFileControl.EnableUpload(true);

                this.pnlIDCardValidate.Enabled = false;
            }
            else if (Mode.Equals("E") && res.DataResponse.STATUS.Equals(DTO.RegistrationStatus.WaitForApprove.GetEnumValue().ToString()))
            {
                txtBirthDay.ReadOnly            = true;
                Session["Status"]               = this.MasterPage.NullableString(res.DataResponse.STATUS);
                txtIDNumber.Enabled             = false;
                MasterPage.PNLAddButton.Visible = false;
                MasterPage.PNLAddButton.Enabled = false;
                txtEmail.Enabled = false;
                this.MasterPage.AttachFileControl.EnableGridView(false);
                this.MasterPage.AttachFileControl.EnableUpload(false);

                //this.chkEnableEditName.Enabled = false;
                this.pnlIDCardValidate.Enabled = false;
            }
            else
            {
                txtBirthDay.ReadOnly = true;
                Session["Status"]    = this.MasterPage.NullableString(res.DataResponse.STATUS);
                txtIDNumber.Enabled  = IsEnable;
                txtEmail.Enabled     = IsEnable;
                this.MasterPage.AttachFileControl.EnableGridView(false);
                this.MasterPage.AttachFileControl.EnableUpload(false);

                this.pnlIDCardValidate.Enabled = false;
            }

            this.MasterPage.GetCurrentLicense(this.ucCurrentLicense, res.DataResponse.ID_CARD_NO);
        }
Exemplo n.º 25
0
        private void InitData()
        {
            ResponseService <Registration> res;

            using (BLL.RegistrationBiz biz = new BLL.RegistrationBiz())
            {
                res = biz.GetById(this.UserProfile.Id);
            }


            if (!res.IsError)
            {
                var registeration = res.DataResponse;

                if (registeration.STATUS == "3")
                {
                    PnlAddButton.Visible = true;
                }
                else
                {
                    PnlAddButton.Visible = false;
                }

                Session["UserID"] = this.UserProfile.Id;

                Session["RegisterationID"] = registeration.ID;

                ucAttachFileControl1.RegisterationId = this.RegisterationID;
                ucAttachFileControl1.CurrentUser     = this.UserProfile.Id;

                ddlTitle.SelectedValue = registeration.PRE_NAME_CODE;
                txtFirstName.Text      = registeration.NAMES;
                txtLastName.Text       = registeration.LASTNAME;
                txtIDNumber.Text       = registeration.ID_CARD_NO;
                txtIDNumber.Enabled    = false;
                //Added By Nattapong @23/8/56
                if (registeration.BIRTH_DATE != null)
                {
                    txtBirthDay.CssClass = "txt";
                    txtBirthDay.Text     = registeration.BIRTH_DATE.Value.ToString("dd/MM/yyyy");
                }
                else
                {
                    txtBirthDay.CssClass = "txt";
                    txtBirthDay.Text     = "-";
                }

                rblSex.SelectedValue = registeration.SEX;
                if (registeration.NATIONALITY != null)
                {
                    ddlNationality.SelectedValue = registeration.NATIONALITY;
                }

                ddlEducation.SelectedValue = registeration.EDUCATION_CODE;
                txtEmail.Text       = registeration.EMAIL;
                txtTel.Text         = registeration.LOCAL_TELEPHONE;
                txtMobilePhone.Text = registeration.TELEPHONE;
                UcCurrentAdd.TextBoxAddress.Text = registeration.ADDRESS_1;

                var message = SysMessage.DefaultSelecting;

                BLL.DataCenterBiz dataCenter = new BLL.DataCenterBiz();
                UcCurrentAdd.DropdownProvince.SelectedValue = registeration.PROVINCE_CODE;
                var lsPC = dataCenter.GetAmpur(message, UcCurrentAdd.DropdownProvince.SelectedValue);
                BindToDDL(UcCurrentAdd.DropdownDistrict, lsPC);

                UcCurrentAdd.DropdownDistrict.SelectedValue = registeration.AREA_CODE;
                var lsTC = dataCenter.GetTumbon(message, UcCurrentAdd.DropdownProvince.SelectedValue, UcCurrentAdd.DropdownDistrict.SelectedValue);
                BindToDDL(UcCurrentAdd.DropdownParish, lsTC);

                UcCurrentAdd.DropdownParish.SelectedValue = registeration.TUMBON_CODE;

                UcCurrentAdd.TextBoxAddress.Text = registeration.ZIP_CODE;
                UcRegisAdd.TextBoxAddress.Text   = registeration.LOCAL_ADDRESS1;

                UcRegisAdd.DropdownProvince.SelectedValue = registeration.LOCAL_PROVINCE_CODE;
                var lsPR = dataCenter.GetAmpur(message, UcRegisAdd.DropdownProvince.SelectedValue);
                BindToDDL(UcRegisAdd.DropdownDistrict, lsPR);

                UcRegisAdd.DropdownDistrict.SelectedValue = registeration.LOCAL_AREA_CODE;
                var lsTR = dataCenter.GetTumbon(message, UcRegisAdd.DropdownProvince.SelectedValue, UcRegisAdd.DropdownDistrict.SelectedValue);
                BindToDDL(UcRegisAdd.DropdownParish, lsTR);

                UcRegisAdd.DropdownParish.SelectedValue = registeration.LOCAL_TUMBON_CODE;

                UcRegisAdd.TextBoxAddress.Text = registeration.LOCAL_ZIPCODE;

                txtResultReg.Text = registeration.APPROVE_RESULT;
            }
            else
            {
                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
        }
Exemplo n.º 26
0
        /// <summary>
        /// ISSUE : http://jira.ar.co.th/browse/IASAR-411
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <EDITOR>Natta</EDITOR>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            DTO.ResponseMessage <bool> res = this.ControlValidationBeforeSubmit(this.Page);
            if ((res.ResultMessage == false) || (res.IsError))
            {
                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
                //return;
                //ControlValidation(RegisGeneral);
                return;
            }

            BLL.RegistrationBiz biz = new BLL.RegistrationBiz();
            Registration        reg = new Registration();

            reg.ID            = IAS.BLL.Helpers.GenerateIdHelper.GetGenAutoId();
            reg.PRE_NAME_CODE = ddlTitle.SelectedValue;
            if (rblSex.SelectedValue == "M")
            {
                reg.SEX = "M";
            }
            else
            {
                reg.SEX = "F";
            }
            reg.NAMES           = txtFirstName.Text;
            reg.LASTNAME        = txtLastName.Text;
            reg.MEMBER_TYPE     = this.MememberTypePlaceGroup;
            reg.COMP_CODE       = ddlPlaceGroup.SelectedValue;
            reg.ID_CARD_NO      = txtIDNumber.Text;
            reg.PRE_NAME_CODE   = ddlTitle.SelectedValue;
            reg.NAMES           = txtFirstName.Text;
            reg.LASTNAME        = txtLastName.Text;
            reg.EMAIL           = txtEmail.Text;
            reg.LOCAL_TELEPHONE = txtPlaceGroupTel.Text;
            reg.TELEPHONE       = txtTel.Text;
            reg.ADDRESS_1       = txtAddress.Text;
            reg.PROVINCE_CODE   = ddlProvince.SelectedValue;
            reg.AREA_CODE       = ddlDistrict.SelectedValue;
            reg.TUMBON_CODE     = ddlParish.SelectedValue;
            reg.ZIP_CODE        = txtPostcode.Text;
            reg.CREATED_BY      = "agdoi";
            reg.CREATED_DATE    = DateTime.Now;
            reg.UPDATED_BY      = "agdoi";
            reg.UPDATED_DATE    = DateTime.Now;
            if (txtPassword.Text == txtPassword.Text)
            {
                //reg.REG_PASSWORD = txtPassword.Text;
                reg.REG_PASS = txtPassword.Text;
            }

            reg.LINK_REDIRECT = Utils.CryptoBase64.Encryption(reg.EMAIL.Trim() + "||" + txtPassword.Text.Trim());
            var attachFiles = this.AttachFiles;
            var result      = biz.InsertWithAttatchFile(DTO.RegistrationType.TestCenter, reg, attachFiles);

            if (result.IsError)
            {
                UCModalError.ShowMessageError = result.ErrorMsg;
                UCModalError.ShowModalError();
                return;
                //Response.Redirect("Reg_Place_Group.aspx");
            }
            else
            {
                UCModalSuccess.ShowMessageSuccess = SysMessage.SuccessInsertTypeGroupPlace;
                UCModalSuccess.ShowModalSuccess();
            }

            Session.Remove("TempFolderOracle");
            Session.Remove("AttatchFiles");
            //Session.Abandon();

            ClearControl();

            UCModalError.Visible   = false;
            UCModalSuccess.Visible = false;

            string Alert = "alert('" + Resources.infoSysMessage_RegisSuccess2 + "');window.location.assign('../Register/Reg_Place_Group.aspx')";

            ToolkitScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Alert, true);

            //string Alert = "alert('"+ Resources.infoSysMessage_RegisSuccess2 +"');window.location.assign('../home.aspx')";
            //ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", Alert, true);
        }
Exemplo n.º 27
0
        /// <summary>
        /// Last Update 15/7/2557
        /// By Natta
        /// </summary>
        private void GetRegistrationDetail()
        {
            var    biz      = new BLL.RegistrationBiz();
            var    dbiz     = new BLL.DataCenterBiz();
            string personID = this.PersonID;
            var    res      = biz.GetById(personID);
            var    comp     = string.Empty;

            if (!string.IsNullOrEmpty(res.DataResponse.COMP_CODE))
            {
                if (res.DataResponse.MEMBER_TYPE.Equals(DTO.MemberType.Association.GetEnumValue().ToString()))
                {
                    //DTO.ResponseService<string> cc = dbiz.GetAssociateNameById(res.DataResponse.COMP_CODE);
                    //comp = cc.DataResponse.ToString();
                    //string dd = dbiz.GetAssociateNameById(res.DataResponse.COMP_CODE).ToString();
                    DTO.ResponseService <DTO.ASSOCIATION> getass = dbiz.GetInsuranceAssociateNameByID(res.DataResponse.COMP_CODE);
                    if (getass.DataResponse != null)
                    {
                        comp = getass.DataResponse.ASSOCIATION_NAME;
                    }
                }
                else
                {
                    comp = dbiz.GetCompanyNameById(res.DataResponse.COMP_CODE);
                }
            }
            if (res.DataResponse != null)
            {
                int title = Convert.ToInt32(res.DataResponse.PRE_NAME_CODE);
                GetTitleAfter(title);
                if (res.DataResponse.MEMBER_TYPE != null)
                {
                    //Add new
                    this.MemberTypeSession = res.DataResponse.MEMBER_TYPE;

                    if (res.DataResponse.MEMBER_TYPE == "1")
                    {
                        txtTypeMemberBeforeReg.Text = Resources.propReg_NotApprove_MemberTypeGeneral;
                        lblStartDate8.Text          = Resources.propEdit_Reg_Person_002;
                    }
                    else if (res.DataResponse.MEMBER_TYPE == "2")
                    {
                        txtTypeMemberBeforeReg.Text = Resources.propReg_Co_MemberTypeCompany;
                        lblStartDate8.Text          = Resources.propregApproveOfficerOIC_001;
                    }
                    else if (res.DataResponse.MEMBER_TYPE == "3")
                    {
                        txtTypeMemberBeforeReg.Text = Resources.propReg_Assoc_MemberTypeAssoc;
                        lblStartDate8.Text          = Resources.propregApproveOfficerOIC_001;
                    }
                }
                else
                {
                    txtTypeMemberBeforeReg.Text = Resources.propregApproveOfficerOIC_002;
                }
                if (comp != null)
                {
                    txtCompanyBeforeReg.Text = comp;
                }
                else
                {
                    txtCompanyBeforeReg.Text = Resources.propregApproveOfficerOIC_002;
                }

                if (res.DataResponse.NAMES != null)
                {
                    txtFirstName.Text = res.DataResponse.NAMES;
                }
                else
                {
                    txtFirstName.Text = Resources.propregApproveOfficerOIC_002;
                }

                if (res.DataResponse.LASTNAME != null)
                {
                    txtLastName.Text = res.DataResponse.LASTNAME;
                }
                else
                {
                    txtLastName.Text = Resources.propregApproveOfficerOIC_002;
                }

                if (res.DataResponse.SEX != null)
                {
                    rblSex.SelectedValue = res.DataResponse.SEX;
                }
                else
                {
                    rblSex.SelectedIndex = 0;
                }

                if (res.DataResponse.ID_CARD_NO != null)
                {
                    txtIDCard.Text = res.DataResponse.ID_CARD_NO;
                }
                else
                {
                    txtIDCard.Text = Resources.propregApproveOfficerOIC_002;
                }
                if (res.DataResponse.BIRTH_DATE != null)
                {
                    txtBirthDay.CssClass = "txt";
                    txtBirthDay.Text     = res.DataResponse.BIRTH_DATE.Value.ToString("dd MMMM yyyy");
                }
                else
                {
                    txtBirthDay.CssClass = "txt";
                    txtBirthDay.Text     = Resources.propregApproveOfficerOIC_002;
                }


                if (res.DataResponse.APPROVE_RESULT != null)
                {
                    txtResultReg.Text = res.DataResponse.APPROVE_RESULT;
                }
                else
                {
                    txtResultReg.Text = "";
                }



                string education = res.DataResponse.EDUCATION_CODE;
                GetEducationBefore(education);

                string Nationality = res.DataResponse.NATIONALITY;
                GetNationalityBefore(Nationality);

                if (res.DataResponse.EMAIL != null)
                {
                    txtEmailBeforeReg.Text = res.DataResponse.EMAIL;
                }
                else
                {
                    txtEmailBeforeReg.Text = Resources.propregApproveOfficerOIC_002;
                }

                if (res.DataResponse.LOCAL_TELEPHONE != null)
                {
                    txtTelBeforeReg.Text = res.DataResponse.LOCAL_TELEPHONE;
                }
                else
                {
                    txtTelBeforeReg.Text = Resources.propregApproveOfficerOIC_002;
                }

                if (res.DataResponse.TELEPHONE != null)
                {
                    txtMobilePhoneBeforeReg.Text = res.DataResponse.TELEPHONE;
                }
                else
                {
                    txtMobilePhoneBeforeReg.Text = Resources.propregApproveOfficerOIC_002;
                }
                if (res.DataResponse.ADDRESS_1 != null)
                {
                    txtCurrentAddressBeforeReg.Text = res.DataResponse.ADDRESS_1;
                }
                else
                {
                    txtCurrentAddressBeforeReg.Text = Resources.propregApproveOfficerOIC_002;
                }

                string province = res.DataResponse.PROVINCE_CODE;
                GetProvinceCurrentAddressBefore(province);

                string ampur = res.DataResponse.AREA_CODE;
                GetAmpurCurrentAddressBefore(province, ampur);

                string tumbon = res.DataResponse.TUMBON_CODE;
                GetTumbonCurrentAddressBefore(province, ampur, tumbon);

                if (res.DataResponse.LOCAL_ADDRESS1 != null)
                {
                    txtRegisterAddressBeforeReg.Text = res.DataResponse.LOCAL_ADDRESS1;
                }
                else
                {
                    txtRegisterAddressBeforeReg.Text = Resources.propregApproveOfficerOIC_002;
                }


                string localProvince = res.DataResponse.LOCAL_PROVINCE_CODE;
                GetProvinceRegisterAddressBefore(localProvince);

                string localampur = res.DataResponse.LOCAL_AREA_CODE;
                GetAmpurRegisterAddressBefore(localProvince, localampur);

                string localtumbon = res.DataResponse.LOCAL_TUMBON_CODE;
                GetTumbonRegisterAddressBefore(localProvince, localampur, localtumbon);

                //Add new 28/8/2556
                if (res.DataResponse.ZIP_CODE != null)
                {
                    //txtPostcodeRegisterAddress.Enabled = false;
                    txtPostcodeCurrentAddress.Text = res.DataResponse.ZIP_CODE;
                }
                else//milk
                {
                    txtPostcodeCurrentAddress.Text = Resources.propregApproveOfficerOIC_002;
                }

                if (res.DataResponse.LOCAL_ZIPCODE != null)
                {
                    //txtPostcodeCurrentAddress.Enabled = false;

                    txtPostcodeRegisterAddress.Text = res.DataResponse.LOCAL_ZIPCODE;
                }
                else//milk
                {
                    txtPostcodeRegisterAddress.Text = Resources.propregApproveOfficerOIC_002;
                }

                // txtResultReg.Text = res.DataResponse.APPROVE_RESULT;

                //if ((res.DataResponse.AGENT_TYPE != null) && (res.DataResponse.AGENT_TYPE != ""))
                //{
                //    ddlAgentType.SelectedValue = res.DataResponse.AGENT_TYPE;

                //}
                //else if ((res.DataResponse.AGENT_TYPE == "") || (res.DataResponse.AGENT_TYPE == null))
                //{
                //    ddlAgentType.Items.Clear();
                //    ddlAgentType.DataSource = null;
                //    ddlAgentType.DataBind();
                //}
            }

            if (res.IsError)
            {
                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
        }
Exemplo n.º 28
0
        private DTO.Registration GetRegistrationFromDataControl()
        {
            DTO.Registration general = new DTO.Registration();

            //var attachFiles = this.AttachFiles;
            //var personAttachFiles = this.PersonAttachFiles;
            general.ID              = MasterPage.RegistrationId;
            general.MEMBER_TYPE     = ((int)DTO.MemberType.General).ToString();
            general.ID_CARD_NO      = txtIDNumber.Text;
            general.PRE_NAME_CODE   = ddlTitle.SelectedValue;
            general.NAMES           = txtFirstName.Text;
            general.LASTNAME        = txtLastName.Text;
            general.ID_CARD_NO      = txtIDNumber.Text;
            general.BIRTH_DATE      = Convert.ToDateTime(txtBirthDay.Text);
            general.SEX             = rblSex.SelectedValue;
            general.NATIONALITY     = ddlNationality.SelectedValue;
            general.EDUCATION_CODE  = ddlEducation.SelectedValue;
            general.EMAIL           = txtEmail.Text;
            general.LOCAL_TELEPHONE = txtTel.Text + ((String.IsNullOrWhiteSpace(txtTelExt.Text)) ? "" : ("#" + txtTelExt.Text.Trim()));;

            general.TELEPHONE           = txtMobilePhone.Text;
            general.ADDRESS_1           = ucAddressCurrent.Address;        // txtCurrentAddress.Text;
            general.PROVINCE_CODE       = ucAddressCurrent.ProvinceValue;  // ddlProvinceCurrentAddress.SelectedValue;
            general.AREA_CODE           = ucAddressCurrent.DistrictValue;  // ddlDistrictCurrentAddress.SelectedValue;
            general.TUMBON_CODE         = ucAddressCurrent.ParishValue;    // ddlParishCurrentAddress.SelectedValue;
            general.ZIP_CODE            = ucAddressCurrent.PostCode;       // txtPostcodeCurrentAddress.Text;
            general.LOCAL_ADDRESS1      = ucAddressRegister.Address;       // txtRegisterAddress.Text;
            general.LOCAL_PROVINCE_CODE = ucAddressRegister.ProvinceValue; // ddlProvinceRegisterAddress.SelectedValue;
            general.LOCAL_AREA_CODE     = ucAddressRegister.DistrictValue; // ddlDistrictRegisterAddress.SelectedValue;
            general.LOCAL_TUMBON_CODE   = ucAddressRegister.ParishValue;   // ddlParishRegisterAddress.SelectedValue;
            general.LOCAL_ZIPCODE       = ucAddressRegister.PostCode;      // txtPostcodeRegisterAddress.Text;
            general.CREATED_BY          = "agdoi";
            general.CREATED_DATE        = DateTime.Now;
            general.UPDATED_BY          = "agdoi";
            general.UPDATED_DATE        = DateTime.Now;
            general.REG_PASS            = MasterPage.Password;

            //get result
            if (!this.MasterPage.ActionMode.Equals(IAS.DTO.DataActionMode.Add))
            {
                BLL.RegistrationBiz regBiz = new BLL.RegistrationBiz();
                var res = regBiz.GetById(general.ID.ToString());
                if (res != null)
                {
                    if (res.DataResponse.APPROVE_RESULT != null)
                    {
                        general.APPROVE_RESULT = res.DataResponse.APPROVE_RESULT;
                    }
                }
            }
            else
            {
                general.APPROVE_RESULT = "";
            }

            //general.AGENT_TYPE = ddlAgentType.SelectedValue;
            //SELECT FROM AG_AGENT_TYPE_R > Z = ตัวแทนและนายหน้า
            general.AGENT_TYPE    = "Z";
            general.IMPORT_STATUS = this.MasterPage.NullableString(this.MasterPage.ImportStatus);

            return(general);
        }
Exemplo n.º 29
0
        protected void btnOkEdit_Click(object sender, EventArgs e)
        {
            //บุคคลธรรมดา
            if (this.UserProfile.MemberType.ToString() == DTO.MemberType.General.GetEnumValue().ToString())
            {
                if (!ValidDateInput())
                {
                    return;
                }

                Registration item = new Registration();

                //var attachFiles = this.AttachFiles;
                //var personAttachFiles = this.PersonAttachFiles;

                item.ID = this.RegisterationID;

                item.MEMBER_TYPE = this.MememberTypeGuest;

                item.ID_CARD_NO          = txtIDNumber.Text;
                item.PRE_NAME_CODE       = ddlTitle.SelectedValue;
                item.NAMES               = txtFirstName.Text;
                item.LASTNAME            = txtLastName.Text;
                item.ID_CARD_NO          = txtIDNumber.Text;
                item.BIRTH_DATE          = Convert.ToDateTime(txtBirthDay.Text);
                item.SEX                 = rblSex.SelectedValue;
                item.NATIONALITY         = ddlNationality.SelectedValue;
                item.EDUCATION_CODE      = ddlEducation.SelectedValue;
                item.EMAIL               = txtEmail.Text;
                item.LOCAL_TELEPHONE     = txtTel.Text;
                item.TELEPHONE           = txtMobilePhone.Text;
                item.ADDRESS_1           = UcCurrentAdd.TextBoxAddress.Text;
                item.PROVINCE_CODE       = UcCurrentAdd.DropdownProvince.SelectedValue;
                item.AREA_CODE           = UcCurrentAdd.DropdownDistrict.SelectedValue;
                item.TUMBON_CODE         = UcCurrentAdd.DropdownParish.SelectedValue;
                item.ZIP_CODE            = UcCurrentAdd.TextBoxPostCode.Text;
                item.LOCAL_ADDRESS1      = UcRegisAdd.TextBoxAddress.Text;
                item.LOCAL_PROVINCE_CODE = UcRegisAdd.DropdownProvince.SelectedValue;
                item.LOCAL_AREA_CODE     = UcRegisAdd.DropdownDistrict.SelectedValue;
                item.LOCAL_TUMBON_CODE   = UcRegisAdd.DropdownParish.SelectedValue;
                item.LOCAL_ZIPCODE       = UcRegisAdd.TextBoxPostCode.Text;
                item.UPDATED_BY          = this.UserID;
                item.UPDATED_DATE        = DateTime.Now;
                item.STATUS              = "1";

                if (item != null)
                {
                    BLL.RegistrationBiz biz = new BLL.RegistrationBiz();

                    var result = biz.ValidateBeforeSubmit(DTO.RegistrationType.General, item);

                    if (result.IsError)
                    {
                        UCModalError.ShowMessageError = result.ErrorMsg;
                        UCModalError.ShowModalError();
                    }
                    else
                    {
                        if (this.DataAction == DTO.DataActionMode.Edit)
                        {
                            try
                            {
                                var res = biz.Update(item, ucAttachFileControl1.AttachFiles.ConvertToRegistrationAttachFiles().ToList());

                                if (res.IsError)
                                {
                                    UCModalError.ShowMessageError = res.ErrorMsg;
                                    UCModalError.ShowModalError();
                                }
                                else
                                {
                                    Session.Remove("AttatchFiles");

                                    Session.Abandon();

                                    ClearControl();

                                    UCModalError.Visible   = false;
                                    UCModalSuccess.Visible = false;
                                    BLL.DataCenterBiz dbiz = new BLL.DataCenterBiz();
                                    var r = dbiz.GetConfigApproveMember();
                                    foreach (var items in r.DataResponse)
                                    {
                                        if (items.Id == "01" && items.Value == "Y")
                                        {
                                            string AlertWaitingForApprove = "alert('" + Resources.infoSysMessage_EditSuccess + "');window.location.assign('../home.aspx')";
                                            ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", AlertWaitingForApprove, true);
                                        }
                                    }
                                    string Alert = "alert('" + Resources.infoSysMessage_RegisSuccess2 + "');window.location.assign('../home.aspx')";
                                    ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", Alert, true);
                                }
                            }
                            catch (Exception ex)
                            {
                                UCModalError.ShowMessageError = ex.Message;
                                UCModalError.ShowModalError();
                            }
                        }
                    }
                }
            }
            //บริษัท ยังไม่แยก Methodเฉพาะ > var result = biz.ValidateBeforeSubmit(DTO.RegistrationType.Insurance, item);
            else if (this.UserProfile.MemberType.ToString() == DTO.MemberType.Insurance.GetEnumValue().ToString())
            {
                //if (!ValidDateInput())
                //{
                //    return;
                //}

                Registration item = new Registration();

                //var attachFiles = this.AttachFiles;
                //var personAttachFiles = this.PersonAttachFiles;

                item.COMP_CODE = this.UserProfile.CompCode;

                item.ID = this.RegisterationID;

                item.MEMBER_TYPE = this.MememberTypeGuest;

                item.ID_CARD_NO    = txtIDNumber.Text;
                item.PRE_NAME_CODE = ddlTitle.SelectedValue;
                item.NAMES         = txtFirstName.Text;
                item.LASTNAME      = txtLastName.Text;
                item.ID_CARD_NO    = txtIDNumber.Text;
                //item.BIRTH_DATE = Convert.ToDateTime(txtBirthDay.Text);
                item.SEX         = rblSex.SelectedValue;
                item.NATIONALITY = ddlNationality.SelectedValue;
                //item.EDUCATION_CODE = ddlEducation.SelectedValue;
                item.EMAIL           = txtEmail.Text;
                item.LOCAL_TELEPHONE = txtTel.Text;
                item.TELEPHONE       = txtMobilePhone.Text;
                item.ADDRESS_1       = UcCurrentAdd.TextBoxAddress.Text;
                item.PROVINCE_CODE   = UcCurrentAdd.DropdownProvince.SelectedValue;
                item.AREA_CODE       = UcCurrentAdd.DropdownDistrict.SelectedValue;
                item.TUMBON_CODE     = UcCurrentAdd.DropdownParish.SelectedValue;
                item.ZIP_CODE        = UcCurrentAdd.TextBoxPostCode.Text;
                //item.LOCAL_ADDRESS1 = txtRegisterAddress.Text;
                //item.LOCAL_PROVINCE_CODE = UcRegisAdd.DropdownProvince.SelectedValue;
                //item.LOCAL_AREA_CODE = UcRegisAdd.DropdownDistrict.SelectedValue;
                //item.LOCAL_TUMBON_CODE = UcRegisAdd.DropdownParish.SelectedValue;
                //item.LOCAL_ZIPCODE = txtPostcodeRegisterAddress.Text;
                item.UPDATED_BY   = this.UserID;
                item.UPDATED_DATE = DateTime.Now;
                item.STATUS       = DTO.RegistrationStatus.WaitForApprove.GetEnumValue().ToString();

                if (item != null)
                {
                    BLL.RegistrationBiz biz = new BLL.RegistrationBiz();

                    var result = biz.ValidateBeforeSubmit(DTO.RegistrationType.General, item);

                    if (result.IsError)
                    {
                        UCModalError.ShowMessageError = result.ErrorMsg;
                        UCModalError.ShowModalError();
                    }
                    else
                    {
                        if (this.DataAction == DTO.DataActionMode.Edit)
                        {
                            try
                            {
                                var res = biz.Update(item, ucAttachFileControl1.AttachFiles.ConvertToRegistrationAttachFiles().ToList());

                                if (res.IsError)
                                {
                                    UCModalError.ShowMessageError = res.ErrorMsg;
                                    UCModalError.ShowModalError();
                                }
                                else
                                {
                                    Session.Remove("AttatchFiles");

                                    Session.Abandon();

                                    ClearControl();

                                    UCModalError.Visible   = false;
                                    UCModalSuccess.Visible = false;
                                    BLL.DataCenterBiz dbiz = new BLL.DataCenterBiz();
                                    var r = dbiz.GetConfigApproveMember();
                                    foreach (var items in r.DataResponse)
                                    {
                                        if (items.Id == "01" && items.Value == "Y")
                                        {
                                            string AlertWaitingForApprove = "alert('" + Resources.infoSysMessage_EditSuccess + "');window.location.assign('../home.aspx')";
                                            ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", AlertWaitingForApprove, true);
                                        }
                                    }
                                    string Alert = "alert('" + Resources.infoSysMessage_RegisSuccess2 + "');window.location.assign('../home.aspx')";
                                    ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", Alert, true);
                                }
                            }
                            catch (Exception ex)
                            {
                                UCModalError.ShowMessageError = ex.Message;
                                UCModalError.ShowModalError();
                            }
                        }
                    }
                }
                else
                {
                    UCModalError.ShowMessageError = SysMessage.TryAgain;
                    UCModalError.ShowModalError();
                }
            }
            //สมาคม ยังไม่แยก Methodเฉพาะ > var result = biz.ValidateBeforeSubmit(DTO.RegistrationType.Association, item);
            else if (this.UserProfile.MemberType.ToString() == DTO.MemberType.Association.GetEnumValue().ToString())
            {
                //if (!ValidDateInput())
                //{
                //    return;
                //}

                Registration item = new Registration();

                //var attachFiles = this.AttachFiles;
                //var personAttachFiles = this.PersonAttachFiles;

                item.ID = this.RegisterationID;

                item.MEMBER_TYPE = this.MememberTypeGuest;

                item.ID_CARD_NO    = txtIDNumber.Text;
                item.PRE_NAME_CODE = ddlTitle.SelectedValue;
                item.NAMES         = txtFirstName.Text;
                item.LASTNAME      = txtLastName.Text;
                item.ID_CARD_NO    = txtIDNumber.Text;
                //item.BIRTH_DATE = Convert.ToDateTime(txtBirthDay.Text);
                item.SEX         = rblSex.SelectedValue;
                item.NATIONALITY = ddlNationality.SelectedValue;
                //item.EDUCATION_CODE = ddlEducation.SelectedValue;
                item.EMAIL           = txtEmail.Text;
                item.LOCAL_TELEPHONE = txtTel.Text;
                item.TELEPHONE       = txtMobilePhone.Text;
                item.ADDRESS_1       = UcCurrentAdd.TextBoxAddress.Text;
                item.PROVINCE_CODE   = UcCurrentAdd.DropdownProvince.SelectedValue;
                item.AREA_CODE       = UcCurrentAdd.DropdownDistrict.SelectedValue;
                item.TUMBON_CODE     = UcCurrentAdd.DropdownParish.SelectedValue;
                item.ZIP_CODE        = UcCurrentAdd.TextBoxPostCode.Text;
                //item.LOCAL_ADDRESS1 = txtRegisterAddress.Text;
                //item.LOCAL_PROVINCE_CODE = UcRegisAdd.DropdownProvince.SelectedValue;
                //item.LOCAL_AREA_CODE = UcRegisAdd.DropdownDistrict.SelectedValue;
                //item.LOCAL_TUMBON_CODE = UcRegisAdd.DropdownParish.SelectedValue;
                //item.LOCAL_ZIPCODE = txtPostcodeRegisterAddress.Text;
                item.UPDATED_BY   = this.UserID;
                item.UPDATED_DATE = DateTime.Now;
                item.STATUS       = DTO.RegistrationStatus.WaitForApprove.GetEnumValue().ToString();

                if (item != null)
                {
                    BLL.RegistrationBiz biz = new BLL.RegistrationBiz();

                    var result = biz.ValidateBeforeSubmit(DTO.RegistrationType.General, item);

                    if (result.IsError)
                    {
                        UCModalError.ShowMessageError = result.ErrorMsg;
                        UCModalError.ShowModalError();
                    }
                    else
                    {
                        if (this.DataAction == DTO.DataActionMode.Edit)
                        {
                            try
                            {
                                var res = biz.Update(item, ucAttachFileControl1.AttachFiles.ConvertToRegistrationAttachFiles().ToList());

                                if (res.IsError)
                                {
                                    UCModalError.ShowMessageError = res.ErrorMsg;
                                    UCModalError.ShowModalError();
                                }
                                else
                                {
                                    Session.Remove("AttatchFiles");

                                    Session.Abandon();

                                    ClearControl();

                                    UCModalError.Visible   = false;
                                    UCModalSuccess.Visible = false;
                                    BLL.DataCenterBiz dbiz = new BLL.DataCenterBiz();
                                    var r = dbiz.GetConfigApproveMember();
                                    foreach (var items in r.DataResponse)
                                    {
                                        if (items.Id == "01" && items.Value == "Y")
                                        {
                                            string AlertWaitingForApprove = "alert('" + Resources.infoSysMessage_EditSuccess + "');window.location.assign('../home.aspx')";
                                            ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", AlertWaitingForApprove, true);
                                        }
                                    }
                                    string Alert = "alert('" + Resources.infoSysMessage_RegisSuccess2 + "');window.location.assign('../home.aspx')";
                                    ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", Alert, true);
                                }
                            }
                            catch (Exception ex)
                            {
                                UCModalError.ShowMessageError = ex.Message;
                                UCModalError.ShowModalError();
                            }
                        }
                    }
                }
                else
                {
                    UCModalError.ShowMessageError = SysMessage.TryAgain;
                    UCModalError.ShowModalError();
                }
            }
            else
            {
                UCModalError.ShowMessageError = SysMessage.TryAgain;
                UCModalError.ShowModalError();
            }
        }