예제 #1
0
        /// <summary>
        /// The create drug category.
        /// </summary>
        /// <param name="category">
        /// The category.
        /// </param>
        public void CreateDrugCategory(IDrugCategory category)
        {
            var cat = new DrugCategory
            {
                IsActive    = true,
                Code        = category.Code,
                CreatedBy   = category.CreatedBy ?? Thread.CurrentPrincipal.Identity.Name,
                CreatedOn   = DateTime.UtcNow,
                Description = category.Description,
                Name        = category.Name,
                Status      = (int)EntityStatusType.Current,
                SortOrder   = category.SortOrder,
                Directions  = category.Directions
            };

            _context.DrugCategories.Add(cat);
        }
예제 #2
0
 public static DrugCategoryViewModel ToModel(this IDrugCategory entity)
 {
     return(new DrugCategoryViewModel
     {
         CreatedBy = entity.CreatedBy,
         CreatedOn = entity.CreatedOn,
         Directions = entity.Directions,
         Description = entity.Description,
         Id = entity.Id,
         IsActive = entity.IsActive,
         Name = entity.Name,
         SortOrder = entity.SortOrder,
         Status = entity.Status,
         UpdatedBy = entity.UpdatedBy,
         UpdatedOn = entity.UpdatedOn,
         Code = entity.Code
     });
 }
예제 #3
0
 public void CreateDrugCategory(IDrugCategory category)
 {
     throw new NotImplementedException();
 }