예제 #1
0
 protected void InitializeDAL(string path)
 {
     //start wait cursor in case this takes a long time
     ActiveView.ShowWaitCursor();
     try
     {
         Database = new DAL(path);
     }
     //catch (CruiseDAL.DatabaseShareException)
     //{
     //    ActiveView.ShowMessage("File can not be opened in multiple applications");
     //}
     catch (FMSC.ORM.ReadOnlyException)
     {
         ActiveView.ShowMessage("Unable to open file because it is read only");
     }
     catch (FMSC.ORM.IncompatibleSchemaException ex)
     {
         ActiveView.ShowMessage("File is not compatible with this version of Cruise Manager: " + ex.Message);
     }
     catch (FMSC.ORM.SQLException ex)
     {
         ActiveView.ShowMessage("Unable to open file : " + ex.GetType().Name);
     }
     catch (System.IO.IOException ex)
     {
         ActiveView.ShowMessage("Unable to open file : " + ex.GetType().Name);
     }
     catch (System.Exception e)
     {
         if (!ExceptionHandler.Handel(e))
         {
             throw;
         }
     }
     finally
     {
         ActiveView.ShowDefaultCursor();
     }
 }