protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {

            // pass the DateTimeFormat information to DateTime.Parse
            DateTime myDateTime = DateTime.Parse(txtFirstPaymentDate.Text, ukCulture.DateTimeFormat);
            try
            {
                mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
                string clientname = client.GetClientsName(MySessionManager.ClientID).ToString();
                int noyrs = 0;
                if (!int.TryParse(txtNoYrs.Value, out noyrs))
                    txtNoYrs.Value = "0";

                LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
                loanApp.Update_IntialInterview(MySessionManager.AppID,
                                               0,
                                               Convert.ToInt32(ddlLoanType.Text),
                                               txtNatureOfBusiness.Value,
                                               ddlTypeOfBusiness.Text,
                                               noyrs,
                                               Convert.ToDecimal(txtAveMonthlyIncome.Value),
                                               appCode.Value.Trim(),
                                               Convert.ToDecimal(txtLoanAmount.Value.Trim()),
                                               Convert.ToDecimal(txtLoanAmount.Value.Trim()),
                                               Convert.ToDecimal(txtLoanAmount.Value.Trim()),
                                               clientname,
                                               Convert.ToInt32(txtDuration.Value.Trim()),
                                               Convert.ToInt32(ddlloanpurpose.Text),
                                               Convert.ToDecimal(txtInterestrate.Value.Trim()),
                                               myDateTime,
                                               Convert.ToInt32(ddlFrequency.Text),
                                               Convert.ToInt32(ddlInterestRate.Text),
                                               "");
                this.editskip.Value = "1";

                //loadLoanDetails(MySessionManager.AppID);
            }
            catch (Exception ex)
            {

                Console.WriteLine(ex.Message.ToString());


            }
        }
    }
Пример #2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            // pass the DateTimeFormat information to DateTime.Parse
            DateTime myDateTime = DateTime.Parse(txtFirstPaymentDate.Text, ukCulture.DateTimeFormat);
            try
            {
                mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
                string clientname = client.GetClientsName(MySessionManager.ClientID).ToString();
                int    noyrs      = 0;
                if (!int.TryParse(txtNoYrs.Value, out noyrs))
                {
                    txtNoYrs.Value = "0";
                }

                LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
                loanApp.Update_IntialInterview(MySessionManager.AppID,
                                               0,
                                               Convert.ToInt32(ddlLoanType.Text),
                                               txtNatureOfBusiness.Value,
                                               ddlTypeOfBusiness.Text,
                                               noyrs,
                                               Convert.ToDecimal(txtAveMonthlyIncome.Value),
                                               appCode.Value.Trim(),
                                               Convert.ToDecimal(txtLoanAmount.Value.Trim()),
                                               Convert.ToDecimal(txtLoanAmount.Value.Trim()),
                                               Convert.ToDecimal(txtLoanAmount.Value.Trim()),
                                               clientname,
                                               Convert.ToInt32(txtDuration.Value.Trim()),
                                               Convert.ToInt32(ddlloanpurpose.Text),
                                               Convert.ToDecimal(txtInterestrate.Value.Trim()),
                                               myDateTime,
                                               Convert.ToInt32(ddlFrequency.Text),
                                               Convert.ToInt32(ddlInterestRate.Text),
                                               "");
                this.editskip.Value = "1";

                //loadLoanDetails(MySessionManager.AppID);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message.ToString());
            }
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            try
            {
                // this.dtCompare.Visible = true;

                // fetch the en-GB culture
                CultureInfo ukCulture = new CultureInfo("en-GB");
                // pass the DateTimeFormat information to DateTime.Parse
                DateTime myDateTime = DateTime.Parse(txtFirstPaymentDate.Text, ukCulture.DateTimeFormat);

                mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
                string clientname = client.GetClientsName(MySessionManager.ClientID).ToString();
                int    noyrs      = 0;
                if (!int.TryParse(txtNoYrs.Value, out noyrs))
                {
                    txtNoYrs.Value = "0";
                }

                LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
                loanApp.Update_IntialInterview(MySessionManager.AppID,
                                               0,
                                               Convert.ToInt32(ddlLoanType.Text),
                                               txtNatureOfBusiness.Value,
                                               ddlTypeOfBusiness.Text,
                                               noyrs,
                                               Convert.ToDecimal(txtAveMonthlyIncome.Value),
                                               appCode.Value.Trim(),
                                               Convert.ToDecimal(txtLoanAmount.Value.Trim()),
                                               Convert.ToDecimal(txtLoanAmount.Value.Trim()),
                                               Convert.ToDecimal(txtLoanAmount.Value.Trim()),
                                               clientname,
                                               Convert.ToInt32(txtDuration.Value.Trim()),
                                               Convert.ToInt32(ddlloanpurpose.Text),
                                               Convert.ToDecimal(txtInterestrate.Value.Trim()),
                                               myDateTime,
                                               Convert.ToInt32("0"),
                                               Convert.ToInt32(ddlInterestRate.Text),
                                               "");
                this.editskip.Value = "2";

                //loadLoanDetails(MySessionManager.AppID);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message.ToString());
            }
            #region Obsolete
            //try
            //{
            //    mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
            //    string clientname = client.GetClientName(MySessionManager.ClientID)[0].datClientName.ToString();

            //int noofyrs = 0;
            //DateTime dt = DateTime.Parse(txtFirstPaymentDate.Text);
            //if (!(txtNoYrs.Value==""))
            //{
            //    noofyrs = Convert.ToInt32(txtNoYrs.Value.Trim());
            //}

            //LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
            //loanApp.Update_IntialInterview(MySessionManager.AppID,
            //                               0,
            //                               Convert.ToInt32(ddlLoanType.Text),
            //                               txtNatureOfBusiness.Value.Trim(),
            //                               ddlTypeOfBusiness.Text,
            //                               Convert.ToInt32 (noofyrs),
            //                               Convert.ToDecimal(txtAveMonthlyIncome.Value.Trim()),
            //                               GenerateAppNumber(),
            //                               Convert.ToDecimal(txtLoanAmount.Value.Trim()),
            //                               0,
            //                               0,
            //                               clientname,
            //                               Convert.ToInt32(txtDuration.Value.Trim()),
            //                               Convert.ToInt32(ddlloanpurpose.Text),
            //                               Convert.ToDecimal(txtInterestrate.Value.Trim()),
            //                               dt,
            //                               Convert.ToInt32(ddlFrequency.Text),
            //                               Convert.ToInt32(ddlInterestRate.Text),
            //                               "");

            //}
            //catch
            //{
            //}
            #endregion
        }
        else
        {
            // this.vIntialAssesment.ErrorMessage =
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            try
            {
                // this.dtCompare.Visible = true;

                // fetch the en-GB culture
                CultureInfo ukCulture = new CultureInfo("en-GB");
                // pass the DateTimeFormat information to DateTime.Parse
                DateTime myDateTime = DateTime.Parse(txtFirstPaymentDate.Text, ukCulture.DateTimeFormat);

                mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
                string clientname = client.GetClientsName(MySessionManager.ClientID).ToString();
                int noyrs = 0;
                if (!int.TryParse(txtNoYrs.Value, out noyrs))
                    txtNoYrs.Value = "0";

                LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
                loanApp.Update_IntialInterview(MySessionManager.AppID,
                                               0,
                                               Convert.ToInt32(ddlLoanType.Text),
                                               txtNatureOfBusiness.Value,
                                               ddlTypeOfBusiness.Text,
                                               noyrs,
                                               Convert.ToDecimal(txtAveMonthlyIncome.Value),
                                               appCode.Value.Trim(),
                                               Convert.ToDecimal(txtLoanAmount.Value.Trim()),
                                               Convert.ToDecimal(txtLoanAmount.Value.Trim()),
                                               Convert.ToDecimal(txtLoanAmount.Value.Trim()),
                                               clientname,
                                               Convert.ToInt32(txtDuration.Value.Trim()),
                                               Convert.ToInt32(ddlloanpurpose.Text),
                                               Convert.ToDecimal(txtInterestrate.Value.Trim()),
                                               myDateTime,
                                               Convert.ToInt32("0"),
                                               Convert.ToInt32(ddlInterestRate.Text),
                                               "");
                this.editskip.Value = "2";

                //loadLoanDetails(MySessionManager.AppID);

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message.ToString());
            }
            #region Obsolete
            //try
            //{
            //    mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
            //    string clientname = client.GetClientName(MySessionManager.ClientID)[0].datClientName.ToString();

            //int noofyrs = 0;
            //DateTime dt = DateTime.Parse(txtFirstPaymentDate.Text);
            //if (!(txtNoYrs.Value==""))
            //{
            //    noofyrs = Convert.ToInt32(txtNoYrs.Value.Trim());
            //}

            //LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
            //loanApp.Update_IntialInterview(MySessionManager.AppID,
            //                               0,
            //                               Convert.ToInt32(ddlLoanType.Text),
            //                               txtNatureOfBusiness.Value.Trim(),
            //                               ddlTypeOfBusiness.Text,
            //                               Convert.ToInt32 (noofyrs),
            //                               Convert.ToDecimal(txtAveMonthlyIncome.Value.Trim()),
            //                               GenerateAppNumber(),
            //                               Convert.ToDecimal(txtLoanAmount.Value.Trim()),
            //                               0,
            //                               0,
            //                               clientname,
            //                               Convert.ToInt32(txtDuration.Value.Trim()),
            //                               Convert.ToInt32(ddlloanpurpose.Text),
            //                               Convert.ToDecimal(txtInterestrate.Value.Trim()),
            //                               dt,
            //                               Convert.ToInt32(ddlFrequency.Text),
            //                               Convert.ToInt32(ddlInterestRate.Text),
            //                               "");

            //}
            //catch
            //{
            //} 
            #endregion
        }
        else
        {
          // this.vIntialAssesment.ErrorMessage = 
        
        
        }

    }