Пример #1
0
 public static List<Organisation> ListOrganisation(Guid? roleId)
 {
     DataLayer dataLayer = new DataLayer();
     List<Organisation> result = dataLayer.ListOrganisation();
     if (roleId.HasValue)
     {
         foreach (Organisation org in result)
         {
             org.ContactInformation = dataLayer.ListContactInformation(org.ContactInformationId).FirstOrDefault();
             org.OrgAdminUsers = dataLayer.ListUserRoleAuth(org.OrganisationId, null, roleId.Value);
         }
     }
     return result;
 }
Пример #2
0
 public static List<AspUser> ListOrgAdminAspUser(int orgId, Guid roleId)
 {
     DataLayer dataLayer = new DataLayer();
     List<AspUser> result = new List<AspUser>();
     List<UserRoleAuth> uraList = dataLayer.ListUserRoleAuth(orgId, null, roleId);
     if (uraList != null)
     {
         foreach (UserRoleAuth ura in uraList)
         {
             result.AddRange(dataLayer.ListAspUser(orgId, ura.UserId, null));
         }
         result = result.OrderByDescending(i => i.LastActivityDate).ToList();
     }
     return result;
 }
Пример #3
0
        public static List<Doctor> ListDoctor(int? orgId, int? siteId, int? doctorId, string firstName, string lastName, bool includeLegacy)
        {
            DataLayer dl = new DataLayer();
            List<Doctor> result = dl.ListDoctor(orgId, siteId, doctorId, firstName, lastName, includeLegacy);
            if (result != null)
            {
                foreach (Doctor cus in result)
                {
                    cus.ContactInformation = dl.ListContactInformation(cus.ContactInformationId).FirstOrDefault();

                }
            }
            return result;
        }
Пример #4
0
 public static List<Customer> ListCustomer(int? orgId, int? siteId, int? customerId, string firstName, string lastName,
     bool hasContracts, DateTime? contractDateStart, DateTime? contractDateEnd, bool includeLegacy)
 {
     DataLayer dl = new DataLayer();
     List<Customer> result = dl.ListCustomer(orgId, siteId, customerId, firstName, lastName, hasContracts, contractDateStart, contractDateEnd, includeLegacy);
     if (result != null)
     {
         foreach (Customer cus in result)
         {
             cus.ContactInformation = dl.ListContactInformation(cus.ContactInformationId).FirstOrDefault();
             
         }
     }
     return result;
 }
Пример #5
0
 public static void DeleteRecord(long id, Type recordType)
 {
     DataLayer temp = new DataLayer();
     String type = recordType.ToString();
     temp.DeleteRecord(id, type.Substring(type.LastIndexOf(".") + 1, (type.Length - (type.LastIndexOf(".") + 1))));
 }
Пример #6
0
 public static void DeleteRecord(Record record)
 {
     DataLayer dl = new DataLayer();
     String type = record.GetType().ToString();
     dl.DeleteRecord(Utilities.ToLong(record.RecordId), type.Substring(type.LastIndexOf(".") + 1, (type.Length - (type.LastIndexOf(".") + 1))));
 }
Пример #7
0
 public static void SaveAspRole(string applicationName, List<AspRole> saveList, string currentUser)
 {
     if (saveList != null)
     {
         DataLayer dataLayer = new DataLayer();
         foreach (AspRole item in saveList)
         {
             if (item.IsDeleted && item.RoleId != Guid.Empty && item.CanDelete)
             {
                 dataLayer.DeleteAspRole(item);
             }
             else if (item.IsChanged)
             {
                 if (!string.IsNullOrEmpty(item.RoleName))
                     item.LoweredRoleName = item.RoleName.ToLower();
                 else
                     item.LoweredRoleName = item.RoleName = string.Empty;
                 dataLayer.SaveAspRole(applicationName, item, currentUser);
             }
         }
     }
 }
Пример #8
0
 public static List<Site> ListSite(int? orgId, int? siteId, bool showLegacy, bool loadContact)
 {
     DataLayer dataLayer = new DataLayer();
     List<Site> result = dataLayer.ListSite(orgId, siteId, showLegacy);
     if (loadContact)
     {
         foreach (Site site in result)
         {
             if (site.ContactInformationID > 0)
             {
                 List<ContactInformation> contacts = dataLayer.ListContactInformation(site.ContactInformationID);
                 if (contacts.Count > 0)
                 {
                     site.ContactInformation = contacts[0];
                 }
             }
         }
     }
     return result;
 }