示例#1
0
        private void InitData()
        {
            BLL.PersonBiz biz = new BLL.PersonBiz();
            var           res = biz.GetById(this.UserProfile.Id);

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

                ddlTitle.SelectedValue       = person.PRE_NAME_CODE;
                txtFirstName.Text            = person.NAMES;
                txtLastName.Text             = person.LASTNAME;
                txtIDNumber.Text             = person.ID_CARD_NO;
                txtBirthDay.Text             = person.BIRTH_DATE.Value.ToString("dd MMMM yyyy");
                rblSex.SelectedValue         = person.SEX;
                ddlNationality.SelectedValue = person.NATIONALITY;
                ddlEducation.SelectedValue   = person.EDUCATION_CODE;
                txtEmail.Text          = person.EMAIL;
                txtTel.Text            = person.LOCAL_TELEPHONE;
                txtMobilePhone.Text    = person.TELEPHONE;
                txtCurrentAddress.Text = person.ADDRESS_1;

                var message = SysMessage.DefaultSelecting;

                BLL.DataCenterBiz dataCenter = new BLL.DataCenterBiz();
                ddlProvinceCurrentAddress.SelectedValue = person.PROVINCE_CODE;
                var lsPC = dataCenter.GetAmpur(message, ddlProvinceCurrentAddress.SelectedValue);
                BindToDDL(ddlDistrictCurrentAddress, lsPC);

                ddlDistrictCurrentAddress.SelectedValue = person.AREA_CODE;
                var lsTC = dataCenter.GetTumbon(message, ddlProvinceCurrentAddress.SelectedValue, ddlDistrictCurrentAddress.SelectedValue);
                BindToDDL(ddlParishCurrentAddress, lsTC);

                ddlParishCurrentAddress.SelectedValue = person.TUMBON_CODE;

                txtPostcodeCurrentAddress.Text = person.ZIP_CODE;
                txtRegisterAddress.Text        = person.LOCAL_ADDRESS1;

                ddlProvinceRegisterAddress.SelectedValue = person.LOCAL_PROVINCE_CODE;
                var lsPR = dataCenter.GetAmpur(message, ddlProvinceRegisterAddress.SelectedValue);
                BindToDDL(ddlDistrictRegisterAddress, lsPR);

                ddlDistrictRegisterAddress.SelectedValue = person.LOCAL_AREA_CODE;
                var lsTR = dataCenter.GetTumbon(message, ddlProvinceRegisterAddress.SelectedValue, ddlDistrictRegisterAddress.SelectedValue);
                BindToDDL(ddlParishRegisterAddress, lsTR);

                ddlParishRegisterAddress.SelectedValue = person.TUMBON_CODE;

                txtPostcodeRegisterAddress.Text = person.LOCAL_ZIPCODE;
            }
            else
            {
                var errorMsg = res.ErrorMsg;

                AlertMessage.ShowAlertMessage(string.Empty, errorMsg);
            }
        }
示例#2
0
        //View Mode
        public DTO.Person GetPersonal()
        {
            BLL.PersonBiz regBiz = new BLL.PersonBiz();
            var           res    = regBiz.GetById(UserProfile.Id);

            if (res.IsError)
            {
                ModelError.ShowMessageError = res.ErrorMsg;
                ModelError.ShowModalError();
            }
            this.PersonId = res.DataResponse.ID;
            return(res.DataResponse);
        }
示例#3
0
        //View Mode
        private void GetLastPerson()
        {
            BLL.PersonBiz personBiz = new BLL.PersonBiz();
            var           res       = personBiz.GetById(MasterPage.UserProfile.Id);

            if (res.IsError)
            {
                MasterPage.ModelError.ShowMessageError = res.ErrorMsg;
                MasterPage.ModelError.ShowModalError();
            }
            MasterPage.PersonId = res.DataResponse.ID;
            GetLoadDataToControl(res.DataResponse);
            MasterPage.GetAttatchFiles();
        }
示例#4
0
        private void GetBeforeReg()
        {
            var    biz      = new BLL.PersonBiz();
            string personID = this.PersonID;
            var    res      = biz.GetById(personID);

            if (res != null)
            {
                string memberType = res.DataResponse.MEMBER_TYPE;
                GetMemberTypeBefore(memberType);


                string compCode = res.DataResponse.COMP_CODE;
                GetCompanyByIdBefore(compCode);

                int title = Convert.ToInt32(res.DataResponse.PRE_NAME_CODE);
                GetTitleBefore(title);

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

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

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

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

                if (res.DataResponse.BIRTH_DATE != null)
                {
                    txtBirthDayBeforeReg.Text = res.DataResponse.BIRTH_DATE.Value.ToString("dd MMMM yyyy");
                }
                else
                {
                    txtBirthDayBeforeReg.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 = "-";
                }

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

                if (res.DataResponse.TELEPHONE != null)
                {
                    txtMobilePhoneBeforeReg.Text = res.DataResponse.TELEPHONE;
                }
                else
                {
                    txtMobilePhoneBeforeReg.Text = "-";
                }
                //txtIDOicBeforeReg.Text =
                //txtIDMemberNumberBeforeReg.Text =
                if (res.DataResponse.ADDRESS_1 != null)
                {
                    txtCurrentAddressBeforeReg.Text = res.DataResponse.ADDRESS_1;
                }
                else
                {
                    txtCurrentAddressBeforeReg.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);
            }

            if (res.IsError)
            {
                Response.Write(res.ErrorMsg);
            }
        }
示例#5
0
        /// <summary>
        /// GetBeforeReg()
        /// </summary>
        /// <AUTHOR>Natta</AUTHOR>
        /// <LASTUPDATE>04/06/2557</LASTUPDATE>
        private void GetBeforeReg()
        {
            var    biz      = new BLL.PersonBiz();
            string personID = this.PersonID;
            var    res      = biz.GetById(personID);

            if (res != null)
            {
                EDIT_USER_TYPE = res.DataResponse.MEMBER_TYPE.ToInt();
                string memberType = this.NullableString(res.DataResponse.MEMBER_TYPE);

                this.MemberTypeSession = memberType;
                GetMemberTypeBefore(memberType);

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

                string compCode = res.DataResponse.COMP_CODE;
                GetCompanyByIdBefore(compCode);

                int title = Convert.ToInt32(res.DataResponse.PRE_NAME_CODE);
                GetTitleBefore(title);

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

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

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

                if (res.DataResponse.ID_CARD_NO != null)
                {
                    txtIDNumberBeforeReg.Text = res.DataResponse.ID_CARD_NO;
                }
                else
                {
                    txtIDNumberBeforeReg.Text = "-";
                }
                //Remove CSS
                if (res.DataResponse.BIRTH_DATE != null)
                {
                    txtBirthDayBeforeReg.CssClass = "txt";
                    txtBirthDayBeforeReg.Text     = res.DataResponse.BIRTH_DATE.Value.ToString("dd MMMM yyyy");
                }
                else
                {
                    txtBirthDayBeforeReg.CssClass = "txt";
                    txtBirthDayBeforeReg.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 = "-";
                }

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

                if (res.DataResponse.TELEPHONE != null)
                {
                    txtMobilePhoneBeforeReg.Text = res.DataResponse.TELEPHONE;
                }
                else
                {
                    txtMobilePhoneBeforeReg.Text = "-";
                }
                //txtIDOicBeforeReg.Text =
                //txtIDMemberNumberBeforeReg.Text =
                if (res.DataResponse.ADDRESS_1 != null)
                {
                    txtCurrentAddressBeforeReg.Text = res.DataResponse.ADDRESS_1;
                }
                else
                {
                    txtCurrentAddressBeforeReg.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);

                if (res.DataResponse.ZIP_CODE != null)
                {
                    txtZipCodeCurrentAddressBeforeReg.Text = res.DataResponse.ZIP_CODE;
                }
                else //milk
                {
                    txtZipCodeCurrentAddressBeforeReg.Text = "-";
                }

                if (res.DataResponse.LOCAL_ZIPCODE != null)
                {
                    txtZipCodeRegisterAddressBeforeReg.Text = res.DataResponse.LOCAL_ZIPCODE;
                }
                else//milk
                {
                    txtZipCodeRegisterAddressBeforeReg.Text = "-";
                }

                //if ((res.DataResponse.AGENT_TYPE != "") && (res.DataResponse.AGENT_TYPE != null))
                //{
                //    ddlAgentTypeBefore.SelectedValue = res.DataResponse.AGENT_TYPE;
                //}
                //else if ((res.DataResponse.AGENT_TYPE == "") || (res.DataResponse.AGENT_TYPE == null))
                //{
                //    ListItem ddlList = new ListItem("", "", true);
                //    ddlList.Selected = true;
                //    ddlAgentTypeBefore.Items.Add(ddlList);
                //}
            }

            if (res.IsError)
            {
                //Response.Write(res.ErrorMsg);

                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
        }
示例#6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GetTitleName();
                // แก้ไขข้อมูล (เจ้าหน้าที่ คปภ.)
                lblRegisterOfficer.Text = "แก้ไขข้อมูลผู้ใช้ระบบ (" + GetMemberTypeOIC(UserProfile.MemberType.ToString()).Name + ")";
                using (BLL.PersonBiz biz = new BLL.PersonBiz()) {
                    var res = biz.GetById(UserProfile.Id);
                    if (res.DataResponse != null)
                    {
                        DTO.Person person = res.DataResponse;

                        txtOICUserName.Text         = UserProfile.OIC_User_Id;
                        txtIDNumber.Text            = UserProfile.OIC_EMP_NO;
                        txtMemberType.Text          = GetMemberTypeOIC(UserProfile.MemberType.ToString()).Name;
                        ddlAntecedent.SelectedValue = person.PRE_NAME_CODE;
                        txtFirstName.Text           = person.NAMES;
                        txtLastName.Text            = person.LASTNAME;
                        rblSex.SelectedValue        = person.SEX;

                        if (Request.QueryString["Mode"] != null)
                        {
                            String mode = Request.QueryString["Mode"].Trim();
                            if (mode == "V")
                            {
                                lblRegisterOfficer.Text = "ข้อมูลผู้ใช้ระบบ (" + GetMemberTypeOIC(UserProfile.MemberType.ToString()).Name + ")";
                                txtOICUserName.Enabled  = false;
                                txtIDNumber.Enabled     = false;
                                txtMemberType.Enabled   = false;
                                ddlAntecedent.Enabled   = false;
                                txtFirstName.Enabled    = false;
                                txtLastName.Enabled     = false;
                                rblSex.Enabled          = false;
                                btnSubmit.Visible       = false;
                                btnCancel.Visible       = false;
                                FileSign.Visible        = false;
                                lblDescription.Visible  = false;
                                if (person.MEMBER_TYPE == "5")
                                {
                                    lblSign.Visible = true;
                                    //if (person.IMG_SIGN != null)
                                    //{
                                    string base64String = biz.GetOicPersonSignImg(person.ID).DataResponse.Signture;     // Convert.ToBase64String(person.IMG_SIGN, 0, person.IMG_SIGN.Length);
                                    if (!String.IsNullOrEmpty(base64String))
                                    {
                                        ImgSign.ImageUrl = "data:image/png;base64," + base64String;
                                    }
                                    //}
                                }
                                else
                                {
                                    lblSign.Visible = false;
                                    ImgSign.Visible = false;
                                }
                            }
                        }
                        else
                        {
                            if (person.MEMBER_TYPE == "5")
                            {
                                lblSign.Visible        = true;
                                ImgSign.Visible        = false;
                                FileSign.Visible       = true;
                                lblDescription.Visible = true;
                            }
                            else
                            {
                                ImgSign.Visible        = false;
                                FileSign.Visible       = false;
                                lblSign.Visible        = false;
                                lblDescription.Visible = false;
                            }
                        }
                    }
                }
            }
        }