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