/// <summary> /// The create drug class. /// </summary> /// <param name="drugClass"> /// The drug class. /// </param> public void CreateDrugClass(IDrugClass drugClass) { var clazz = new DrugClass { IsActive = true, CreatedBy = drugClass.CreatedBy ?? Thread.CurrentPrincipal.Identity.Name, CreatedOn = DateTime.UtcNow, Description = drugClass.Description, Name = drugClass.Name, Status = (int)EntityStatusType.Current, SortOrder = drugClass.SortOrder, Directions = drugClass.Directions, DrugCategoryId = drugClass.DrugCategoryId }; _context.DrugClasses.Add(clazz); }
public static DrugClassViewModel ToModel(this IDrugClass entity) { return(new DrugClassViewModel { 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, DrugCategoryId = entity.DrugCategoryId }); }
public void CreateDrugClass(IDrugClass drugClass) { throw new NotImplementedException(); }