Пример #1
0
        private void GetCompanyNameById()
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var ls = biz.GetCompanyNameById(base.UserProfile.CompCode);

            ddlCompany.Items.Insert(0, ls);
        }
Пример #2
0
        private void GetLoadDataToControl(DTO.Registration companyent)
        {
            BLL.DataCenterBiz dcbiz      = new BLL.DataCenterBiz();
            BLL.PersonBiz     biz        = new BLL.PersonBiz();
            BLL.DataCenterBiz dataCenter = new BLL.DataCenterBiz();

            var res = biz.GetUserProfileById(this.MasterPage.UserProfile.Id);

            this.MasterPage.AttachFileControl.RegisterationId = this.MasterPage.UserProfile.Id;
            this.MasterPage.AttachFileControl.CurrentUser     = this.UserProfile.LoginName;

            this.MasterPage.RegistrationId = companyent.ID;

            if (!companyent.MEMBER_TYPE.Equals(DTO.MemberType.Insurance.GetEnumValue().ToString()))
            {
                MasterPage.ModelError.ShowMessageError = SysMessage.UserMissMatchRegitrationData;
                MasterPage.ModelError.ShowModalError();
            }
            rblSex.SelectedValue    = companyent.SEX;//milk
            txtCompanyRegister.Text = companyent.COMP_CODE;
            ddlTitle.SelectedValue  = companyent.PRE_NAME_CODE;
            txtFirstName.Text       = companyent.NAMES;
            txtLastName.Text        = companyent.LASTNAME;
            txtIDNumber.Text        = companyent.ID_CARD_NO;
            txtIDNumber.Enabled     = false;
            txtCompanyTel.Text      = LocalTelephoneNumberHelper.GetPhoneNumber(companyent.LOCAL_TELEPHONE);
            txtCompanyTelExt.Text   = LocalTelephoneNumberHelper.GetExtenNumber(companyent.LOCAL_TELEPHONE);
            txtTel.Text             = LocalTelephoneNumberHelper.GetPhoneNumber(companyent.TELEPHONE);
            txtTelExt.Text          = LocalTelephoneNumberHelper.GetExtenNumber(companyent.TELEPHONE);

            txtEmail.Text    = companyent.EMAIL;
            txtEmail.Enabled = false;
            UcAddress.TextBoxAddress.Text  = companyent.ADDRESS_1;
            UcAddress.TextBoxPostCode.Text = companyent.ZIP_CODE;

            var strName = dcbiz.GetCompanyNameById(companyent.COMP_CODE);

            txtCompany.Text = strName;
            this.MasterPage.TextBoxResultReg.Text = companyent.APPROVE_RESULT;

            UcAddress.SelectDropDownStep(companyent.PROVINCE_CODE, companyent.AREA_CODE, companyent.TUMBON_CODE);
        }
Пример #3
0
        //protected bool Upload(HttpPostedFile file, long actualFileSize)
        //{
        //    int filePosition = 0;
        //    int filePart = 16 * 1024; //Each hit 16 kb file to avoid any serialization issue when transfering  data across WCF

        //    //Create buffer size to send to service based on filepart size
        //    byte[] bufferData = new byte[filePart];

        //    //Set the posted file data to file stream.
        //    Stream fileStream = file.InputStream;

        //    //Create the service client


        //    //IAS. .FileUploadServiceClient serviceClient = new FUWcfService.FileUploadServiceClient();

        //    try
        //    {
        //        long actualFileSizeToUpload = actualFileSize;
        //        //Start reading the file from the specified position.
        //        fileStream.Position = filePosition;
        //        int fileBytesRead = 0;

        //        //Upload file data in parts until filePosition reaches the actual file end or size.
        //        while (filePosition != actualFileSizeToUpload)
        //        {
        //            // read the next file part i.e. another 100 kb of data
        //            fileBytesRead = fileStream.Read(bufferData, 0, filePart);
        //            if (fileBytesRead != bufferData.Length)
        //            {
        //                filePart = fileBytesRead;
        //                byte[] bufferedDataToWrite = new byte[fileBytesRead];
        //                //Copy the buffered data into bufferedDataToWrite
        //                Array.Copy(bufferData, bufferedDataToWrite, fileBytesRead);
        //                bufferData = bufferedDataToWrite;
        //            }

        //            //Populate the data contract to send it to the service method

        //            //bool fileDataWritten = serviceClient.UploadFileData(
        //            //    new FUWcfService.FileData { FileName = file.FileName, BufferData = bufferData, FilePosition = filePosition });
        //            //if (!fileDataWritten)
        //            //{
        //            //    break;
        //            //}

        //            //Update the filePosition position to continue reading data from that position back to server
        //            filePosition += fileBytesRead;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        //Log data to database or file system here
        //        return false;
        //    }
        //    finally
        //    {
        //        //Close the fileStream once all done.
        //        fileStream.Close();
        //    }
        //    return true;
        //}


        protected void btnGet_Click(object sender, EventArgs e)
        {
            var biz = new BLL.DataCenterBiz();

            lblMsg.Text = biz.GetCompanyNameById("3155");
        }
Пример #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
        /// <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();
            }
        }