private void LoadList() { try { LenderBankBLL lenderBankBLL = new LenderBankBLL(); DataTable dt = lenderBankBLL.GetAll(); rptrList.DataSource = dt; rptrList.DataBind(); } catch (Exception) { //throw; } }
private void GenerateCode() { try { QuaintLibraryManager lib = new QuaintLibraryManager(); this.ModelCode = CodePrefix.Bank + "-" + lib.GetSixDigitNumber(1); LenderBankBLL lenderBankBLL = new LenderBankBLL(); DataTable dt = lenderBankBLL.GetAll(); if (dt != null) { if (dt.Rows.Count > 0) { string[] lastCode = dt.Rows[dt.Rows.Count - 1]["LenderBankCode"].ToString().Split('-'); int lastCodeNumber = Convert.ToInt32(lastCode[1]); this.ModelCode = CodePrefix.Bank + "-" + lib.GetSixDigitNumber(lastCodeNumber + 1); } } } catch (Exception) { Alert(AlertType.Error, "Failed to load."); } }