Ejemplo n.º 1
0
        public ActionResult EditOfficeProject(Offices office)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View());
                }
                var updateOfficeProject = Mapper.Map <DATA.Offices>(office);
                off.UpdateOfficeProject(updateOfficeProject);
                int x = (Int32)Session["UserType"];
                switch (x)
                {
                case 1:
                    return(RedirectToAction("PmProjects", "User"));

                case 2:
                    return(RedirectToAction("UserMyProjects", "User"));

                case 3:
                    return(RedirectToAction("Index", "Office"));

                case 4:
                    return(RedirectToAction("Index", "Office"));

                default:
                    return(RedirectToAction("Index", "Home"));
                }
            }
            catch
            {
                return(View());
            }
        }
 public ActionResult EditOfficeProject(Offices office)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             return(View());
         }
         var updateOfficeProject = Mapper.Map <DATA.Offices>(office);
         off.UpdateOfficeProject(updateOfficeProject);
         return(RedirectToAction("Index", "Home"));
     }
     catch
     {
         return(View());
     }
 }