Пример #1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            adminTableAdapters.GetLoanCategoriesTableAdapter loanCategories = new adminTableAdapters.GetLoanCategoriesTableAdapter();
            if (!(type == "update"))
            {
                loanCategories.InsertLoanCategories(txtCategories.Value.Trim(),
                                                    Convert.ToInt32(txtMinDays.Value.Trim()),
                                                    Convert.ToInt32(txtMaxDays.Value.Trim()),
                                                    ddlPerformance.SelectedValue,
                                                    Convert.ToDecimal(txtPF.Value.Trim()));
            }
            else if (type == "update")
            {
                loanCategories.UpdateLoanCategories(txtCategories.Value.Trim(),
                                                    Convert.ToInt32(txtMinDays.Value.Trim()),
                                                    Convert.ToInt32(txtMaxDays.Value.Trim()),
                                                    ddlPerformance.SelectedValue,
                                                    Convert.ToDecimal(txtPF.Value),
                                                    id);
            }

            Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "lcedit"));
        }
        catch (Exception ex) { }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            adminTableAdapters.GetLoanCategoriesTableAdapter loanCategories = new adminTableAdapters.GetLoanCategoriesTableAdapter();
            if (!(type == "update"))
            {
                loanCategories.InsertLoanCategories(txtCategories.Value.Trim(),
                                                    Convert.ToInt32(txtMinDays.Value.Trim()),
                                                    Convert.ToInt32(txtMaxDays.Value.Trim()),
                                                    ddlPerformance.SelectedValue,
                                                    Convert.ToDecimal(txtPF.Value.Trim()));

            }
            else if (type == "update")
            {
                loanCategories.UpdateLoanCategories(txtCategories.Value.Trim(),
                                                    Convert.ToInt32(txtMinDays.Value.Trim()),
                                                    Convert.ToInt32(txtMaxDays.Value.Trim()),
                                                    ddlPerformance.SelectedValue,
                                                    Convert.ToDecimal(txtPF.Value),
                                                    id);
            }

            Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "lcedit"));
        }
        catch (Exception ex) { }
    }
    public void loadLoanCat(int id)
    {
        adminTableAdapters.GetLoanCategoriesTableAdapter loanCat = new adminTableAdapters.GetLoanCategoriesTableAdapter();
        admin.GetLoanCategoriesDataTable tbl = loanCat.GetLoanCategoriesDetails(id);

        if (tbl.Rows.Count > 0)
        {
            txtCategories.Value = tbl[0].datDescription.ToString();
            txtMinDays.Value = tbl[0].datMinDays.ToString();
            txtMaxDays.Value = tbl[0].datMaxDays.ToString();
            if (tbl[0].datPerformance.ToString().Length > 0) { ddlPerformance.SelectedValue = tbl[0].datPerformance.ToString(); }
           // txtPerformance.Value = tbl[0].datPerformance.ToString();
            txtPF.Value = tbl[0].datProvisionFactor.ToString();
            this.editskip.Value = "2";

        }
    }
Пример #4
0
    public void loadLoanCat(int id)
    {
        adminTableAdapters.GetLoanCategoriesTableAdapter loanCat = new adminTableAdapters.GetLoanCategoriesTableAdapter();
        admin.GetLoanCategoriesDataTable tbl = loanCat.GetLoanCategoriesDetails(id);

        if (tbl.Rows.Count > 0)
        {
            txtCategories.Value = tbl[0].datDescription.ToString();
            txtMinDays.Value    = tbl[0].datMinDays.ToString();
            txtMaxDays.Value    = tbl[0].datMaxDays.ToString();
            if (tbl[0].datPerformance.ToString().Length > 0)
            {
                ddlPerformance.SelectedValue = tbl[0].datPerformance.ToString();
            }
            // txtPerformance.Value = tbl[0].datPerformance.ToString();
            txtPF.Value         = tbl[0].datProvisionFactor.ToString();
            this.editskip.Value = "2";
        }
    }