예제 #1
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;
                    }
                }
            }
        }
예제 #2
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);
        }
예제 #3
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);
        }
예제 #4
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();
            }
        }
예제 #5
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();
            }
        }
예제 #6
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();
            }
        }
예제 #7
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);
        }
예제 #8
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);
        }