Пример #1
0
        protected void btnOkSubmit_Click(object sender, EventArgs e)
        {
            var    biz      = new BLL.PersonBiz();
            string personID = this.PersonID;
            var    res      = biz.GetPersonTemp(personID);

            PersonTemp item = new PersonTemp();

            if (res != null)
            {
                item.ID              = res.DataResponse.ID;
                item.MEMBER_TYPE     = res.DataResponse.MEMBER_TYPE;
                item.COMP_CODE       = res.DataResponse.COMP_CODE;
                item.PRE_NAME_CODE   = res.DataResponse.PRE_NAME_CODE;
                item.NAMES           = res.DataResponse.NAMES;
                item.LASTNAME        = res.DataResponse.LASTNAME;
                item.SEX             = res.DataResponse.SEX;
                item.ID_CARD_NO      = res.DataResponse.ID_CARD_NO;
                item.BIRTH_DATE      = res.DataResponse.BIRTH_DATE;
                item.EDUCATION_CODE  = res.DataResponse.EDUCATION_CODE;
                item.NATIONALITY     = res.DataResponse.NATIONALITY;
                item.EMAIL           = res.DataResponse.EMAIL;
                item.LOCAL_TELEPHONE = res.DataResponse.LOCAL_TELEPHONE;
                item.TELEPHONE       = res.DataResponse.TELEPHONE;

                //ขาด 2 ตัว
                //txtIDOicBeforeReg.Text =
                //txtIDMemberNumberAfterReg.Text =
                //ขาด 2 ตัว

                item.ADDRESS_1           = res.DataResponse.ADDRESS_1;
                item.PROVINCE_CODE       = res.DataResponse.PROVINCE_CODE;
                item.AREA_CODE           = res.DataResponse.AREA_CODE;
                item.TUMBON_CODE         = res.DataResponse.TUMBON_CODE;
                item.LOCAL_ADDRESS1      = res.DataResponse.LOCAL_ADDRESS1;
                item.LOCAL_PROVINCE_CODE = res.DataResponse.PROVINCE_CODE;
                item.LOCAL_AREA_CODE     = res.DataResponse.LOCAL_AREA_CODE;
                item.LOCAL_TUMBON_CODE   = res.DataResponse.LOCAL_TUMBON_CODE;

                item.STATUS = ddlStatus.SelectedValue;
            }

            var final = biz.EditPerson(item);

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

            AlertMessage.ShowAlertMessage(string.Empty, SysMessage.SaveSucess);
        }
Пример #2
0
        //Edit Mode
        public DTO.PersonTemp GetPersonTemp()
        {
            BLL.PersonBiz regBiz = new BLL.PersonBiz();
            var           res    = regBiz.GetPersonTemp(UserProfile.Id);

            if (res.IsError)
            {
                ModelError.ShowMessageError = res.ErrorMsg;
                ModelError.ShowModalError();
            }
            this.PersonId = res.DataResponse.ID;
            //Assign CreateDate
            this.CreateDateTemp = res.DataResponse.CREATED_DATE;
            return(res.DataResponse);
        }
Пример #3
0
        //Edit Mode
        private void GetPersonTemp()
        {
            BLL.PersonBiz personBiz = new BLL.PersonBiz();
            var           res       = personBiz.GetPersonTemp(MasterPage.UserProfile.Id);

            if (res.IsError)
            {
                MasterPage.ModelError.ShowMessageError = res.ErrorMsg;
                MasterPage.ModelError.ShowModalError();
            }
            MasterPage.PersonId = res.DataResponse.ID;
            GetLoadTempDataToControl(res.DataResponse);
            MasterPage.GetAttatchFiles();

            //Assign CreateDate
            MasterPage.CreateDateTemp = res.DataResponse.CREATED_DATE;
        }
Пример #4
0
        private void GetAfterReg()
        {
            var    biz      = new BLL.PersonBiz();
            string personID = this.PersonID;
            var    res      = biz.GetPersonTemp(personID);

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

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

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

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

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

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

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

                if (res.DataResponse.BIRTH_DATE != null)
                {
                    txtBirthDayAfterReg.Text = res.DataResponse.BIRTH_DATE.Value.ToString("dd MMMM yyyy");
                }
                else
                {
                    txtBirthDayAfterReg.Text = "-";
                }

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

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

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

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

                if (res.DataResponse.TELEPHONE != null)
                {
                    txtMobilePhoneAfterReg.Text = res.DataResponse.TELEPHONE;
                }
                else
                {
                    txtMobilePhoneAfterReg.Text = "-";
                }
                //txtIDOicBeforeReg.Text =
                //txtIDMemberNumberAfterReg.Text =

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

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

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

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

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

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

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

                string localtumbon = res.DataResponse.LOCAL_TUMBON_CODE;
                GetTumbonRegisterAddressAfter(localProvince, localampur, localtumbon);
            }
        }
Пример #5
0
        private void GetAfterReg()
        {
            var    biz      = new BLL.PersonBiz();
            string personID = this.PersonID;
            var    res      = biz.GetPersonTemp(personID);

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

                this.MemberTypeSession = memberType;
                GetMembeTypeAfter(memberType);


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

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

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

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

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

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

                if (res.DataResponse.BIRTH_DATE != null)
                {
                    txtBirthDayAfterReg.CssClass = "txt";
                    txtBirthDayAfterReg.Text     = res.DataResponse.BIRTH_DATE.Value.ToString("dd MMMM yyyy");
                }
                else
                {
                    txtBirthDayAfterReg.CssClass = "txt";
                    txtBirthDayAfterReg.Text     = "-";
                }

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

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

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

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

                if (res.DataResponse.TELEPHONE != null)
                {
                    txtMobilePhoneAfterReg.Text = res.DataResponse.TELEPHONE;
                }
                else
                {
                    txtMobilePhoneAfterReg.Text = "-";
                }
                //txtIDOicBeforeReg.Text =
                //txtIDMemberNumberAfterReg.Text =

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

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

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

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

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

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

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

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


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

                //if ((res.DataResponse.AGENT_TYPE != "") && (res.DataResponse.AGENT_TYPE != null))
                //{
                //    ddlAgentTypeAfter.SelectedValue = res.DataResponse.AGENT_TYPE;
                //}
                //else if ((res.DataResponse.AGENT_TYPE == "") || (res.DataResponse.AGENT_TYPE == null))
                //{
                //    ListItem ddlList = new ListItem("", "", true);
                //    ddlList.Selected = true;
                //    ddlAgentTypeAfter.Items.Add(ddlList);
                //}
            }
            else
            {
                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
        }
Пример #6
0
        protected void btnOkSubmit_Click(object sender, EventArgs e)
        {
            var    biz      = new BLL.PersonBiz();
            string personID = this.PersonID;
            var    res      = biz.GetPersonTemp(personID);
            string userid   = UserProfile.Id;

            PersonTemp item = new PersonTemp();

            if (res.DataResponse != null)
            {
                item.ID              = res.DataResponse.ID;
                item.MEMBER_TYPE     = res.DataResponse.MEMBER_TYPE;
                item.COMP_CODE       = res.DataResponse.COMP_CODE;
                item.PRE_NAME_CODE   = res.DataResponse.PRE_NAME_CODE;
                item.NAMES           = res.DataResponse.NAMES;
                item.LASTNAME        = res.DataResponse.LASTNAME;
                item.SEX             = res.DataResponse.SEX;
                item.ID_CARD_NO      = res.DataResponse.ID_CARD_NO;
                item.BIRTH_DATE      = res.DataResponse.BIRTH_DATE;
                item.EDUCATION_CODE  = res.DataResponse.EDUCATION_CODE;
                item.NATIONALITY     = res.DataResponse.NATIONALITY;
                item.EMAIL           = res.DataResponse.EMAIL;
                item.LOCAL_TELEPHONE = res.DataResponse.LOCAL_TELEPHONE;
                item.TELEPHONE       = res.DataResponse.TELEPHONE;

                //ขาด 2 ตัว
                //txtIDOicBeforeReg.Text =
                //txtIDMemberNumberAfterReg.Text =
                //ขาด 2 ตัว

                item.ADDRESS_1           = res.DataResponse.ADDRESS_1;
                item.PROVINCE_CODE       = res.DataResponse.PROVINCE_CODE;
                item.AREA_CODE           = res.DataResponse.AREA_CODE;
                item.TUMBON_CODE         = res.DataResponse.TUMBON_CODE;
                item.LOCAL_ADDRESS1      = res.DataResponse.LOCAL_ADDRESS1;
                item.LOCAL_PROVINCE_CODE = res.DataResponse.PROVINCE_CODE;
                item.LOCAL_AREA_CODE     = res.DataResponse.LOCAL_AREA_CODE;
                item.LOCAL_TUMBON_CODE   = res.DataResponse.LOCAL_TUMBON_CODE;
                item.CREATED_DATE        = res.DataResponse.CREATED_DATE;

                item.ZIP_CODE      = res.DataResponse.ZIP_CODE;
                item.LOCAL_ZIPCODE = res.DataResponse.LOCAL_ZIPCODE;

                item.STATUS         = ddlStatus.SelectedValue;
                item.APPROVE_RESULT = txtResultReg.Text;
                item.APPROVED_BY    = userid;
                item.AGENT_TYPE     = res.DataResponse.AGENT_TYPE;
            }
            if (res.DataResponse == null)
            {
                this.UCModalError.ShowMessageError = res.ErrorMsg;
                this.UCModalError.ShowModalError();
                return;
            }

            if (ddlStatus.SelectedValue.Equals("5"))
            {
                item.STATUS         = DTO.PersonDataStatus.Approve.GetEnumValue().ToString();
                item.APPROVE_RESULT = txtResultReg.Text;
                var final = biz.EditPerson(item);

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

                    UCModalError.ShowMessageError = final.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else
                {
                    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 (ddlStatus.SelectedValue.Equals("6") && res.DataResponse.STATUS == DTO.PersonDataStatus.WaitForApprove.GetEnumValue().ToString())
            {
                item.APPROVE_RESULT = txtResultReg.Text;
                var final = biz.EditPerson(item);

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

                    UCModalError.ShowMessageError = final.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else
                {
                    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 (ddlStatus.SelectedValue.Equals("6"))
            //{
            //    List<String> persons = new List<string>() { item.ID };
            //    var final = biz.PersonNotApprove(persons);
            //    if (final.IsError)
            //    {

            //        UCModalError.ShowMessageError = final.ErrorMsg;
            //        UCModalError.ShowModalError();
            //    }
            //    else
            //    {
            //        string AlertSussuss = String.Format("alert('{0}');window.location.assign('../Register/regSearchOfficerOIC.aspx')", SysMessage.SaveSucess);
            //        ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", AlertSussuss, true);
            //    }

            //}
            else if (ddlStatus.SelectedValue.Equals(""))
            {
                UCModalError.ShowMessageError = Resources.errorEdit_Reg_Person_004;
                UCModalError.ShowModalError();
            }

            //var final = biz.EditPerson(item);

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

            //    UCModalError.ShowMessageError = final.ErrorMsg;
            //    UCModalError.ShowModalError();

            //}

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