CSDN博客

img huanghui22

Biz_Application

发表于2004/11/2 7:26:00  948人阅读

----------------Biz_ApplicationFacade.aspx

Public Function UpdateAnApplication(ByVal application As BIZ_Application) As EDataAccessState

            sql.OpenConnection()

            sql.BeginTransaction()

 

            Dim state As EDataAccessState

            'user detail update

            state = application.UpdateData(sql)

            If state <> EDataAccessState.Normal Then

                sql.RollbackTransaction()

            Else

               

                log.fk_User_ID = application.Create_ID

                log.fk_Action_Type = 2   'э

                log.fk_Resource_Type = 1    '╰参ノめ

                log.fk_Resource_ID = application.pk_Application_Code

                    ' Insert a log

                state = log.InsertData(sql)

                If state <> EDataAccessState.Normal Then

                    sql.RollbackTransaction()

                Else

                    sql.CommitTransaction()

                End If

                End If

            sql.CloseConnection()

            Return state

  End Function

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

            '硂柑竚ㄏノ祘Α絏﹍て呼

            'Make the page expire immediately

            Response.Cache.SetCacheability(HttpCacheability.NoCache)

 

            If Not IsPostBack Then

 

                Dim right As ERightType = Authorization.GetUserRight(Page)

                If Authorization.Pass(Me) = False Then

                    'Authorization failed

                    Page.Response.Redirect("../../../login.aspx")

                    '喷靡舦

                    'ElseIf right = ERightType.None Then

                    '  Page.Response.Redirect("../../../login.aspx")

                Else

                    viewstate.Add("Application_Status", "")

                    ResetAllControl()

                    Select Case Page.Request.QueryString("mode")

                        Case "view"      '聅凝家Α

                            ''''''''''''''''''''''''''''''''''''''''''''''''**********''''''''''''''''''''''''''''''

                            viewstate.Item("Application_Status") = "view"

                            SetPageState(False)

                            ShowData(Page.Request.QueryString("application_id"))

                        Case "edit"      '絪胯家Α

                            If right = ERightType.View Then

                                viewstate.Item("Application_Status") = "view"

                                SetPageState(False)

                                ShowData(Page.Request.QueryString("application_id"))

                            Else

                                viewstate.Item("Application_Status") = "edit"

                                SetPageState(True)

                                ShowData(Page.Request.QueryString("application_id"))

                            End If

 

                        Case "add"       '穝糤家Α

                            viewstate.Item("Application_Status") = "add"

                            SetPageState(True)

 

                        Case "review"    '糵家Α

                            viewstate.Item("Application_Status") = "review"

                            Session.Add("Application_IsNeedChecked", False)

                            ShowData(Page.Request.QueryString("application_id"))

                            SetPageState(False)

                    End Select

 

                End If

            End If

        End Sub

 

 

        'reset all sub control

        Private Sub ResetAllControl()

 

            'Dim userid As String = Session.Item("UserInfo")

            Dim userid As String = "steven"

            'ビ叫

            DataSourceGenerator.SetBankDataSourceByUserID(Me.ddlBankName.Items, userid)

 

            DataSourceGenerator.SetCreditCardDataSourceByBankIDAndUserID(Me.ddlCreditCardType.Items, Me.ddlBankName.SelectedValue, userid)

            Me.rbtRMB.Checked = True

            ''''''''''''''''''''''''''''''''''''''''''********************''''''''''''''''''

            Me.txtOtherCurrencyName.Text = ""

            ''''''''''''''''''''''''''''''''''''''''*********************''''''''''''''''

            Me.txtGoldenCardYearlyFee.Text = 0

            Me.txtNormalCardYearlyFee.Text = 0

            Me.txtSubCardYearlyFee.Text = 0

 

            'ビ叫獺

            Me.txtApplicantCName.Text = 0

            Me.rbtMan.Checked = True

            Me.txtApplicantCardNumber.Text = 0

            DataSourceGenerator.SetCommonDataSource(Me.ddlApplicantEducation.Items, ECodeType.EducationLevel)

            Me.txtApplicant_Address_Province.Text = ""

            Me.txtApplicant_Address_City.Text = ""

            Me.txtApplicant_Address_Zone.Text = ""

            Me.txtApplicant_Address_Other.Text = ""

            Me.txtApplicant_AddrZipCode.Text = ""

            Me.txtApplicant_AddrTEL_Zone.Text = ""

            Me.txtApplicant_AddrTEL_No.Text = ""

            Me.txtApplicant_Mobile.Text = ""

            Me.txtApplicant_Email.Text = ""

            Me.txtApplicant_OrgFullName.Text = ""

            Me.txtApplicant_TradeType.Text = ""

            Me.txtApplicant_OrgAddress_Province.Text = ""

            Me.txtApplicant_OrgAddress_City.Text = ""

            Me.txtApplicant_OrgAddress_Zone.Text = ""

            Me.txtApplicant_OrgAddress_Other.Text = ""

            Me.txtApplicant_OrgZipCode.Text = ""

            Me.txtApplicant_OrgTEL_Zone.Text = ""

            Me.txtApplicant_OrgTEL_No.Text = ""

            DataSourceGenerator.SetCommonDataSource(Me.ddlApplicant_PosLevel.Items, ECodeType.PositionLevel)

            DataSourceGenerator.SetCommonDataSource(Me.ddlApplicant_OrgType.Items, ECodeType.OrgnizationType)

            Me.txtApplicant_WorkXP_Year.Text = 0

            Me.txtApplicant_WorkXP_Month.Text = 0

            Me.txtApplicant_YearlyIncome.Text = ""

            Me.txtApplicant_HouseAddress_Province.Text = ""

            Me.txtApplicant_HouseAddress_City.Text = ""

            Me.txtApplicant_HouseAddress_Zone.Text = ""

            Me.txtApplicant_HouseAddress_Other.Text = ""

 

            '踞玂獺

            Me.txtRelative_CName.Text = ""

            Me.txtRelative_AddrTEL_Zone.Text = ""

            Me.txtRelative_AddrTEL_No.Text = ""

            Me.txtRelative_OrgName.Text = ""

            Me.txtRelative_OrgTEL_Zone.Text = ""

            Me.txtRelative_OrgTEL_No.Text = ""

            Me.txtRelative_Mobile.Text = ""

 

            Me.txtContact_CName.Text = ""

            Me.txtContact_AddrTEL_Zone.Text = ""

            Me.txtContact_AddrTEL_No.Text = ""

            Me.txtContact_OrgName.Text = ""

            Me.txtContact_OrgTEL_Zone.Text = ""

            Me.txtContact_OrgTEL_No.Text = ""

            Me.txtContact_Mobile.Text = ""

 

            'ㄤ

            'DataSourceGenerator.GetPosLevel(Me.ddlActivityCode.Items)

            'DataSourceGenerator.SetSaleChannelDataSource(Me.ddlSalesPipeCode.Items)

            Me.txtBranchCode.Text = ""

            Me.txtRemark.Text = ""

            DataSourceGenerator.SetSellerDataSourceByUserID(Me.ddlSalesCode.Items, userid)

 

            '糵

            Me.rbtCheckPass.Checked = True

            Me.rbtCheckFail.Checked = False

            Me.txtReason.Text = ""

 

 

        End Sub

 

        'Set edit area state, enabled or disabled

        Private Sub SetPageState(ByVal EditEnabled As Boolean)

            'ビ叫

            Me.ddlBankName.Enabled = EditEnabled

            Me.ddlBankName.CssClass = Convertor.SetStateCSS(ddlBankName.CssClass, EditEnabled)

            Me.ddlCreditCardType.Enabled = EditEnabled

            Me.ddlCreditCardType.CssClass = Convertor.SetStateCSS(ddlCreditCardType.CssClass, EditEnabled)

            Me.rbtRMB.Enabled = EditEnabled

            Me.rbtRMB.CssClass = Convertor.SetStateCSS(rbtRMB.CssClass, EditEnabled)

            Me.rbtDollar.Enabled = EditEnabled

            Me.rbtDollar.CssClass = Convertor.SetStateCSS(rbtDollar.CssClass, EditEnabled)

            Me.rbtHKCurrency.Enabled = EditEnabled

            Me.rbtHKCurrency.CssClass = Convertor.SetStateCSS(rbtHKCurrency.CssClass, EditEnabled)

            Me.rbtOtherCurrency.Enabled = EditEnabled

            Me.rbtOtherCurrency.CssClass = Convertor.SetStateCSS(rbtOtherCurrency.CssClass, EditEnabled)

            Me.txtOtherCurrencyName.ReadOnly = Not EditEnabled

            Me.txtOtherCurrencyName.CssClass = Convertor.SetStateCSS(txtOtherCurrencyName.CssClass, EditEnabled)

            Me.txtGoldenCardYearlyFee.ReadOnly = Not EditEnabled

            Me.txtGoldenCardYearlyFee.CssClass = Convertor.SetStateCSS(txtGoldenCardYearlyFee.CssClass, EditEnabled)

            Me.txtNormalCardYearlyFee.ReadOnly = Not EditEnabled

            Me.txtNormalCardYearlyFee.CssClass = Convertor.SetStateCSS(txtNormalCardYearlyFee.CssClass, EditEnabled)

            Me.txtSubCardYearlyFee.ReadOnly = Not EditEnabled

            Me.txtSubCardYearlyFee.CssClass = Convertor.SetStateCSS(txtSubCardYearlyFee.CssClass, EditEnabled)

 

            'ビ叫獺

            Me.txtApplicantCName.ReadOnly = Not EditEnabled

            Me.txtApplicantCName.CssClass = Convertor.SetStateCSS(txtApplicantCName.CssClass, EditEnabled)

            Me.rbtMan.Enabled = EditEnabled

            Me.rbtMan.CssClass = Convertor.SetStateCSS(rbtMan.CssClass, EditEnabled)

            Me.rbtWoman.Enabled = EditEnabled

            Me.rbtWoman.CssClass = Convertor.SetStateCSS(rbtWoman.CssClass, EditEnabled)

            Me.txtApplicantCardNumber.ReadOnly = Not EditEnabled

            Me.txtApplicantCardNumber.CssClass = Convertor.SetStateCSS(txtApplicantCardNumber.CssClass, EditEnabled)

            Me.UCdatBirthday.Enable = EditEnabled

            Me.ddlApplicantEducation.Enabled = EditEnabled

            Me.ddlApplicantEducation.CssClass = Convertor.SetStateCSS(ddlApplicantEducation.CssClass, EditEnabled)

            Me.txtApplicant_Address_Province.ReadOnly = Not EditEnabled

            Me.txtApplicant_Address_Province.CssClass = Convertor.SetStateCSS(txtApplicant_Address_Province.CssClass, EditEnabled)

            Me.txtApplicant_Address_City.ReadOnly = Not EditEnabled

            Me.txtApplicant_Address_City.CssClass = Convertor.SetStateCSS(txtApplicant_Address_City.CssClass, EditEnabled)

            Me.txtApplicant_Address_Zone.ReadOnly = Not EditEnabled

            Me.txtApplicant_Address_Zone.CssClass = Convertor.SetStateCSS(txtApplicant_Address_Zone.CssClass, EditEnabled)

            Me.txtApplicant_Address_Other.ReadOnly = Not EditEnabled

            Me.txtApplicant_Address_Other.CssClass = Convertor.SetStateCSS(txtApplicant_Address_Other.CssClass, EditEnabled)

            Me.txtApplicant_AddrZipCode.ReadOnly = Not EditEnabled

            Me.txtApplicant_AddrZipCode.CssClass = Convertor.SetStateCSS(txtApplicant_AddrZipCode.CssClass, EditEnabled)

            Me.txtApplicant_AddrTEL_Zone.ReadOnly = Not EditEnabled

            Me.txtApplicant_AddrTEL_Zone.CssClass = Convertor.SetStateCSS(txtApplicant_AddrTEL_Zone.CssClass, EditEnabled)

            Me.txtApplicant_AddrTEL_No.ReadOnly = Not EditEnabled

            Me.txtApplicant_AddrTEL_No.CssClass = Convertor.SetStateCSS(txtApplicant_AddrTEL_No.CssClass, EditEnabled)

            Me.txtApplicant_Mobile.ReadOnly = Not EditEnabled

            Me.txtApplicant_Mobile.CssClass = Convertor.SetStateCSS(txtApplicant_Mobile.CssClass, EditEnabled)

            Me.txtApplicant_Email.ReadOnly = Not EditEnabled

            Me.txtApplicant_Email.CssClass = Convertor.SetStateCSS(txtApplicant_Email.CssClass, EditEnabled)

            Me.txtApplicant_OrgFullName.ReadOnly = Not EditEnabled

            Me.txtApplicant_OrgFullName.CssClass = Convertor.SetStateCSS(txtApplicant_OrgFullName.CssClass, EditEnabled)

            Me.txtApplicant_TradeType.ReadOnly = Not EditEnabled

            Me.txtApplicant_TradeType.CssClass = Convertor.SetStateCSS(txtApplicant_TradeType.CssClass, EditEnabled)

            Me.txtApplicant_OrgAddress_Province.ReadOnly = Not EditEnabled

            Me.txtApplicant_OrgAddress_Province.CssClass = Convertor.SetStateCSS(txtApplicant_OrgAddress_Province.CssClass, EditEnabled)

            Me.txtApplicant_OrgAddress_City.ReadOnly = Not EditEnabled

            Me.txtApplicant_OrgAddress_City.CssClass = Convertor.SetStateCSS(txtApplicant_OrgAddress_City.CssClass, EditEnabled)

            Me.txtApplicant_OrgAddress_Zone.ReadOnly = Not EditEnabled

            Me.txtApplicant_OrgAddress_Zone.CssClass = Convertor.SetStateCSS(txtApplicant_OrgAddress_Zone.CssClass, EditEnabled)

            Me.txtApplicant_OrgAddress_Other.ReadOnly = Not EditEnabled

            Me.txtApplicant_OrgAddress_Other.CssClass = Convertor.SetStateCSS(txtApplicant_OrgAddress_Other.CssClass, EditEnabled)

            Me.txtApplicant_OrgZipCode.ReadOnly = Not EditEnabled

            Me.txtApplicant_OrgZipCode.CssClass = Convertor.SetStateCSS(txtApplicant_OrgZipCode.CssClass, EditEnabled)

            Me.txtApplicant_OrgTEL_Zone.ReadOnly = Not EditEnabled

            Me.txtApplicant_OrgTEL_Zone.CssClass = Convertor.SetStateCSS(txtApplicant_OrgTEL_Zone.CssClass, EditEnabled)

            Me.txtApplicant_OrgTEL_No.ReadOnly = Not EditEnabled

            Me.txtApplicant_OrgTEL_No.CssClass = Convertor.SetStateCSS(txtApplicant_OrgTEL_No.CssClass, EditEnabled)

            Me.ddlApplicant_PosLevel.Enabled = EditEnabled

            Me.ddlApplicant_PosLevel.CssClass = Convertor.SetStateCSS(ddlApplicant_PosLevel.CssClass, EditEnabled)

            Me.ddlApplicant_OrgType.Enabled = EditEnabled

            Me.ddlApplicant_OrgType.CssClass = Convertor.SetStateCSS(ddlApplicant_OrgType.CssClass, EditEnabled)

            Me.txtApplicant_WorkXP_Year.ReadOnly = Not EditEnabled

            Me.txtApplicant_WorkXP_Year.CssClass = Convertor.SetStateCSS(txtApplicant_WorkXP_Year.CssClass, EditEnabled)

            Me.txtApplicant_WorkXP_Month.ReadOnly = Not EditEnabled

            Me.txtApplicant_WorkXP_Month.CssClass = Convertor.SetStateCSS(txtApplicant_WorkXP_Month.CssClass, EditEnabled)

            Me.txtApplicant_YearlyIncome.ReadOnly = Not EditEnabled

            Me.txtApplicant_YearlyIncome.CssClass = Convertor.SetStateCSS(txtApplicant_YearlyIncome.CssClass, EditEnabled)

            Me.txtApplicant_HouseAddress_Province.ReadOnly = Not EditEnabled

            Me.txtApplicant_HouseAddress_Province.CssClass = Convertor.SetStateCSS(txtApplicant_HouseAddress_Province.CssClass, EditEnabled)

            Me.txtApplicant_HouseAddress_City.ReadOnly = Not EditEnabled

            Me.txtApplicant_HouseAddress_City.CssClass = Convertor.SetStateCSS(txtApplicant_HouseAddress_City.CssClass, EditEnabled)

            Me.txtApplicant_HouseAddress_Zone.ReadOnly = Not EditEnabled

            Me.txtApplicant_HouseAddress_Zone.CssClass = Convertor.SetStateCSS(txtApplicant_HouseAddress_Zone.CssClass, EditEnabled)

            Me.txtApplicant_HouseAddress_Other.ReadOnly = Not EditEnabled

            Me.txtApplicant_HouseAddress_Other.CssClass = Convertor.SetStateCSS(txtApplicant_HouseAddress_Other.CssClass, EditEnabled)

 

 

            '踞玂獺

            Me.txtRelative_CName.ReadOnly = Not EditEnabled

            Me.txtRelative_CName.CssClass = Convertor.SetStateCSS(txtRelative_CName.CssClass, EditEnabled)

            Me.txtRelative_AddrTEL_Zone.ReadOnly = Not EditEnabled

            Me.txtRelative_AddrTEL_Zone.CssClass = Convertor.SetStateCSS(txtRelative_AddrTEL_Zone.CssClass, EditEnabled)

            Me.txtRelative_AddrTEL_No.ReadOnly = Not EditEnabled

            Me.txtRelative_AddrTEL_No.CssClass = Convertor.SetStateCSS(txtRelative_AddrTEL_No.CssClass, EditEnabled)

            Me.txtRelative_OrgName.ReadOnly = Not EditEnabled

            Me.txtRelative_OrgName.CssClass = Convertor.SetStateCSS(txtRelative_OrgName.CssClass, EditEnabled)

            Me.txtRelative_OrgTEL_Zone.ReadOnly = Not EditEnabled

            Me.txtRelative_OrgTEL_Zone.CssClass = Convertor.SetStateCSS(txtRelative_OrgTEL_Zone.CssClass, EditEnabled)

            Me.txtRelative_OrgTEL_No.ReadOnly = Not EditEnabled

            Me.txtRelative_OrgTEL_No.CssClass = Convertor.SetStateCSS(txtRelative_OrgTEL_No.CssClass, EditEnabled)

            Me.txtRelative_Mobile.ReadOnly = Not EditEnabled

            Me.txtRelative_Mobile.CssClass = Convertor.SetStateCSS(txtRelative_Mobile.CssClass, EditEnabled)

 

            Me.txtContact_CName.ReadOnly = Not EditEnabled

            Me.txtContact_CName.CssClass = Convertor.SetStateCSS(txtContact_CName.CssClass, EditEnabled)

            Me.txtContact_AddrTEL_Zone.ReadOnly = Not EditEnabled

            Me.txtContact_AddrTEL_Zone.CssClass = Convertor.SetStateCSS(txtContact_AddrTEL_Zone.CssClass, EditEnabled)

            Me.txtContact_AddrTEL_No.ReadOnly = Not EditEnabled

            Me.txtContact_AddrTEL_No.CssClass = Convertor.SetStateCSS(txtContact_AddrTEL_No.CssClass, EditEnabled)

            Me.txtContact_OrgName.ReadOnly = Not EditEnabled

            Me.txtContact_OrgName.CssClass = Convertor.SetStateCSS(txtContact_OrgName.CssClass, EditEnabled)

            Me.txtContact_OrgTEL_Zone.ReadOnly = Not EditEnabled

            Me.txtContact_OrgTEL_Zone.CssClass = Convertor.SetStateCSS(txtContact_OrgTEL_Zone.CssClass, EditEnabled)

            Me.txtContact_OrgTEL_No.ReadOnly = Not EditEnabled

            Me.txtContact_OrgTEL_No.CssClass = Convertor.SetStateCSS(txtContact_OrgTEL_No.CssClass, EditEnabled)

            Me.txtContact_Mobile.ReadOnly = Not EditEnabled

            Me.txtContact_Mobile.CssClass = Convertor.SetStateCSS(txtContact_Mobile.CssClass, EditEnabled)

 

            'ㄤ

            Me.UCdatKeyinDate.Enable = False

            Me.ddlActivityCode.Enabled = EditEnabled

            Me.ddlActivityCode.CssClass = Convertor.SetStateCSS(ddlActivityCode.CssClass, EditEnabled)

            Me.ddlSalesPipeCode.Enabled = EditEnabled

            Me.ddlSalesPipeCode.CssClass = Convertor.SetStateCSS(ddlSalesPipeCode.CssClass, EditEnabled)

            Me.txtBranchCode.ReadOnly = Not EditEnabled

            Me.txtBranchCode.CssClass = Convertor.SetStateCSS(txtBranchCode.CssClass, EditEnabled)

            Me.txtRemark.ReadOnly = Not EditEnabled

            Me.txtRemark.CssClass = Convertor.SetStateCSS(txtRemark.CssClass, EditEnabled)

            Me.ddlSalesCode.Enabled = EditEnabled

            Me.ddlSalesCode.CssClass = Convertor.SetStateCSS(ddlSalesCode.CssClass, EditEnabled)

            '''''''''''''''''''''''''''*******************************''''''''''''''''''''''''''''''''''''''''''''''

            '糵

            'Me.rbtCheckPass.Enabled = EditEnabled

            'Me.rbtCheckPass.CssClass = Convertor.SetStateCSS(rbtCheckPass.CssClass, EditEnabled)

            'Me.rbtCheckFail.Enabled = EditEnabled

            'Me.rbtCheckFail.CssClass = Convertor.SetStateCSS(rbtCheckFail.CssClass, EditEnabled)

            'Me.txtReason.ReadOnly = Not EditEnabled

            'Me.txtReason.CssClass = Convertor.SetStateCSS(txtReason.CssClass, EditEnabled)

 

            '龄跋

            If viewstate.Item("Application_Status") = "review" Then

                Me.btnLeft.Visible = Not EditEnabled

                Me.btnLeft.CssClass = Convertor.SetStateCSS(btnLeft.CssClass, Not EditEnabled)

                Me.btnRight.Visible = Not EditEnabled

                Me.btnRight.CssClass = Convertor.SetStateCSS(btnRight.CssClass, Not EditEnabled)

            Else

                Me.btnLeft.Visible = EditEnabled

                Me.btnLeft.CssClass = Convertor.SetStateCSS(btnLeft.CssClass, EditEnabled)

                Me.btnRight.Visible = EditEnabled

                Me.btnRight.CssClass = Convertor.SetStateCSS(btnRight.CssClass, EditEnabled)

            End If

 

            If viewstate.Item("Application_Status") = "view" OrElse (viewstate.Item("Application_Status") = "review" And Session.Item("Application_IsNeedChecked") <> True) Then

                Me.btnOk.Visible = False

                Me.btnOk.CssClass = Convertor.SetStateCSS(btnOk.CssClass, False)

            Else

                Me.btnOk.Visible = True

                Me.btnOk.CssClass = Convertor.SetStateCSS(btnOk.CssClass, True)

            End If

 

            ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

            If viewstate.Item("Application_Status") = "review" And Session.Item("Application_IsNeedChecked") = True Then

                Me.rbtCheckPass.Enabled = True

                Me.rbtCheckPass.CssClass = Convertor.SetStateCSS(rbtCheckPass.CssClass, True)

                Me.rbtCheckFail.Enabled = True

                Me.rbtCheckFail.CssClass = Convertor.SetStateCSS(rbtCheckFail.CssClass, True)

                Me.txtReason.ReadOnly = False

                Me.txtReason.CssClass = Convertor.SetStateCSS(txtReason.CssClass, True)

            Else

                Me.rbtCheckPass.Enabled = False

                Me.rbtCheckPass.CssClass = Convertor.SetStateCSS(rbtCheckPass.CssClass, False)

                Me.rbtCheckFail.Enabled = False

                Me.rbtCheckFail.CssClass = Convertor.SetStateCSS(rbtCheckFail.CssClass, False)

                Me.txtReason.ReadOnly = True

                Me.txtReason.CssClass = Convertor.SetStateCSS(txtReason.CssClass, False)

                '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

            End If

 

        End Sub

 

        Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnOk.Click

 

            Dim application As BIZ_Application

            Dim applicationAccess As New BIZ_ApplicationFacade

            Dim serialNumber As New CMN_SerialNumber

            Dim serialnumberAccess As New CMN_SerialNumberFacade

            Dim application_history As New BIZ_ApplicationHistory

            'Dim application_historyAccess As New BIZ_ApplicationHistoryFacade

 

            If viewstate.Item("Application_Status") = "add" Then

                application = New BIZ_Application

 

                application.fk_Status = 1   '穝ン

                serialNumber.pk_System_ID = "CSMS"

                serialNumber.pk_Serial_ID = "application"

                serialnumberAccess.GetASerialNumber(serialNumber)

                application.pk_Application_Code = GenerateApplicationCode(serialNumber.Serial_Number)

                application.fk_Report_Code1 = ""

                application.fk_Report_Code2 = ""

                application.Create_ID = "steven"

                serialNumber.Serial_Number = application.pk_Application_Code

            End If

            '''''''''''''''''''''******************"'''''''''''''''''

            If viewstate.Item("Application_Status") = "edit" Then

                application = Session.Item("Application_MT")

 

                application.fk_Status = 1   '穝ン

                application.Upd_ID = "steven"

            End If

            ''''''''''*********************************''''''''''''''''

            '''''''''''************************''''''''''

            If viewstate.Item("Application_Status") = "review" Then

                application = Session.Item("Application_MT")

                application.Upd_ID = "steven"

            End If

 

            '''''''''''''************************'''''''''''''

            Me.SetApplicationValues(application)

 

            If viewstate.Item("Application_Status") = "add" Then

                If applicationAccess.AddAApplication(application, serialNumber, application_history) = EDataAccessState.Normal Then

                    AlertScript.ShowAlert(Me, "", AlertScript.Message.AddSuccess)

                    'Page.Response.Redirect("Application_QD.aspx?action=addSuccess")

                Else

                    AlertScript.ShowAlert(Me, "", AlertScript.Message.AddFailed)

                End If

            End If

            '''''''''''''****************8''''''''''''''

            If viewstate.Item("Application_Status") = "edit" Then

                If applicationAccess.UpdateAnApplication(application) = EDataAccessState.Normal Then

                    AlertScript.ShowAlert(Me, "", AlertScript.Message.ModifySuccess)

                    'Page.Response.Redirect("Application_QD.aspx?action=editSuccess")

                Else

                    AlertScript.ShowAlert(Me, "", AlertScript.Message.ModifyFailed)

                End If

            End If

            '''''''''''***********888''''''''''''''

            '''''''''''************************''''''''''

            If viewstate.Item("Application_Status") = "review" Then

                If Me.rbtCheckPass.Checked = True Then

 

                End If

            End If

 

            '''''''''''''************************'''''''''''''

 

        End Sub

 

        Private Function GenerateApplicationCode(ByVal str As String)

            Dim i As Integer

            Dim strAppCode As String

            strAppCode = str + 1

            While strAppCode.Length <> str.Length

                strAppCode = "0" + strAppCode

            End While

            Return strAppCode

        End Function

 

        Private Sub SetApplicationValues(ByRef application As BIZ_Application)

            'ビ叫

            application.fk_Bank_ID = Me.ddlBankName.SelectedValue

            application.fk_CreditCard_ID = Me.ddlCreditCardType.SelectedValue

            If Me.rbtRMB.Checked Then

                application.fk_Currency = 1

                application.OtherCurrency_Name = ""

            ElseIf Me.rbtDollar.Checked Then

                application.fk_Currency = 2

                application.OtherCurrency_Name = ""

            ElseIf Me.rbtHKCurrency.Checked Then

                application.fk_Currency = 3

                application.OtherCurrency_Name = ""

            Else

                application.fk_Currency = 0

                application.OtherCurrency_Name = Me.txtOtherCurrencyName.Text

            End If

            application.GoldenCardYearlyFee = Me.txtGoldenCardYearlyFee.Text

            application.NormalCardYearlyFee = Me.txtNormalCardYearlyFee.Text

            application.SubCardYearlyFee = Me.txtSubCardYearlyFee.Text

 

            'ビ叫獺

            application.Applicant_CName = Me.txtApplicantCName.Text

            If Me.rbtMan.Checked Then

                application.Applicant_Gender = 0

            Else

                application.Applicant_Gender = 1

            End If

            application.Applicant_CardNo = Me.txtApplicantCardNumber.Text

            If Me.UCdatBirthday.tbx <> "" Then

                application.Applicant_Birthday = Me.UCdatBirthday.tbx

            Else

                application.Applicant_Birthday = Nothing

            End If

            If Me.ddlApplicantEducation.SelectedIndex <> 0 Then

                application.Applicant_Education = Me.ddlApplicantEducation.SelectedValue

            Else

                application.Applicant_Education = Nothing

            End If

            application.Applicant_Address_Province = Me.txtApplicant_Address_Province.Text

            application.Applicant_Address_City = Me.txtApplicant_Address_City.Text

            application.Applicant_Address_Zone = Me.txtApplicant_Address_Zone.Text

            application.Applicant_Address_Other = Me.txtApplicant_Address_Other.Text

            application.Applicant_AddrZipCode = Me.txtApplicant_AddrZipCode.Text

            application.Applicant_AddrTEL_Zone = Me.txtApplicant_AddrTEL_Zone.Text

            application.Applicant_AddrTEL_No = Me.txtApplicant_AddrTEL_No.Text

            application.Applicant_Mobile = Me.txtApplicant_Mobile.Text

            application.Applicant_Email = Me.txtApplicant_Email.Text

            application.Applicant_OrgFullName = Me.txtApplicant_OrgFullName.Text

            application.Applicant_TradeType = Me.txtApplicant_TradeType.Text

            application.Applicant_OrgAddress_Province = Me.txtApplicant_OrgAddress_Province.Text

            application.Applicant_OrgAddress_City = Me.txtApplicant_OrgAddress_City.Text

            application.Applicant_OrgAddress_Zone = Me.txtApplicant_OrgAddress_Zone.Text

            application.Applicant_OrgAddress_Other = Me.txtApplicant_OrgAddress_Other.Text

            application.Applicant_OrgZipCode = Me.txtApplicant_OrgZipCode.Text

            application.Applicant_OrgTEL_Zone = Me.txtApplicant_OrgTEL_Zone.Text

            application.Applicant_OrgTEL_No = Me.txtApplicant_OrgTEL_No.Text

            If Me.ddlApplicant_PosLevel.SelectedIndex <> 0 Then

                application.Applicant_PosLevel = Me.ddlApplicant_PosLevel.SelectedValue

            Else

                application.Applicant_PosLevel = Nothing

            End If

            If Me.ddlApplicant_OrgType.SelectedIndex <> 0 Then

                application.Applicant_OrgType = Me.ddlApplicant_OrgType.SelectedValue

            Else

                application.Applicant_OrgType = Nothing

            End If

            application.Applicant_WorkXP_Year = Me.txtApplicant_WorkXP_Year.Text

            application.Applicant_WorkXP_Month = Me.txtApplicant_WorkXP_Month.Text

            application.Applicant_YearlyIncome = Me.txtApplicant_YearlyIncome.Text

            application.Applicant_HouseAddress_Province = Me.txtApplicant_HouseAddress_Province.Text

            application.Applicant_HouseAddress_City = Me.txtApplicant_HouseAddress_City.Text

            application.Applicant_HouseAddress_Zone = Me.txtApplicant_HouseAddress_Zone.Text

            application.Applicant_HouseAddress_Other = Me.txtApplicant_HouseAddress_Other.Text

 

            '踞玂獺

            application.Relative_CName = Me.txtRelative_CName.Text

            application.Relative_AddrTEL_Zone = Me.txtRelative_AddrTEL_Zone.Text

            application.Relative_AddrTEL_No = Me.txtRelative_AddrTEL_No.Text

            application.Relative_OrgName = Me.txtRelative_OrgName.Text

            application.Relative_OrgTEL_Zone = Me.txtRelative_OrgTEL_Zone.Text

            application.Relative_OrgTEL_No = Me.txtRelative_OrgTEL_No.Text

            application.Relative_Mobile = Me.txtRelative_Mobile.Text

 

            application.Contact_CName = Me.txtContact_CName.Text

            application.Contact_AddrTEL_Zone = Me.txtContact_AddrTEL_Zone.Text

            application.Contact_AddrTEL_No = Me.txtContact_AddrTEL_No.Text

            application.Contact_OrgName = Me.txtContact_OrgName.Text

            application.Contact_OrgTEL_Zone = Me.txtContact_OrgTEL_Zone.Text

            application.Contact_OrgTEL_No = Me.txtContact_OrgTEL_No.Text

            application.Contact_Mobile = Me.txtContact_Mobile.Text

 

            'ㄤ

            'application.Keyin_DateTime =

            application.ActivityCode = Me.ddlActivityCode.SelectedValue

            application.SalesPipeCode = Me.ddlSalesPipeCode.SelectedValue

            application.BranchCode = Me.txtBranchCode.Text

            application.Remark = Me.txtRemark.Text

            application.SalesCode = Me.ddlSalesCode.SelectedValue

        End Sub

 

        Private Sub ddlBankName_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddlBankName.SelectedIndexChanged

            Dim userid As String = "steven"

            DataSourceGenerator.SetCreditCardDataSourceByBankIDAndUserID(Me.ddlCreditCardType.Items, Me.ddlBankName.SelectedValue, userid)

        End Sub

        '''''''''''''''''''''''''''''''''''''''''''''''''''''*********************88''''''''''''''''''''''''''''''''''''''

        Private Sub ShowData(ByVal application_id As String)

            Dim application As New BIZ_Application

            Dim applicationAccess As New BIZ_ApplicationFacade

            applicationAccess.GetAnApplication(application)

 

            Session.Add("Application_MT", application)

 

            'ビ叫

            Me.ddlBankName.SelectedIndex = Me.ddlBankName.Items.IndexOf(Me.ddlBankName.Items.FindByValue(application.fk_Bank_ID))

            Me.ddlCreditCardType.SelectedIndex = Me.ddlCreditCardType.Items.IndexOf(Me.ddlCreditCardType.Items.FindByValue(application.fk_CreditCard_ID))

            If application.fk_Currency = 0 Then

                Me.rbtOtherCurrency.Checked = True

                Me.txtOtherCurrencyName.Text = application.OtherCurrency_Name

            ElseIf application.fk_Currency = 1 Then

                Me.rbtRMB.Checked = True

                Me.txtOtherCurrencyName.Text = ""

            ElseIf application.fk_Currency = 21 Then

                Me.rbtDollar.Checked = True

                Me.txtOtherCurrencyName.Text = ""

            Else

                Me.rbtHKCurrency.Checked = True

                Me.txtOtherCurrencyName.Text = ""

            End If

            Me.txtOtherCurrencyName.Text = application.OtherCurrency_Name

            Me.txtGoldenCardYearlyFee.Text = application.GoldenCardYearlyFee

            Me.txtNormalCardYearlyFee.Text = application.NormalCardYearlyFee

            Me.txtSubCardYearlyFee.Text = application.SubCardYearlyFee

 

 

            'ビ叫獺

            Me.txtApplicantCName.Text = application.Applicant_CName

            If application.Applicant_Gender = 0 Then

                Me.rbtMan.Checked = True

            ElseIf application.Applicant_Gender = 1 Then

                Me.rbtWoman.Checked = True

            End If

            Me.txtApplicantCardNumber.Text = application.Applicant_CardNo

            If application.Applicant_Birthday <> Nothing Then

                Me.UCdatBirthday.tbx = application.Applicant_Birthday

            Else

                Me.UCdatBirthday.tbx = Nothing

            End If

            If application.Applicant_Education <> 0 Then

                Me.ddlApplicantEducation.SelectedIndex = Me.ddlApplicantEducation.Items.IndexOf(Me.ddlApplicantEducation.Items.FindByValue(application.Applicant_Education))

            Else

                Me.ddlApplicantEducation.SelectedIndex = 0

            End If

            Me.txtApplicant_Address_Province.Text = application.Applicant_Address_Province

            Me.txtApplicant_Address_City.Text = application.Applicant_Address_City

            Me.txtApplicant_Address_Zone.Text = application.Applicant_Address_Zone

            Me.txtApplicant_Address_Other.Text = application.Applicant_Address_Other

            Me.txtApplicant_AddrZipCode.Text = application.Applicant_AddrZipCode

            Me.txtApplicant_AddrTEL_Zone.Text = application.Applicant_AddrTEL_Zone

            Me.txtApplicant_AddrTEL_No.Text = application.Applicant_AddrTEL_No

            Me.txtApplicant_Mobile.Text = application.Applicant_Mobile

            Me.txtApplicant_Email.Text = application.Applicant_Email

            Me.txtApplicant_OrgFullName.Text = application.Applicant_OrgFullName

            Me.txtApplicant_TradeType.Text = application.Applicant_TradeType

            Me.txtApplicant_OrgAddress_Province.Text = application.Applicant_OrgAddress_Province

            Me.txtApplicant_OrgAddress_City.Text = application.Applicant_OrgAddress_City

            Me.txtApplicant_OrgAddress_Zone.Text = application.Applicant_OrgAddress_Zone

            Me.txtApplicant_OrgAddress_Other.Text = application.Applicant_OrgAddress_Other

            Me.txtApplicant_OrgZipCode.Text = application.Applicant_OrgZipCode

            Me.txtApplicant_OrgTEL_Zone.Text = application.Applicant_OrgTEL_Zone

            Me.txtApplicant_OrgTEL_No.Text = application.Applicant_OrgTEL_No

            If application.Applicant_PosLevel <> 0 Then

                Me.ddlApplicant_PosLevel.SelectedIndex = Me.ddlApplicant_PosLevel.Items.IndexOf(Me.ddlApplicant_PosLevel.Items.FindByValue(application.Applicant_PosLevel))

            Else

                Me.ddlApplicant_PosLevel.SelectedIndex = 0

            End If

            If application.Applicant_OrgType <> 0 Then

                Me.ddlApplicant_OrgType.SelectedIndex = Me.ddlApplicant_OrgType.Items.IndexOf(Me.ddlApplicant_OrgType.Items.FindByValue(application.Applicant_OrgType))

            Else

                Me.ddlApplicant_OrgType.SelectedIndex = 0

            End If

            Me.txtApplicant_WorkXP_Year.Text = application.Applicant_WorkXP_Year

            Me.txtApplicant_WorkXP_Month.Text = application.Applicant_WorkXP_Month

            Me.txtApplicant_YearlyIncome.Text = application.Applicant_YearlyIncome

            Me.txtApplicant_HouseAddress_Province.Text = application.Applicant_HouseAddress_Province

            Me.txtApplicant_HouseAddress_City.Text = application.Applicant_HouseAddress_City

            Me.txtApplicant_HouseAddress_Zone.Text = application.Applicant_HouseAddress_Zone

            Me.txtApplicant_HouseAddress_Other.Text = application.Applicant_HouseAddress_Other

 

            '踞玂獺

            Me.txtRelative_CName.Text = application.Relative_CName

            Me.txtRelative_AddrTEL_Zone.Text = application.Relative_AddrTEL_Zone

            Me.txtRelative_AddrTEL_No.Text = application.Relative_AddrTEL_No

            Me.txtRelative_OrgName.Text = application.Relative_OrgName

            Me.txtRelative_OrgTEL_Zone.Text = application.Relative_OrgTEL_Zone

            Me.txtRelative_OrgTEL_No.Text = application.Relative_OrgTEL_No

 

            Me.txtRelative_Mobile.Text = application.Relative_Mobile

            Me.txtContact_CName.Text = application.Contact_CName

            Me.txtContact_AddrTEL_Zone.Text = application.Contact_AddrTEL_Zone

            Me.txtContact_AddrTEL_No.Text = application.Contact_AddrTEL_No

            Me.txtContact_OrgName.Text = application.Contact_OrgName

            Me.txtContact_OrgTEL_Zone.Text = application.Contact_OrgTEL_Zone

            Me.txtContact_OrgTEL_No.Text = application.Contact_OrgTEL_No

            Me.txtContact_Mobile.Text = application.Contact_Mobile

 

            'application.Keyin_DateTime =

            If application.ActivityCode <> 0 Then

                Me.ddlActivityCode.SelectedIndex = Me.ddlActivityCode.Items.IndexOf(Me.ddlActivityCode.Items.FindByValue(application.ActivityCode))

            Else

                Me.ddlActivityCode.SelectedIndex = 0

            End If

            If application.SalesPipeCode <> 0 Then

                Me.ddlSalesPipeCode.SelectedIndex = Me.ddlSalesPipeCode.Items.IndexOf(Me.ddlSalesPipeCode.Items.FindByValue(application.SalesPipeCode))

            Else

                Me.ddlSalesPipeCode.SelectedIndex = 0

            End If

            Me.txtBranchCode.Text = application.BranchCode

            Me.txtRemark.Text = application.Remark

            If application.SalesCode <> 0 Then

                Me.ddlSalesCode.SelectedIndex = Me.ddlSalesCode.Items.IndexOf(Me.ddlSalesCode.Items.FindByValue(application.SalesCode))

            Else

                Me.ddlSalesCode.SelectedIndex = 0

            End If

            ''''''''''''''''**************************'''''''''''''''''''''

            'check

            If application.fk_Status = 4 Then

                Me.rbtCheckPass.Checked = True

                Me.txtReason.Text = ""

            ElseIf application.fk_Status = 5 Then

                Me.rbtCheckFail.Checked = True

                Me.txtReason.Text = application.Remark

            End If

 

            If application.fk_Status = 3 Then

                Session.Item("Application_IsNeedChecked") = True

                Me.rbtCheckPass.Checked = True

            End If

            ''''''''''''''''***************************'''''''''''''''

        End Sub

        ''''''''''''''''''''''''''''''''''''''''''''''***********************'''''''''''''''''

 

        Private Sub btnBack_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnBack.Click

            Dim strfrom As String = Page.Request.QueryString("from")

 

 

            If (Request.QueryString("topfrom") <> Nothing) Then

                Page.Response.Redirect(strfrom + ".aspx?from=" + Request.QueryString("topfrom"))

            Else

                Page.Response.Redirect(strfrom + ".aspx")

            End If

        End Sub

        ''''''''''''''''''''''**************************''''''''''''''''''''''''''''

    End Class

阅读全文
0 0

相关文章推荐

img
取 消
img