예제 #1
0
        private void btnConfirm_Click(object sender, RoutedEventArgs e)
        {
            List <string> errorList = new List <string>();

            PageViewUtils.GetErrors(errorList, grdForm);

            if (_pageVM.UniPassword.Length < 4)
            {
                errorList.Add("通提密碼長度必須為4-6碼!");
            }

            int pswd;

            if (int.TryParse(_pageVM.UniPassword, out pswd))
            {
                if (pswd == 0)
                {
                    errorList.Add("通提密碼不可全部為0!");
                }
            }
            else
            {
                errorList.Add("通提密碼必須全為數字");
            }

            if (_pageVM.UniPassword != _pageVM.ConfirmPassword)
            {
                errorList.Add("通提密碼與確認密碼不相符!");
            }

            if (errorList.Count > 0)
            {
                ScalingModal sm    = new ScalingModal(MainGrid, InnerGrid);
                var          popup = new ValidationErrorDialog(errorList.ToArray(), sm);
                sm.Expand(popup, ScalingModalExpandCollapseAnimation.SlideB);

                _pageVM.Clear();
            }
            else
            {
                _pageVM.StopTimer();

                byte[] bytPswd = Encoding.ASCII.GetBytes(_pageVM.ConfirmPassword);

                var model = new
                {
                    takePwd  = _pageVM.AccountType == "1" || _pageVM.AccountType == "3" ? Convert.ToBase64String(bytPswd) : "",
                    ftakePwd = _pageVM.AccountType == "2" || _pageVM.AccountType == "3" ? Convert.ToBase64String(bytPswd) : "",
                };

                _pageVM.Clear();

                string json = JsonConvert.SerializeObject(model);
                _kernelService.TransactionDataCache.Set(KioskDataCacheKey.UniPassword, json);

                PageResult result = new PageResult("Confirm", KioskDataCacheKey.UniPassword);
                _kernelService.NextPage(result);
            }
        }
예제 #2
0
        private void btnConfirm_Click(object sender, RoutedEventArgs e)
        {
            List <string> errorList = new List <string>();

            PageViewUtils.GetErrors(errorList, grdForm);

            DateTime?dtIssueDate = _pageVM.ConvertIssuedDate();

            if (!dtIssueDate.HasValue)
            {
                errorList.Add("發證日期格式不合法!");
            }

            if (_pageVM.SecondIDType == "O" && string.IsNullOrEmpty(_pageVM.OtherID))
            {
                errorList.Add("其他證件必須填寫!");
            }

            if (errorList.Count > 0)
            {
                ScalingModal sm    = new ScalingModal(MainGrid, InnerGrid);
                var          popup = new ValidationErrorDialog(errorList.ToArray(), sm);
                sm.Expand(popup, ScalingModalExpandCollapseAnimation.SlideB);
            }
            else
            {
                _pageVM.StopTimer();

                var model = new
                {
                    custName    = _pageVM.CustName,
                    custId      = _pageVM.PID,
                    birthday    = _pageVM.Birthday,
                    iDIssueDt   = _pageVM.IssueDate,
                    iDIssueLoc  = _pageVM.IssueLoc,
                    iDIssueFlag = _pageVM.IssueFlag,
                    iDPicFlag   = _pageVM.HasPhoto,
                    secCert     = _pageVM.SecondIDType,
                    secCertId   = _pageVM.SecondIDSN,
                    secCertType = _pageVM.SecondIDType == "O" ? _pageVM.OtherID : ""
                };

                string json = JsonConvert.SerializeObject(model);
                _kernelService.TransactionDataCache.Set(KioskDataCacheKey.IDConfirmData, json);

                _pageVM.Clear();

                PageResult result = new PageResult("Confirm", KioskDataCacheKey.IDConfirmData);
                _kernelService.NextPage(result);
            }
        }
예제 #3
0
        private void btnConfirm_Click(object sender, RoutedEventArgs e)
        {
            List <string> errorList = new List <string>();

            PageViewUtils.GetErrors(errorList, grdForm);

            if (!_pageVM.PromotionTermAgree && !_pageVM.PromotionTermDisagree)
            {
                errorList.Add("共同行銷條款必須勾選");
            }

            if (errorList.Count > 0)
            {
                ScalingModal sm    = new ScalingModal(MainGrid, InnerGrid);
                var          popup = new ValidationErrorDialog(errorList.ToArray(), sm);
                sm.Expand(popup, ScalingModalExpandCollapseAnimation.SlideB);
            }
            else
            {
                _pageVM.StopTimer();

                var model = new
                {
                    AgreeTerm     = _pageVM.AgreeTerm ? "Y" : "N",
                    PromotionTerm = (_pageVM.PromotionTermAgree && !_pageVM.PromotionTermDisagree) ? "Y" : "N",

                    PromotionTermDesc = _pageVM.PromotionTermAgree ? "同意" : "不同意"
                };

                string json = JsonConvert.SerializeObject(model);
                _kernelService.TransactionDataCache.Set(KioskDataCacheKey.PersonalData187, json);

                var model2 = new
                {
                    JCreditFlag = _pageVM.AgreeTerm ? "Y" : "N"
                };

                string json2 = JsonConvert.SerializeObject(model2);
                _kernelService.TransactionDataCache.Set(KioskDataCacheKey.SaveJointCredit, json2);

                PageResult result = new PageResult("Confirm", KioskDataCacheKey.PersonalData187);
                _kernelService.NextPage(result);
            }
        }
예제 #4
0
        private void btnConfirm_Click(object sender, RoutedEventArgs e)
        {
            List <string> errorList = new List <string>();

            PageViewUtils.GetErrors(errorList, grdForm);

            if (_pageVM.ApplyATMCard)
            {
                if (!_pageVM.ICCATMCard && !_pageVM.VISAAtomCard && !_pageVM.VISALotusCard)
                {
                    errorList.Add("勾選申請申請金融卡時必須選定一種金融卡片");
                }
            }

            if (_pageVM.ApplyUniPayment)
            {
                if (_pageVM.AccountType == "1" && !_pageVM.ApplyTWDAccountPswd)
                {
                    errorList.Add("勾選申請聯行代收付台幣帳戶通提密碼必須勾選");
                }
                else if (_pageVM.AccountType == "2" && !_pageVM.ApplyFGDAccountPswd)
                {
                    errorList.Add("勾選申請聯行代收付外幣帳戶通提密碼必須勾選");
                }
                else if (_pageVM.AccountType == "3" && !_pageVM.ApplyTWDAccountPswd && !_pageVM.ApplyFGDAccountPswd)
                {
                    errorList.Add("勾選申請聯行代收付臺幣/外幣帳戶通提密碼必須至少勾選一項");
                }
            }

            if (errorList.Count > 0)
            {
                ScalingModal sm    = new ScalingModal(MainGrid, InnerGrid);
                var          popup = new ValidationErrorDialog(errorList.ToArray(), sm);
                sm.Expand(popup, ScalingModalExpandCollapseAnimation.SlideB);
            }
            else
            {
                _pageVM.StopTimer();

                List <string> applyATMCards = new List <string>();
                if (_pageVM.ICCATMCard)
                {
                    applyATMCards.Add("晶片金融卡");
                }
                if (_pageVM.VISAAtomCard)
                {
                    applyATMCards.Add("VISA小金剛卡面");
                }
                if (_pageVM.VISALotusCard)
                {
                    applyATMCards.Add("VISA荷花卡面");
                }
                if (_pageVM.NonDealTRF)
                {
                    applyATMCards.Add("非約定轉帳");
                }
                if (_pageVM.ConsumeDeduct)
                {
                    applyATMCards.Add("國內消費扣款");
                }
                if (_pageVM.InternationTrade)
                {
                    applyATMCards.Add("跨國交易");
                }

                string applyATMCardDesc = string.Join("、", applyATMCards.ToArray());

                var model = new
                {
                    ApplyATMCard            = _pageVM.ApplyATMCard ? "Y" : "N",
                    ApplyATMCardEnabled     = _pageVM.ApplyATMCardEnabled ? "Y" : "N",
                    ICCATMCard              = _pageVM.ICCATMCard ? "Y" : "N",
                    NonDealTRF              = _pageVM.NonDealTRF ? "Y" : "N",
                    VISAAtomCard            = _pageVM.VISAAtomCard ? "Y" : "N",
                    ConsumeDeduct           = _pageVM.ConsumeDeduct ? "Y" : "N",
                    VISALotusCard           = _pageVM.VISALotusCard ? "Y" : "N",
                    InternationTrade        = _pageVM.InternationTrade ? "Y" : "N",
                    ApplyUniPayment         = _pageVM.ApplyUniPayment ? "Y" : "N",
                    ApplyTWDAccountPswd     = _pageVM.ApplyTWDAccountPswd ? "Y" : "N",
                    ApplyFGDAccountPswd     = _pageVM.ApplyFGDAccountPswd ? "Y" : "N",
                    ICCATMCardEnabled       = _pageVM.ICCATMCardEnabled ? "Y" : "N",
                    NonDealTRFEnabled       = _pageVM.NonDealTRFEnabled ? "Y" : "N",
                    VISAAtomCardEnabled     = _pageVM.VISAAtomCardEnabled ? "Y" : "N",
                    ConsumeDeductEnabled    = _pageVM.ConsumeDeductEnabled ? "Y" : "N",
                    VISALotusCardEnabled    = _pageVM.VISALotusCardEnabled ? "Y" : "N",
                    InternationTradeEnabled = _pageVM.InternationTradeEnabled ? "Y" : "N",
                    _pageVM.AccountType,
                    HasOldAccount    = _pageVM.HasOldAccount ? "Y" : "N",
                    IsPreProcAccount = _pageVM.IsPreProcAccount ? "Y" : "N",
                    _pageVM.Email,
                    WarnningAccount   = _pageVM.WarnningAccount ? "Y" : "N",
                    IsShowWarnningMsg = _pageVM.IsShowWarnningMsg ? "Y" : "N",
                    _pageVM.WarnningMsg,

                    ApplyATMCardDesc        = _pageVM.ApplyATMCard ? "是;" + applyATMCardDesc : "否",
                    ApplyUniPaymentDesc     = _pageVM.ApplyUniPayment ? "是" : "否",
                    ApplyTWDAccountPswdDesc = _pageVM.ApplyTWDAccountPswd ? "台幣帳戶" : "",
                    ApplyFGDAccountPswdDesc = _pageVM.ApplyFGDAccountPswd ? "外幣帳戶" : ""
                };

                string json = JsonConvert.SerializeObject(model);
                _kernelService.TransactionDataCache.Set(KioskDataCacheKey.PersonalData185, json);

                PageResult result = new PageResult("Confirm", KioskDataCacheKey.PersonalData185);
                _kernelService.NextPage(result);
            }
        }
예제 #5
0
        private void btnConfirm_Click(object sender, RoutedEventArgs e)
        {
            List <string> errorList = new List <string>();

            PageViewUtils.GetErrors(errorList, grdForm);

            if (string.IsNullOrEmpty(_pageVM.StatementCode))
            {
                errorList.Add("對帳單必須選擇");
            }
            else
            {
                if (_pageVM.StatementCode == "F" || _pageVM.StatementCode == "G")
                {
                    if (string.IsNullOrEmpty(_pageVM.Email))
                    {
                        errorList.Add("對帳單要求Email通知但Email未填寫!");
                    }
                }
            }

            if (_pageVM.ShowStatementAddr && !_pageVM.StatementAddrByHouse && !_pageVM.StatementAddrByComm)
            {
                errorList.Add("對帳單地址選項尚未勾選");
            }

            if (string.IsNullOrEmpty(_pageVM.HouseCityName))
            {
                errorList.Add("戶籍地址縣市未填寫");
            }

            if (string.IsNullOrEmpty(_pageVM.HouseTownName))
            {
                errorList.Add("戶籍地址鄉鎮未填寫");
            }

            if (string.IsNullOrEmpty(_pageVM.CommCityName))
            {
                errorList.Add("通訊地址縣市未填寫");
            }

            if (string.IsNullOrEmpty(_pageVM.CommTownName))
            {
                errorList.Add("通訊地址鄉鎮未填寫");
            }

            if (!string.IsNullOrEmpty(_pageVM.OfficeTelArea) || !string.IsNullOrEmpty(_pageVM.OfficeTelNumber) || !string.IsNullOrEmpty(_pageVM.OfficeExtNumber))
            {
                if (string.IsNullOrEmpty(_pageVM.OfficeTelArea) || string.IsNullOrEmpty(_pageVM.OfficeTelNumber))
                {
                    errorList.Add("公司電話號碼不完整");
                }
            }

            _kernelService.Logger.Info($"MobileNumber = {_pageVM.MobileNumber}");
            string mobile = _pageVM.MobileNumber.Replace("-", "").Trim();

            _kernelService.Logger.Info($"mobile = {mobile}");
            _kernelService.Logger.Info($"mobile.length = {mobile.Length}");

            if (!string.IsNullOrEmpty(mobile))
            {
                if (!mobile.StartsWith("09") || mobile.Length != 10)
                {
                    errorList.Add("行動電話號碼有誤");
                }
            }

            if (!string.IsNullOrEmpty(_pageVM.FaxTelArea) || !string.IsNullOrEmpty(_pageVM.FaxTelNumber))
            {
                if (string.IsNullOrEmpty(_pageVM.FaxTelArea) || string.IsNullOrEmpty(_pageVM.FaxTelNumber))
                {
                    errorList.Add("傳真號碼不完整");
                }
            }

            if (errorList.Count > 0)
            {
                ScalingModal sm    = new ScalingModal(MainGrid, InnerGrid);
                var          popup = new ValidationErrorDialog(errorList.ToArray(), sm);
                sm.Expand(popup, ScalingModalExpandCollapseAnimation.SlideB);
            }
            else
            {
                _pageVM.StopTimer();

                var statement = _pageVM.StatementDropdown.Data.Statements.SingleOrDefault(x => x.Code == _pageVM.StatementCode);

                string fullHouseAddress = _pageVM.HouseCityName + _pageVM.HouseTownName + _pageVM.HouseLi + _pageVM.HouseLin + "鄰" + _pageVM.HouseAddress;
                string fullCommAddress  = _pageVM.CommCityName + _pageVM.CommTownName + (string.IsNullOrEmpty(_pageVM.CommLi) ? "" : _pageVM.CommLi) + (string.IsNullOrEmpty(_pageVM.CommLin) ? "" : _pageVM.CommLin + "鄰") + _pageVM.CommAddress;

                var model = new
                {
                    _pageVM.HouseZipCode,
                    _pageVM.HouseCityName,
                    _pageVM.HouseTownName,
                    _pageVM.HouseLi,
                    _pageVM.HouseLin,
                    _pageVM.HouseAddress,
                    IsSameWithHouse = _pageVM.IsSameWithHouse ? "Y" : "N",
                    _pageVM.CommZipCode,
                    _pageVM.CommCityName,
                    _pageVM.CommTownName,
                    _pageVM.CommLi,
                    _pageVM.CommLin,
                    _pageVM.CommAddress,
                    _pageVM.HomeTelCountry,
                    _pageVM.HomeTelArea,
                    _pageVM.HomeTelNumber,
                    _pageVM.OfficeTelCountry,
                    _pageVM.OfficeTelArea,
                    _pageVM.OfficeTelNumber,
                    _pageVM.OfficeExtNumber,
                    _pageVM.MobileCountry,
                    _pageVM.MobileNumber,
                    _pageVM.FaxTelCountry,
                    _pageVM.FaxTelArea,
                    _pageVM.FaxTelNumber,
                    _pageVM.Email,
                    _pageVM.StatementCode,
                    _pageVM.OldStatementCode,
                    StatementAddrByHouse = _pageVM.StatementAddrByHouse ? "Y" : "N",
                    StatementAddrByComm  = _pageVM.StatementAddrByComm ? "Y" : "N",
                    ShowStatementAddr    = _pageVM.ShowStatementAddr ? "Y" : "N",
                    HasOldAccount        = _pageVM.HasOldAccount ? "Y" : "N",
                    IsPreProcAccount     = _pageVM.IsPreProcAccount ? "Y" : "N",
                    _pageVM.OldEnglishAddress,
                    _pageVM.OldEnglishName,

                    HouseFullAddress = fullHouseAddress,
                    CommFullAddress  = fullCommAddress,
                    HomeFullTel      = _pageVM.HomeTelArea + '-' + _pageVM.HomeTelNumber,
                    OfficeFullTel    = _pageVM.OfficeTelNumber != "" ? _pageVM.OfficeTelArea + '-' + _pageVM.OfficeTelNumber + (!string.IsNullOrEmpty(_pageVM.OfficeExtNumber) ? "  分機: " + _pageVM.OfficeExtNumber : "") : "",
                    MobileTel        = _pageVM.MobileNumber != "" ? _pageVM.MobileNumber : "",
                    FaxTel           = _pageVM.FaxTelNumber != "" ? _pageVM.FaxTelArea + '-' + _pageVM.FaxTelNumber : "",
                    EmailAddr        = _pageVM.Email != "" ? _pageVM.Email : "",
                    Statement        = statement != null ? statement.Name : "",
                    StatementAddr    = statement.Code != "Q" && statement.Code != "NA" ? (_pageVM.StatementAddrByHouse ? "同戶籍地址;" + fullHouseAddress : "同通訊地址;" + fullCommAddress) : "",
                };

                _pageVM.Clear();

                string json = JsonConvert.SerializeObject(model);
                _kernelService.TransactionDataCache.Set(KioskDataCacheKey.PersonalData170, json);

                PageResult result = new PageResult("Confirm", KioskDataCacheKey.PersonalData170);
                _kernelService.NextPage(result);
            }
        }
예제 #6
0
        private void btnConfirm_Click(object sender, RoutedEventArgs e)
        {
            List <string> errorList = new List <string>();

            PageViewUtils.GetErrors(errorList, grdForm);

            string mobile = _pageVM.Mobile.Replace("-", "").Trim();

            if (_pageVM.ApplyEBank && string.IsNullOrEmpty(mobile))
            {
                errorList.Add("勾選申請網路銀行時個人行動電話必須填寫,請回前頁重新確認");
            }
            else
            {
                string eMobile = _pageVM.eMobile.Replace("-", "").Trim();
                if (_pageVM.ApplyEMobileService && string.IsNullOrEmpty(eMobile) && !_pageVM.OldAccountEMobileCodeApplied)
                {
                    errorList.Add("勾選行動e碼服務行動電話必須填寫");
                }

                if (_pageVM.EBankNonDealTRF && !_pageVM.ApplyEMobileService)
                {
                    errorList.Add("勾選新臺幣非約定轉帳時行動e碼服務必須勾選");
                }

                if (_pageVM.EBankNonDealTRF && !_pageVM.ApplySSL)
                {
                    errorList.Add("勾選新臺幣非約定轉帳時SSL機制必須勾選");
                }
            }

            if (errorList.Count > 0)
            {
                ScalingModal sm    = new ScalingModal(MainGrid, InnerGrid);
                var          popup = new ValidationErrorDialog(errorList.ToArray(), sm);
                sm.Expand(popup, ScalingModalExpandCollapseAnimation.SlideB);
            }
            else
            {
                _pageVM.StopTimer();

                List <string> applyEBanks = new List <string>();
                if (_pageVM.ApplySSL)
                {
                    applyEBanks.Add("SSL機制");
                }
                if (_pageVM.TRFSameNameAccount)
                {
                    applyEBanks.Add("轉入本人本行新臺幣帳戶");
                }
                if (_pageVM.EBankNonDealTRF)
                {
                    applyEBanks.Add("新臺幣非約定轉帳");
                }
                if (_pageVM.ExchangeClaimService)
                {
                    applyEBanks.Add("網路外匯申報服務");
                }
                if (_pageVM.OnlineTRFAccount)
                {
                    applyEBanks.Add("新臺幣線上設定轉入帳號");
                }
                if (_pageVM.MobileBank)
                {
                    applyEBanks.Add("行動銀行服務");
                }
                if (_pageVM.ApplyEMobileService)
                {
                    applyEBanks.Add("行動e碼");
                }

                string applyEBankDesc = string.Join("、", applyEBanks.ToArray());

                var model = new
                {
                    ApplyEBank                 = _pageVM.ApplyEBank ? "Y" : "N",
                    ApplyEBankEnabled          = _pageVM.ApplyEBankEnabled ? "Y" : "N",
                    ApplySSL                   = _pageVM.ApplySSL ? "Y" : "N",
                    TRFSameNameAccount         = _pageVM.TRFSameNameAccount ? "Y" : "N",
                    EBankNonDealTRF            = _pageVM.EBankNonDealTRF ? "Y" : "N",
                    ExchangeClaimService       = _pageVM.ExchangeClaimService ? "Y" : "N",
                    OnlineTRFAccount           = _pageVM.OnlineTRFAccount ? "Y" : "N",
                    MobileBank                 = _pageVM.MobileBank ? "Y" : "N",
                    ApplyEMobileService        = _pageVM.ApplyEMobileService ? "Y" : "N",
                    ApplyEMobileServiceEnabled = _pageVM.ApplyEMobileServiceEnabled ? "Y" : "N",
                    _pageVM.Mobile,
                    _pageVM.eMobile,
                    _pageVM.eMobileReserved,
                    OldAccountEBankApplied       = _pageVM.OldAccountEBankApplied ? "Y" : "N",
                    OldAccountEMobileCodeApplied = _pageVM.OldAccountEMobileCodeApplied ? "Y" : "N",
                    _pageVM.Email,
                    HasOldAccount    = _pageVM.HasOldAccount ? "Y" : "N",
                    IsPreProcAccount = _pageVM.IsPreProcAccount ? "Y" : "N",
                    _pageVM.AccountType,
                    WarnningAccount   = _pageVM.WarnningAccount ? "Y" : "N",
                    IsShowWarnningMsg = _pageVM.IsShowWarnningMsg ? "Y" : "N",
                    _pageVM.WarnningMsg,
                    eMobileEnabled = _pageVM.eMobileEnabled ? "Y" : "N",

                    ApplyEBankDesc = _pageVM.ApplyEBank ? "是;" + applyEBankDesc : "否"
                };

                string json = JsonConvert.SerializeObject(model);
                _kernelService.TransactionDataCache.Set(KioskDataCacheKey.PersonalData186, json);

                PageResult result = new PageResult("Confirm", KioskDataCacheKey.PersonalData186);
                _kernelService.NextPage(result);
            }
        }
예제 #7
0
        private void btnConfirm_Click(object sender, RoutedEventArgs e)
        {
            List <string> errorList = new List <string>();

            PageViewUtils.GetErrors(errorList, grdForm);

            if (_pageVM.FundSourceB && string.IsNullOrEmpty(_pageVM.FundSourceBDesc))
            {
                errorList.Add("勾選資金來源B其他內容未填寫");
            }

            int fundSourceCount = 0;

            if (_pageVM.FundSource1)
            {
                fundSourceCount++;
            }
            if (_pageVM.FundSource2)
            {
                fundSourceCount++;
            }
            if (_pageVM.FundSource3)
            {
                fundSourceCount++;
            }
            if (_pageVM.FundSource4)
            {
                fundSourceCount++;
            }
            if (_pageVM.FundSource5)
            {
                fundSourceCount++;
            }
            if (_pageVM.FundSource6)
            {
                fundSourceCount++;
            }
            if (_pageVM.FundSource7)
            {
                fundSourceCount++;
            }
            if (_pageVM.FundSource8)
            {
                fundSourceCount++;
            }
            if (_pageVM.FundSource9)
            {
                fundSourceCount++;
            }
            if (_pageVM.FundSourceA)
            {
                fundSourceCount++;
            }
            if (_pageVM.FundSourceB)
            {
                fundSourceCount++;
            }

            if (fundSourceCount == 0)
            {
                errorList.Add("資金來源必須至少需勾選一項");
            }

            if (_pageVM.FundSourceA && string.IsNullOrEmpty(_pageVM.FundSourceADesc))
            {
                errorList.Add("主要交易對象及商品未填寫");
            }

            if (errorList.Count > 0)
            {
                ScalingModal sm    = new ScalingModal(MainGrid, InnerGrid);
                var          popup = new ValidationErrorDialog(errorList.ToArray(), sm);
                sm.Expand(popup, ScalingModalExpandCollapseAnimation.SlideB);
            }
            else
            {
                _pageVM.StopTimer();

                List <string> fundSources = new List <string>();
                if (_pageVM.FundSource1)
                {
                    fundSources.Add("薪資");
                }
                if (_pageVM.FundSource2)
                {
                    fundSources.Add("獎金");
                }
                if (_pageVM.FundSource3)
                {
                    fundSources.Add("投資孳息/紅利");
                }
                if (_pageVM.FundSource4)
                {
                    fundSources.Add("退休金");
                }
                if (_pageVM.FundSource5)
                {
                    fundSources.Add("遺產");
                }
                if (_pageVM.FundSource6)
                {
                    fundSources.Add("保險金所得");
                }
                if (_pageVM.FundSource7)
                {
                    fundSources.Add("房租或物業出售");
                }
                if (_pageVM.FundSource8)
                {
                    fundSources.Add("信託收入");
                }
                if (_pageVM.FundSource9)
                {
                    fundSources.Add("投資出售");
                }
                if (_pageVM.FundSourceA)
                {
                    fundSources.Add($"營業收入({_pageVM.FundSourceADesc})");
                }
                if (_pageVM.FundSourceB)
                {
                    fundSources.Add($"其他({_pageVM.FundSourceBDesc})");
                }

                string fundSourceDesc = string.Join("、", fundSources.ToArray());

                var model = new
                {
                    FundSource1 = _pageVM.FundSource1 ? "Y" : "N",
                    FundSource2 = _pageVM.FundSource2 ? "Y" : "N",
                    FundSource3 = _pageVM.FundSource3 ? "Y" : "N",
                    FundSource4 = _pageVM.FundSource4 ? "Y" : "N",
                    FundSource5 = _pageVM.FundSource5 ? "Y" : "N",
                    FundSource6 = _pageVM.FundSource6 ? "Y" : "N",
                    FundSource7 = _pageVM.FundSource7 ? "Y" : "N",
                    FundSource8 = _pageVM.FundSource8 ? "Y" : "N",
                    FundSource9 = _pageVM.FundSource9 ? "Y" : "N",
                    FundSourceA = _pageVM.FundSourceA ? "Y" : "N",
                    _pageVM.FundSourceADesc,
                    FundSourceB = _pageVM.FundSourceB ? "Y" : "N",
                    _pageVM.FundSourceBDesc,
                    HasOldAccount    = _pageVM.HasOldAccount ? "Y" : "N",
                    IsPreProcAccount = _pageVM.IsPreProcAccount ? "Y" : "N",

                    FundSourceDesc = fundSourceDesc
                };

                _pageVM.Clear();

                string json = JsonConvert.SerializeObject(model);
                _kernelService.TransactionDataCache.Set(KioskDataCacheKey.PersonalData175, json);

                PageResult result = new PageResult("Confirm", KioskDataCacheKey.PersonalData175);
                _kernelService.NextPage(result);
            }
        }
예제 #8
0
        private void btnConfirm_Click(object sender, RoutedEventArgs e)
        {
            List <string> errorList = new List <string>();

            PageViewUtils.GetErrors(errorList, grdForm);

            List <int> wealthySources = new List <int>();

            if (_pageVM.WealthySource1)
            {
                wealthySources.Add(1);
            }
            if (_pageVM.WealthySource2)
            {
                wealthySources.Add(2);
            }
            if (_pageVM.WealthySource3)
            {
                wealthySources.Add(3);
            }
            if (_pageVM.WealthySource4)
            {
                wealthySources.Add(4);
            }
            if (_pageVM.WealthySource5)
            {
                wealthySources.Add(5);
            }
            if (_pageVM.WealthySource6)
            {
                wealthySources.Add(6);
            }

            if (wealthySources.Count == 0)
            {
                errorList.Add("財富來源1~6項目至少需勾選一項");
            }

            if (_pageVM.WealthySource1 && !_pageVM.WealthySource1A && !_pageVM.WealthySource1B)
            {
                errorList.Add("1就業所得右方項目至少需勾選一項");
            }

            if (_pageVM.WealthySource1B && string.IsNullOrEmpty(_pageVM.WealthySource1BDesc))
            {
                errorList.Add("勾選1B營業收入經營年期未填寫");
            }

            if (_pageVM.WealthySource2 && !_pageVM.WealthySource2A && !_pageVM.WealthySource2B && !_pageVM.WealthySource2C && !_pageVM.WealthySource2D && !_pageVM.WealthySource2E)
            {
                errorList.Add("2投資孳息右方項目至少需勾選一項");
            }

            if (_pageVM.WealthySource2E && string.IsNullOrEmpty(_pageVM.WealthySource2EDesc))
            {
                errorList.Add("勾選2E投資孳息E其他說明欄位未填寫");
            }

            if (_pageVM.WealthySource3 && !_pageVM.WealthySource3A && !_pageVM.WealthySource3B && !_pageVM.WealthySource3C && !_pageVM.WealthySource3D && !_pageVM.WealthySource3E)
            {
                errorList.Add("3出售右方項目至少需勾選一項");
            }

            if (_pageVM.WealthySource6 && string.IsNullOrEmpty(_pageVM.WealthySource6Desc))
            {
                errorList.Add("勾選6其他說明欄位未填寫");
            }

            if (_pageVM.StampRefNumber && string.IsNullOrEmpty(_pageVM.StampRefNumberDesc))
            {
                errorList.Add("印鑑參照號碼未填寫");
            }

            if (_pageVM.StampRefNumber)
            {
                AccountCheck accChk = new AccountCheck();

                string actno = _pageVM.BranchNo + _pageVM.StampRefNumberDesc;

                string errMsg = accChk.Validate(actno);
                if (errMsg != "")
                {
                    errorList.Add("印鑑參照帳號檢核錯誤");
                    _kernelService.Logger.Error($"印鑑參照帳號({actno})檢核錯誤: {errMsg}");
                }
            }

            if (errorList.Count > 0)
            {
                ScalingModal sm    = new ScalingModal(MainGrid, InnerGrid);
                var          popup = new ValidationErrorDialog(errorList.ToArray(), sm);
                sm.Expand(popup, ScalingModalExpandCollapseAnimation.SlideB);
            }
            else
            {
                _pageVM.StopTimer();

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

                if (_pageVM.WealthySource1)
                {
                    string desc = "就業所得";
                    if (_pageVM.WealthySource1A)
                    {
                        desc += "-薪資";
                    }
                    else if (_pageVM.WealthySource1B)
                    {
                        desc += "-營業收入(" + _pageVM.WealthySource1BDesc + ")年";
                    }

                    wealthySourceNames.Add(desc);
                }
                if (_pageVM.WealthySource2)
                {
                    string desc = "投資孳息";
                    if (_pageVM.WealthySource2A)
                    {
                        desc += "-股利";
                    }
                    else if (_pageVM.WealthySource2B)
                    {
                        desc += "-利息";
                    }
                    else if (_pageVM.WealthySource2C)
                    {
                        desc += "-租賃收入";
                    }
                    else if (_pageVM.WealthySource2D)
                    {
                        desc += "-藝術品";
                    }
                    else if (_pageVM.WealthySource2E)
                    {
                        desc += "-其他(" + _pageVM.WealthySource2EDesc + ")";
                    }

                    wealthySourceNames.Add(desc);
                }
                if (_pageVM.WealthySource3)
                {
                    string desc = "出售";
                    if (_pageVM.WealthySource3A)
                    {
                        desc += "-營業";
                    }
                    else if (_pageVM.WealthySource3B)
                    {
                        desc += "投資";
                    }
                    else if (_pageVM.WealthySource3C)
                    {
                        desc += "-財產(動產/不動產)";
                    }
                    else if (_pageVM.WealthySource3D)
                    {
                        desc += "-股票";
                    }
                    else if (_pageVM.WealthySource3E)
                    {
                        desc += "-保險收益結算";
                    }

                    wealthySourceNames.Add(desc);
                }
                if (_pageVM.WealthySource4)
                {
                    wealthySourceNames.Add("退休金");
                }
                if (_pageVM.WealthySource5)
                {
                    wealthySourceNames.Add("繼承/家庭贈與");
                }
                if (_pageVM.WealthySource6)
                {
                    wealthySourceNames.Add($"其他({_pageVM.WealthySource6Desc})");
                }

                string wealthySourceDesc = string.Join("、", wealthySourceNames.ToArray());

                string wealthySrc1Other   = "";
                string wealthySrc1SubCode = GetWealthySourceSubCode(wealthySources[0], out wealthySrc1Other);

                string wealthySrc2Other   = "";
                string wealthySrc2SubCode = wealthySources.Count > 1 ? GetWealthySourceSubCode(wealthySources[1], out wealthySrc2Other) : "";

                string wealthySrc3Other   = "";
                string wealthySrc3SubCode = wealthySources.Count > 2 ? GetWealthySourceSubCode(wealthySources[2], out wealthySrc3Other) : "";

                var model = new
                {
                    WealthySource1        = _pageVM.WealthySource1 ? "Y" : "N",
                    WealthySource1A       = _pageVM.WealthySource1A ? "Y" : "N",
                    WealthySource1B       = _pageVM.WealthySource1B ? "Y" : "N",
                    WealthySource1BDesc   = _pageVM.WealthySource1B ? _pageVM.WealthySource1BDesc : "",
                    WealthySource2        = _pageVM.WealthySource2 ? "Y" : "N",
                    WealthySource2A       = _pageVM.WealthySource2A ? "Y" : "N",
                    WealthySource2B       = _pageVM.WealthySource2B ? "Y" : "N",
                    WealthySource2C       = _pageVM.WealthySource2C ? "Y" : "N",
                    WealthySource2D       = _pageVM.WealthySource2D ? "Y" : "N",
                    WealthySource2E       = _pageVM.WealthySource2E ? "Y" : "N",
                    WealthySource2EDesc   = _pageVM.WealthySource2E ? _pageVM.WealthySource2EDesc : "",
                    WealthySource3        = _pageVM.WealthySource3 ? "Y" : "N",
                    WealthySource3A       = _pageVM.WealthySource3A ? "Y" : "N",
                    WealthySource3B       = _pageVM.WealthySource3B ? "Y" : "N",
                    WealthySource3C       = _pageVM.WealthySource3C ? "Y" : "N",
                    WealthySource3D       = _pageVM.WealthySource3D ? "Y" : "N",
                    WealthySource3E       = _pageVM.WealthySource3E ? "Y" : "N",
                    WealthySource4        = _pageVM.WealthySource4 ? "Y" : "N",
                    WealthySource5        = _pageVM.WealthySource5 ? "Y" : "N",
                    WealthySource6        = _pageVM.WealthySource6 ? "Y" : "N",
                    WealthySource6Desc    = _pageVM.WealthySource6 ? _pageVM.WealthySource6Desc : "",
                    StampRefNumber        = _pageVM.StampRefNumber ? "Y" : "N",
                    StampRefNumberDesc    = _pageVM.StampRefNumber ? _pageVM.StampRefNumberDesc : "",
                    StampRefNumberEnabled = _pageVM.StampRefNumberEnabled ? "Y" : "N",
                    HasOldAccount         = _pageVM.HasOldAccount ? "Y" : "N",
                    IsPreProcAccount      = _pageVM.IsPreProcAccount ? "Y" : "N",
                    _pageVM.AccountType,
                    IsShowStampMsg = _pageVM.IsShowStampMsg ? "Y" : "N",

                    WealthySource1Code    = wealthySources[0].ToString(),
                    WealthySource1SubCode = wealthySrc1SubCode,
                    WealthySource1Other   = wealthySrc1Other,
                    WealthySource2Code    = wealthySources.Count > 1 ? wealthySources[1].ToString() : "",
                    WealthySource2SubCode = wealthySrc2SubCode,
                    WealthySource2Other   = wealthySrc2Other,
                    WealthySource3Code    = wealthySources.Count > 2 ? wealthySources[2].ToString() : "",
                    WealthySource3SubCode = wealthySrc3SubCode,
                    WealthySource3Other   = wealthySrc3Other,
                    WealthySourceDesc     = wealthySourceDesc,
                    StampRefAccNo         = _pageVM.StampRefNumber ? _pageVM.BranchNo + _pageVM.StampRefNumberDesc : ""
                };

                string json = JsonConvert.SerializeObject(model);
                _kernelService.TransactionDataCache.Set(KioskDataCacheKey.PersonalData177, json);

                _pageVM.Clear();

                PageResult result = new PageResult("Confirm", KioskDataCacheKey.PersonalData177);
                _kernelService.NextPage(result);
            }
        }
예제 #9
0
        private void btnConfirm_Click(object sender, RoutedEventArgs e)
        {
            List <string> errorList = new List <string>();

            PageViewUtils.GetErrors(errorList, grdForm);

            if (_pageVM.EnglishName.Contains("*"))
            {
                errorList.Add("英文姓名內容有誤,請重新確認!");
            }

            DateTime dtBirth = DateTime.MinValue;
            int      numOfYear;

            if (int.TryParse(_pageVM.BirthYear, out numOfYear))
            {
                string dob = string.Format("{0}/{1}/{2}", numOfYear + 1911, _pageVM.BirthMonth, _pageVM.BirthDay);
                if (!DateTime.TryParse(dob, out dtBirth))
                {
                    errorList.Add("出生日期格式不合法!");
                }
            }
            else
            {
                errorList.Add("出生日期格式不合法!");
            }

            if (dtBirth != DateTime.MinValue)
            {
                DateTime dtToday   = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 23, 59, 59);
                DateTime dtCompare = dtBirth.AddYears(20);

                if (dtToday < dtCompare)
                {
                    errorList.Add("未滿20歲不具開戶資格!");
                }
            }

            if (errorList.Count > 0)
            {
                ScalingModal sm    = new ScalingModal(MainGrid, InnerGrid);
                var          popup = new ValidationErrorDialog(errorList.ToArray(), sm);
                sm.Expand(popup, ScalingModalExpandCollapseAnimation.SlideB);
            }
            else
            {
                _pageVM.StopTimer();

                var model = new
                {
                    _pageVM.ChineseName,
                    _pageVM.EnglishName,
                    _pageVM.PID,
                    DateOfBirth = DateTime.Parse(string.Format("{0:D3}/{1:D2}/{2:D2}", numOfYear + 1911, _pageVM.BirthMonth, _pageVM.BirthDay)),
                    BirthYear   = string.Format("{0:D3}", _pageVM.BirthYear),
                    BirthMonth  = string.Format("{0:D2}", _pageVM.BirthMonth),
                    BirthDay    = string.Format("{0:D2}", _pageVM.BirthDay)
                };

                _pageVM.Clear();

                string json = JsonConvert.SerializeObject(model);
                _kernelService.TransactionDataCache.Set(KioskDataCacheKey.OCRConfirmData, json);

                PageResult result = new PageResult("Confirm", KioskDataCacheKey.OCRConfirmData);
                _kernelService.NextPage(result);
            }
        }
예제 #10
0
        private void btnConfirm_Click(object sender, RoutedEventArgs e)
        {
            List <string> errorList = new List <string>();

            PageViewUtils.GetErrors(errorList, grdForm);

            if (_pageVM.MajorJobSelected == null && string.IsNullOrEmpty(_pageVM.MajorJobName))
            {
                errorList.Add("就業情形未填寫");
            }

            if (_pageVM.RequireJobData && string.IsNullOrEmpty(_pageVM.CompanyName))
            {
                errorList.Add("服務機構未填寫");
            }

            if (_pageVM.RequireJobData && string.IsNullOrEmpty(_pageVM.CompanyTypeCode))
            {
                errorList.Add("機構性質為必選欄位");
            }

            if (_pageVM.RequireJobData && string.IsNullOrEmpty(_pageVM.MajorClassName))
            {
                errorList.Add("行業主分類為必選欄位");
            }

            if (_pageVM.RequireJobData && string.IsNullOrEmpty(_pageVM.SubClassName))
            {
                errorList.Add("行業子分類為必選欄位");
            }

            if (string.IsNullOrEmpty(_pageVM.AnnualIncomeCode))
            {
                errorList.Add("年收入為必選欄位");
            }

            if (string.IsNullOrEmpty(_pageVM.MonthlyAvgCode))
            {
                errorList.Add("預期月平均交易金額為必選欄位");
            }

            if (_pageVM.RequireJobData && string.IsNullOrEmpty(_pageVM.JobPositionName))
            {
                errorList.Add("職稱為必選欄位");
            }

            if (_pageVM.PurposeSelectItems.Count == 0)
            {
                errorList.Add("開戶目的必須至少需勾選一項");
            }

            if (_pageVM.OtherPurposeEnabled && string.IsNullOrEmpty(_pageVM.OtherPurpose))
            {
                errorList.Add("其他目的未填寫");
            }

            if (errorList.Count > 0)
            {
                ScalingModal sm    = new ScalingModal(MainGrid, InnerGrid);
                var          popup = new ValidationErrorDialog(errorList.ToArray(), sm);
                sm.Expand(popup, ScalingModalExpandCollapseAnimation.SlideB);
            }
            else
            {
                _pageVM.StopTimer();

                string purposeCode1 = _pageVM.PurposeSelectItems.Count > 0 ? _pageVM.PurposeSelectItems[0].Code : "";
                string purposeCode2 = _pageVM.PurposeSelectItems.Count > 1 ? _pageVM.PurposeSelectItems[1].Code : "";
                string purposeCode3 = _pageVM.PurposeSelectItems.Count > 2 ? _pageVM.PurposeSelectItems[2].Code : "";

                string purpose1Desc = "", purpose2Desc = "", purpose3Desc = "", purposeFullDesc = "";
                if (!string.IsNullOrEmpty(purposeCode1))
                {
                    purpose1Desc = _pageVM.PurposeDropdown.Data.Purposes.SingleOrDefault(x => x.Code == purposeCode1).Name;

                    if (purposeCode1 == "F")
                    {
                        purpose1Desc = purpose1Desc + "(" + _pageVM.OtherPurpose + ")";
                    }

                    purposeFullDesc = purpose1Desc;
                }

                if (!string.IsNullOrEmpty(purposeCode2))
                {
                    purpose2Desc = _pageVM.PurposeDropdown.Data.Purposes.SingleOrDefault(x => x.Code == purposeCode2).Name;

                    if (purposeCode2 == "F")
                    {
                        purpose2Desc = purpose2Desc + "(" + _pageVM.OtherPurpose + ")";
                    }

                    if (!string.IsNullOrEmpty(purposeFullDesc))
                    {
                        purposeFullDesc = purposeFullDesc + "; " + purpose2Desc;
                    }
                    else
                    {
                        purposeFullDesc = purpose2Desc;
                    }
                }

                if (!string.IsNullOrEmpty(purposeCode3))
                {
                    purpose3Desc = _pageVM.PurposeDropdown.Data.Purposes.SingleOrDefault(x => x.Code == purposeCode3).Name;

                    if (purposeCode3 == "F")
                    {
                        purpose3Desc = purpose3Desc + "(" + _pageVM.OtherPurpose + ")";
                    }

                    if (!string.IsNullOrEmpty(purposeFullDesc))
                    {
                        purposeFullDesc = purposeFullDesc + "; " + purpose3Desc;
                    }
                    else
                    {
                        purposeFullDesc = purpose3Desc;
                    }
                }

                var model = new
                {
                    _pageVM.MajorJobName,
                    _pageVM.CompanyName,
                    _pageVM.MajorClassName,
                    _pageVM.SubClassName,
                    _pageVM.CompanyTypeCode,
                    _pageVM.JobPositionName,
                    _pageVM.AnnualIncomeCode,
                    _pageVM.MonthlyAvgCode,
                    PurposeCode1 = purposeCode1,
                    PurposeCode2 = purposeCode2,
                    PurposeCode3 = purposeCode3,
                    _pageVM.OtherPurpose,
                    RequireJobData      = _pageVM.RequireJobData ? "Y" : "N",
                    PurposeEnabled      = _pageVM.PurposeEnabled ? "Y" : "N",
                    OtherPurposeEnabled = _pageVM.OtherPurposeEnabled ? "Y" : "N",
                    _pageVM.WarnResultA,

                    MajorJobDesc     = _pageVM.MajorJobName,
                    MajorJobKey      = _pageVM.MajorJobSelected != null ?_pageVM.MajorJobSelected.SN : "",
                    CompanyTitle     = _pageVM.MajorJobName == "在職中" ? _pageVM.CompanyName : "",
                    MajorClassTitle  = _pageVM.MajorClassName,
                    SubClassTitle    = _pageVM.SubClassName,
                    SubClassMegaCode = _pageVM.SubClassSelected != null ? _pageVM.SubClassSelected.MegaCode : "",
                    CompanyTypeName  = _pageVM.CompanyTypes.SingleOrDefault(x => x.Code == _pageVM.CompanyTypeCode) != null?
                                       _pageVM.CompanyTypes.SingleOrDefault(x => x.Code == _pageVM.CompanyTypeCode).Name : "",
                    JobTitle         = _pageVM.JobPositionName,
                    JobTitleKey      = _pageVM.JobPositionSelected != null ? _pageVM.JobPositionSelected.SN                                                                                            : "",
                    JobRiskLvl       = _pageVM.JobPositionSelected != null ? _pageVM.JobPositionSelected.RiskLevel                                                                                     : "",
                    AnnualIncomeDesc = !string.IsNullOrEmpty(_pageVM.AnnualIncomeCode) ? _pageVM.AnnualIncomeDropdown.Data.AnnualIncomes.SingleOrDefault(x => x.Code == _pageVM.AnnualIncomeCode).Name : "",
                    MonthlyAvgDesc   = !string.IsNullOrEmpty(_pageVM.MonthlyAvgCode) ? _pageVM.MonthlyAvgDropdown.Data.MonthlyAvgs.SingleOrDefault(x => x.Code == _pageVM.MonthlyAvgCode).Name         : "",
                    PurposeDesc      = purposeFullDesc
                };

                _pageVM.Clear();

                string json = JsonConvert.SerializeObject(model);
                _kernelService.TransactionDataCache.Set(KioskDataCacheKey.PersonalData172, json);

                PageResult result = new PageResult("Confirm", KioskDataCacheKey.PersonalData172);
                _kernelService.NextPage(result);
            }
        }