public void loadLoanType(int id) { adminTableAdapters.LoanTypesTableAdapter loantype = new adminTableAdapters.LoanTypesTableAdapter(); admin.LoanTypesDataTable tblLoanTypes = loantype.GetLoanType(id); if (tblLoanTypes.Rows.Count > 0) { txtDescription.Value = tblLoanTypes[0].datDescription.ToString(); this.editskip.Value = "2"; } }
protected void btnSave_Click(object sender, EventArgs e) { adminTableAdapters.LoanTypesTableAdapter loanTypes = new adminTableAdapters.LoanTypesTableAdapter(); if (!(type == "update")) { loanTypes.InsertLoanTypes(txtDescription.Value.Trim()); } else if (type == "update") { loanTypes.UpdateLoanType(txtDescription.Value.Trim(), id); } Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "ltedit")); }