Esempio n. 1
0
 /// <summary>
 /// 从服务器获取所有模块
 /// </summary>
 /// <returns></returns>
 protected bool GetModules()
 {
     Modules = null;
     try
     {
         string message;
         Modules = PharmacyDatabaseService.AllModules(out message)
                   .OrderBy(m => m.Name)
                   .OrderBy(m => m.Index)
                   .ToList();
         if (!string.IsNullOrWhiteSpace(message))
         {
             throw new Exception(message);
         }
         return(true);
     }
     catch (Exception ex)
     {
         Modules = null;
         ex      = new Exception("从服务器获取所有模块失败", ex);
         Log.Error(ex);
         MessageBox.Show(this.Text + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Stop);
         return(false);
     }
 }