예제 #1
0
파일: Access.cs 프로젝트: thilehoffer/CSM
        public static Models.DisabilityCategoryModel GetDisabilityCategory(int disabilityCategoryID)
        {
            var dataItem = GetContext().GetDisabilityCategory(disabilityCategoryID).Single();
            var result   = new Models.DisabilityCategoryModel {
                ID = dataItem.ID, Active = dataItem.Active, Description = dataItem.Description
            };

            return(result);
        }
예제 #2
0
파일: CRUD.cs 프로젝트: thilehoffer/CSM
        public static void UpdateDisabilityCategory(DisabilityCategoryModel disabilityCategory, int userId)
        {
            using (var context = DataContext.GetContext())
            {
                var existing = context.DisabilityCategories.Single(a => a.ID == disabilityCategory.ID);
                existing.Description = disabilityCategory.Description;
                existing.Active = disabilityCategory.Active;
                existing.LastModifiedOn = DateTime.Now;
                existing.LastModifiedBy = userId;
                context.SaveChanges();

            }
        }
예제 #3
0
파일: CRUD.cs 프로젝트: thilehoffer/CSM
 public static void InsertDisabilityCategory(DisabilityCategoryModel disabilityCategory, int userId)
 {
     using (var context = DataContext.GetContext())
     {
         context.DisabilityCategories.AddObject(new Entities.DisabilityCategory
         {
             Active = true,
             CreatedBy = userId,
             CreatedOn = DateTime.Now,
             Description = disabilityCategory.Description,
             LastModifiedBy = userId,
             LastModifiedOn = DateTime.Now
         });
         context.SaveChanges();
     }
 }
예제 #4
0
파일: Access.cs 프로젝트: thilehoffer/CSM
 public static Models.DisabilityCategoryModel GetDisabilityCategory(int disabilityCategoryID)
 {
     var dataItem = GetContext().GetDisabilityCategory(disabilityCategoryID).Single();
     var result = new Models.DisabilityCategoryModel { ID = dataItem.ID, Active = dataItem.Active, Description = dataItem.Description };
     return result;
 }
예제 #5
0
파일: Access.cs 프로젝트: thilehoffer/CSM
 public static void SaveDisabilityCategory(Models.DisabilityCategoryModel disabilityCategory)
 {
     GetContext().SaveDisabilityCategory(disabilityCategory.ID, disabilityCategory.Description, disabilityCategory.Active);
 }