public ClassCancelationFull AddClassCancelation(ClassCancelationAdd newCC)
 {
     var addedCC = AutoMapper.Mapper.Map<Models.ClassCancelation>(newCC);
     addedCC.ClassPeriod = dc.ClassPeriods.Include("Course").SingleOrDefault(n => n.Id == newCC.ClassPeriodId);
     addedCC.Faculty = dc.Faculties.SingleOrDefault(n => n.Id == newCC.FacultyId);
     //dc.Faculties.SingleOrDefault(n => n.Id == newCC.FacultyId).ClassCancelations.Add(addedCC);
     dc.ClassCancelations.Add(addedCC);
     dc.SaveChanges();
     return AutoMapper.Mapper.Map<ClassCancelationFull>(addedCC);
 }
        public ActionResult Create(ClassCancelationAdd cc)
        {
            if (ModelState.IsValid)
            {
                cc.FacultyId = repoFac.getFacultyForListByUserName(User.Identity.Name).Id;
                cc.StandardMessage = repoClass.getClassPeriodsForCancelationForFaculty(cc.FacultyId).SingleOrDefault(n => n.Id == cc.ClassPeriodId).Course.Name + " "
                    + repoFac.getFacultiesForList().SingleOrDefault(nn => nn.Id == cc.FacultyId).FirstName + " "
                    + repoFac.getFacultiesForList().SingleOrDefault(nn => nn.Id == cc.FacultyId).LastName + " "
                    + DateTime.Now.ToString();
                repoCC.AddClassCancelation(cc);

                return RedirectToAction("Index");
            }

            return View(cc);
        }