Ejemplo n.º 1
0
 /// <summary>
 /// saves a new bugreport
 /// </summary>
 /// <param name="model">the BugreportItemViewModel with the report data</param>
 /// <returns>true if saving was successfull, otherwise false</returns>
 public void Save( BugreportItemViewModel model )
 {
     ml_Bugreport bug = new ml_Bugreport()
     {
         Email = model.EmailAddress,
         Report = model.Feedback,
         ResolutionStatus = (int)muscle_log.framework.Util.Enum.BugreportResolution.Open,
         CRDT = DateTime.Now,
         LUDT = DateTime.Now
     };
     _repo.Insert(bug);
 }
        public ActionResult Report( BugreportItemViewModel model )
        {
            if ( ModelState.IsValid ) {
                using (var unitOfWork = new EFContextUnitOfWork(new MuscleLogContext()))
                {
                    var service = new BugreportService(new Repository<ml_Bugreport>(unitOfWork));
                    service.Save(model);
                    TempData[ "successMessage" ] = "Vielen Dank für dein Feedback! Deine Rückmeldung wurde erfolgreich gespeichert.";
                }
            }

            return View( );
        }