Esempio n. 1
0
        public ActionResult EditLabProject(Labs labs)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View());
                }
                int userType         = (Int32)Session["UserType"];
                var updateLabProject = Mapper.Map <DATA.Labs>(labs);
                lab.UpdateLabProject(updateLabProject);
                int x = (Int32)Session["UserType"];
                switch (x)
                {
                case 1:
                    return(RedirectToAction("PmProjects", "User"));

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

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

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

                default:
                    return(RedirectToAction("Index", "Home"));
                }
            }
            catch
            {
                return(View());
            }
        }
Esempio n. 2
0
 public ActionResult EditLabProject(Labs labs)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             return(View());
         }
         var updateLabProject = Mapper.Map <DATA.Labs>(labs);
         lab.UpdateLabProject(updateLabProject);
         return(RedirectToAction("Index", "Home"));
     }
     catch
     {
         return(View());
     }
 }