public bool SaveRegistration(UserRegistration registraionModel)
        {
            _dbContext.Add(registraionModel);
            var result = _dbContext.SaveChanges();

            return(true);
        }
示例#2
0
 public bool SaveTraining(Training training)
 {
     training.DateOfCreated = DateTime.Now.ToShortDateString();
     training.LastUpdated   = DateTime.Now.ToShortDateString();
     _dbContext.Add(training);
     _dbContext.SaveChanges();
     return(true);
 }
 public bool SaveTopic(Topics topics)
 {
     topics.CreatedUser   = "******";
     topics.UpdatedUser   = "******";
     topics.DateOfCreated = DateTime.Now.ToShortDateString();
     topics.LastUpdated   = DateTime.Now.ToShortDateString();
     _dbContext.Add(topics);
     _dbContext.SaveChanges();
     return(true);
 }
        public async Task CreateTrainingAsync(NewTrainingModel trainingModel)
        {
            _dbContext.Add <Training>(new Training()
            {
                EndDate     = trainingModel.EndDate,
                StartDate   = trainingModel.StartDate,
                Name        = trainingModel.Name,
                CreatedDate = DateTime.Now
            });

            await _dbContext.SaveChangesAsync();
        }