Пример #1
0
 /// <summary>
 /// 设置当前证书已经关联的经营范围
 /// </summary>
 private void SetGMSPLicenseBusinessScopes()
 {
     try
     {
         if (GMSPLicenseBusinessScopes == null)
         {
             LoadGMSPLicenseBusinessScopes();
         }
         if (GMSPLicenseBusinessScopes != null)
         {
             GMSPLicenseBusinessScopes.ForEach(gsmpScope =>
             {
                 var items = checkedListBoxGMSPLicenseBusinessScopes.Items;
                 for (int i = 0; i < items.Count; i++)
                 {
                     var businessScope = items[i] as BusinessScope;
                     if (businessScope != null)
                     {
                         if (businessScope.Id == gsmpScope.BusinessScopeId)
                         {
                             checkedListBoxGMSPLicenseBusinessScopes.SetItemChecked(i, true);
                         }
                     }
                 }
             });
         }
     }
     catch (Exception ex)
     {
         Log.Error(ex);
         //MessageBox.Show("设置当前证书已经关联的经营范围", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Stop);
         MessageBox.Show(this.Text + "设置当前证书已经关联的经营范围", "错误", MessageBoxButtons.OK, MessageBoxIcon.Stop);
     }
 }
Пример #2
0
 private bool GetGMSPLicenseBusinessScopes()
 {
     try
     {
         string msg = string.Empty;
         GMSPLicenseBusinessScopes = PharmacyDatabaseService.AllGMSPLicenseBusinessScopes(out msg).Where(d => d.GSPLicenseId == GSPLicense.Id && d.Deleted == false).ToList();
         if (GMSPLicenseBusinessScopes.Count != 0)
         {
             foreach (var gms in GMSPLicenseBusinessScopes)
             {
                 PharmacyDatabaseService.DeleteGMSPLicenseBusinessScope(out msg, gms.Id);
             }
         }
         if (GMSPLicenseBusinessScopes.Count == 0)
         {
             GMSPLicenseBusinessScopes = new List <GMSPLicenseBusinessScope>();
         }
         GMSPLicenseBusinessScopes.Clear();
         var items = checkedListBoxGMSPLicenseBusinessScopes.Items;
         for (int i = 0; i < items.Count; i++)
         {
             var businessScope = items[i] as BusinessScope;
             if (businessScope == null)
             {
                 continue;
             }
             if (!checkedListBoxGMSPLicenseBusinessScopes.GetItemChecked(i))
             {
                 continue;
             }
             GMSPLicenseBusinessScopes.Add(new GMSPLicenseBusinessScope
             {
                 Id = Guid.NewGuid()
                 ,
                 BusinessScopeId = businessScope.Id
                 ,
                 GSPLicenseId = GSPLicense.Id
                 ,
                 Deleted = false
             });
         }
         GSPLicense.GMSPLicenseBusinessScopes = GMSPLicenseBusinessScopes.ToArray();
         //foreach (GMSPLicenseBusinessScope gsm in GMSPLicenseBusinessScopes)
         //    return PharmacyDatabaseService.AddGMSPLicenseBusinessScope(out msg,gsm);
         return(true);
     }
     catch (Exception ex)
     {
         Log.Error(ex);
         //MessageBox.Show("从控件收集选择的经营范围失败", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Stop);
         MessageBox.Show(this.Text + "从控件收集选择的经营范围失败", "错误", MessageBoxButtons.OK, MessageBoxIcon.Stop);
         return(false);
     }
 }
Пример #3
0
 private bool GetGMSPLicenseBusinessScopes()
 {
     try
     {
         if (GMSPLicenseBusinessScopes == null)
         {
             GMSPLicenseBusinessScopes = new List <GMSPLicenseBusinessScope>();
         }
         GMSPLicenseBusinessScopes.Clear();
         var items = checkedListBoxGMSPLicenseBusinessScopes.Items;
         for (int i = 0; i < items.Count; i++)
         {
             var businessScope = items[i] as BusinessScope;
             if (businessScope == null)
             {
                 continue;
             }
             if (!checkedListBoxGMSPLicenseBusinessScopes.GetItemChecked(i))
             {
                 continue;
             }
             GMSPLicenseBusinessScopes.Add(new GMSPLicenseBusinessScope
             {
                 Id = Guid.NewGuid()
                 ,
                 BusinessScopeId = businessScope.Id
                 ,
                 GMSPLicenseId = GMSPLicense.Id
             });
         }
         GMSPLicense.GMSPLicenseBusinessScopes = GMSPLicenseBusinessScopes.ToArray();
         return(true);
     }
     catch (Exception ex)
     {
         Log.Error(ex);
         //MessageBox.Show("从控件收集选择的经营范围失败", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Stop);
         MessageBox.Show(this.Text + "从控件收集选择的经营范围失败", "错误", MessageBoxButtons.OK, MessageBoxIcon.Stop);
         return(false);
     }
 }