public ActionResult CoefficientsDeleteConfirmed(Guid id)
        {
            PublicationClassificationCoefficient model = dbCoeffs.PublicationClassificationCoefficients.Find(id);

            dbCoeffs.PublicationClassificationCoefficients.Remove(model);
            dbCoeffs.SaveChanges();
            return(RedirectToAction("CoefficientsIndex", routeValues: new { pubClassId = model.PublicationClassificationID }));
        }
        public ActionResult CoefficientsDelete(Guid?id, Guid pubClassId)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PublicationClassificationCoefficient model = dbCoeffs.PublicationClassificationCoefficients.Find(id);

            if (model == null)
            {
                return(HttpNotFound());
            }
            ViewBag.PublicationClassificationID = pubClassId;

            return(View(model));
        }
        public ActionResult CoefficientsEdit(Guid?id, Guid pubClassId)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PublicationClassificationCoefficient model = dbCoeffs.PublicationClassificationCoefficients.Find(id);

            if (model == null)
            {
                return(HttpNotFound());
            }
            PopulatePubTypeGroupsDropDownList(model.PublicationTypeGroupID);
            ViewBag.PublicationClassificationID = pubClassId;
            return(View(model));
        }
        public ActionResult CoefficientsCreate([Bind(Include = "PublicationTypeGroupID,Coefficient,Year,Description,PublicationClassificationID")] PublicationClassificationCoefficient model, string pubClassId)
        {
            if (ModelState.IsValid)
            {
                model.PublicationClassificationCoefficientID = Guid.NewGuid();
                model.PublicationClassificationID            = new Guid(pubClassId);

                model.DateCreated  = DateTime.Now;
                model.DateModified = model.DateCreated;

                model.UserCreatedID  = Guid.Parse(User.Identity.GetUserId());
                model.UserModifiedID = model.UserCreatedID;

                dbCoeffs.PublicationClassificationCoefficients.Add(model);
                dbCoeffs.SaveChanges();
                return(RedirectToAction("CoefficientsIndex", new { pubClassId = pubClassId }));
            }

            return(View(model));
        }
        public ActionResult CoefficientsEdit(
            [Bind(Include = "PublicationClassificationCoefficientID,PublicationTypeGroupID,Year,Coefficient,Description,PublicationClassificationID")] PublicationClassificationCoefficientViewModel viewModel, string pubClassId)
        {
            if (ModelState.IsValid)
            {
                PublicationClassificationCoefficient model = dbCoeffs.PublicationClassificationCoefficients.Find(viewModel.PublicationClassificationCoefficientID);

                model.PublicationTypeGroupID = viewModel.PublicationTypeGroupID;
                model.Year        = viewModel.Year;
                model.Coefficient = viewModel.Coefficient;
                model.Description = viewModel.Description;

                model.DateModified   = DateTime.Now;
                model.UserModifiedID = Guid.Parse(User.Identity.GetUserId());

                dbCoeffs.Entry(model).State = EntityState.Modified;
                dbCoeffs.SaveChanges();
                return(RedirectToAction("CoefficientsIndex", new { pubClassId = pubClassId }));
            }
            return(View(viewModel));
        }