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