Пример #1
0
 private void LoadList()
 {
     try
     {
         InstituteBLL instituteBLL = new InstituteBLL();
         DataTable    dt           = instituteBLL.GetAll();
         rptrList.DataSource = dt;
         rptrList.DataBind();
     }
     catch (Exception)
     {
         //throw;
     }
 }
Пример #2
0
 private void GenerateCode()
 {
     try
     {
         QuaintLibraryManager lib = new QuaintLibraryManager();
         ModelCode = CodePrefix.Institute + "-" + lib.GetSixDigitNumber(1);
         InstituteBLL instituteBLL = new InstituteBLL();
         DataTable    dt           = instituteBLL.GetAll();
         if (dt != null)
         {
             if (dt.Rows.Count > 0)
             {
                 string[] lastCode       = dt.Rows[dt.Rows.Count - 1]["InstituteCode"].ToString().Split('-');
                 int      lastCodeNumber = Convert.ToInt32(lastCode[1]);
                 ModelCode = CodePrefix.Institute + "-" + lib.GetSixDigitNumber(lastCodeNumber + 1);
             }
         }
     }
     catch (Exception)
     {
         Alert(AlertType.Error, "Failed to load.");
     }
 }