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