public void loadAsset(int id)
    {
        adminTableAdapters.GetOptRepaymentThresholdTableAdapter RT = new adminTableAdapters.GetOptRepaymentThresholdTableAdapter();
        admin.GetOptRepaymentThresholdDataTable tbl = RT.GetRepaymentThresholdDetails(id);

        if (tbl.Rows.Count > 0)
        {
            txtDescription.Value = tbl[0].datDescription.ToString();
            txtMaxLimit.Value    = tbl[0].datMax.ToString();
            txtMinLimit.Value    = tbl[0].datMin.ToString();
            this.editskip.Value  = "2";
        }
    }
 public void loadAsset(int id)
 {
     adminTableAdapters.GetOptRepaymentThresholdTableAdapter RT = new adminTableAdapters.GetOptRepaymentThresholdTableAdapter();
     admin.GetOptRepaymentThresholdDataTable tbl = RT.GetRepaymentThresholdDetails(id);
     
     if (tbl.Rows.Count > 0)
     {
         txtDescription.Value = tbl[0].datDescription.ToString();
         txtMaxLimit.Value = tbl[0].datMax.ToString();
         txtMinLimit.Value = tbl[0].datMin.ToString();
         this.editskip.Value = "2";
     }
   }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        adminTableAdapters.GetOptRepaymentThresholdTableAdapter RT = new adminTableAdapters.GetOptRepaymentThresholdTableAdapter();
        if (!(type == "update"))
        {
            RT.InsertRepaymentThreshold(txtDescription.Value.Trim(),
                                        Convert.ToDecimal(txtMinLimit.Value.Trim()),
                                        Convert.ToDecimal(txtMaxLimit.Value.Trim()));
        }
        else if (type == "update")
        {
            RT.UpdateRepaymentThreshold(txtDescription.Value.Trim(),
                                        Convert.ToDecimal(txtMinLimit.Value.Trim()),
                                        Convert.ToDecimal(txtMaxLimit.Value.Trim()),
                                        id);
        }

        Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "rtedit"));
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        adminTableAdapters.GetOptRepaymentThresholdTableAdapter RT = new adminTableAdapters.GetOptRepaymentThresholdTableAdapter();
        if (!(type == "update"))
        {

            RT.InsertRepaymentThreshold(txtDescription.Value.Trim(),
                                        Convert.ToDecimal(txtMinLimit.Value.Trim()),
                                        Convert.ToDecimal(txtMaxLimit.Value.Trim()));
        }
        else if (type == "update")
        {
            RT.UpdateRepaymentThreshold(txtDescription.Value.Trim(),
                                        Convert.ToDecimal(txtMinLimit.Value.Trim()),
                                        Convert.ToDecimal(txtMaxLimit.Value.Trim()),
                                        id);
        }

        Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "rtedit"));
    }