예제 #1
0
 public Dictionary <int, Domain.PricingUnit> GetPricingUnits()
 {
     using (ConnectionScope.Enter())
     {
         DataMapper.EntitiesDataContext context = DataMapper.DataHelper.CreateDataContext();
         return(context.PricingUnits.Select(row => row.GetDomainObject()).ToDictionary(obj => obj.ID));
     }
 }
예제 #2
0
 public Dictionary <int, Domain.ApprovalStatus> GetApprovalStatuses()
 {
     using (ConnectionScope.Enter())
     {
         DataMapper.EntitiesDataContext context = DataMapper.DataHelper.CreateDataContext();
         return(context.ApprovalStatus.Select(row => row.GetDomainObject()).ToDictionary(obj => obj.ID));
     }
 }
예제 #3
0
 /// <summary>
 /// return all of configurations of website.
 /// </summary>
 /// <returns></returns>
 public Dictionary <string, Domain.Configuration> GetConfigurations()
 {
     using (ConnectionScope.Enter())
     {
         DataMapper.EntitiesDataContext context = DataMapper.DataHelper.CreateDataContext();
         return(context.Configurations.Select(row => new Domain.Configuration {
             ID = row.ID, Name = row.Name, Value = row.Value, Description = row.Description
         }).ToDictionary(obj => obj.Name));
     }
 }
예제 #4
0
 public Dictionary <int, Domain.PermissionType> GetPermissionTypes()
 {
     using (ConnectionScope.Enter())
     {
         DataMapper.EntitiesDataContext context = DataMapper.DataHelper.CreateDataContext();
         return(context.PermissionTypes.Select(row => new Domain.PermissionType {
             ID = row.ID, Name = row.Name
         }).ToDictionary(obj => obj.ID));
     }
 }
예제 #5
0
 public Dictionary <int, Domain.EmailFormat> GetEmailFormats()
 {
     using (ConnectionScope.Enter())
     {
         DataMapper.EntitiesDataContext context = DataMapper.DataHelper.CreateDataContext();
         return(context.EmailFormats.Select(row => new Domain.EmailFormat {
             ID = row.ID, Name = row.Name,
         }).ToDictionary(obj => obj.ID));
     }
 }
예제 #6
0
 public Dictionary <int, Domain.DocumentClassifier> GetDocumentClassifiers()
 {
     using (ConnectionScope.Enter())
     {
         DataMapper.EntitiesDataContext context = DataMapper.DataHelper.CreateDataContext();
         return(context.DocumentClassifiers.Select(row => new Domain.DocumentClassifier {
             ID = row.ID, Name = row.Name
         }).ToDictionary(obj => obj.ID));
     }
 }
예제 #7
0
 public Dictionary <int, Domain.OrderAssignmentStatus> GetOrderAssignmentStatus()
 {
     using (ConnectionScope.Enter())
     {
         DataMapper.EntitiesDataContext context = DataMapper.DataHelper.CreateDataContext();
         return(context.OrderAssignmentStatus.Select(row => new Domain.OrderAssignmentStatus {
             ID = row.ID, Name = row.Name, IsNoteRequired = row.NoteRequired
         }).OrderBy(obj => obj.Name).ToDictionary(obj => obj.ID));
     }
 }
예제 #8
0
 public Dictionary <int, Domain.State> GetStates(int CountryID)
 {
     using (ConnectionScope.Enter())
     {
         DataMapper.EntitiesDataContext context = DataMapper.DataHelper.CreateDataContext();
         //return context.States.Select(row => row.GetDomainObject()).Where(row=>row.CountryID==CountryID).ToDictionary(obj => obj.ID);
         return(context.States.Select(
                    row => new Domain.State {
             Abbr = row.Abbr,
             CountryID = row.CountryID,
             ID = row.ID,
             Inactive = row.Inactive,
             Name = row.Name
         })
                .Where(row => (row.CountryID == CountryID && row.Inactive == false))
                .ToDictionary(obj => obj.ID));
     }
 }
예제 #9
0
 public Domain.ZipCode GetZipCode(string zipCode)
 {
     using (ConnectionScope.Enter())
     {
         DataMapper.EntitiesDataContext context = DataMapper.DataHelper.CreateDataContext();
         //var query = context.ZipCodes.Where(z => z.ZIPCode == zipCode);
         var linqZip = context.ZipCodes.SingleOrDefault(z => z.ZIPCode == zipCode);
         if (linqZip != null)
         {
             Domain.ZipCode zip = new Domain.ZipCode();
             zip.ID          = linqZip.ID;
             zip.ZipCodeName = linqZip.ZIPCode;
             zip.State       = linqZip.State;
             zip.City        = linqZip.City;
             return(zip);
         }
         else
         {
             Domain.ZipCode zip = new Domain.ZipCode();
             zip.City = "Not Found";
             return(zip);
         }
     }
 }