Exemplo n.º 1
0
        public ActionResult EditGroup([Bind(Include = "pgrID,pgrName,pgrOfcFirstName,pgrOfcLastName,pgrPhone,pgrStreet1,pgrStreet2,pgrCity,pgrState,pgrZip")] Pagroup group)
        {
            if (ModelState.IsValid)
            {
                db.Entry(group).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("IndexGroup"));
            }

            return(View(group));
        }
Exemplo n.º 2
0
        public ActionResult EditGroup(int?id)
        {
            ViewBag.FullName = getUserName();
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Pagroup group = db.Pagroups.Find(id);

            if (group == null)
            {
                return(HttpNotFound());
            }
            return(View(group));
        }
Exemplo n.º 3
0
        public ActionResult CreateGroup([Bind(Include = "pgrID, pgrName, pgrOfcFirstName, pgrOfcLastName, pgrPhone, pgrStreet1, pgrStreet2, pgrCity, pgrState, pgrZip")] Pagroup group)
        {
            try
            {
                //var alreadyExists = db.Employers.Any(v => v.empName == employer.empName);
                if (ModelState.IsValid)
                {
                    db.Pagroups.Add(group);
                    db.SaveChanges();

                    return(RedirectToAction("IndexGroup", "ManageContracts"));
                }
            }
            catch (DataException)
            {
                ModelState.AddModelError("", "Unable to save changes.Try again, and if the problem persists see your system administrator.");
            }

            return(View(group));
        }