Esempio n. 1
0
        public ActionResult CreateOtherProject(OtherProjects otherProject)
        {
            if (otherProject.Other_requestor_id != null)
            {
                //Changes the lab project null to 2=Laboratory
                otherProject.Other_projectType = 5;
                try
                {
                    if (!ModelState.IsValid)
                    {
                        return(View());
                    }

                    var otherProjectToAdd = Mapper.Map <DATA.OtherProjects>(otherProject);
                    oProjec.AddOtherProject(otherProjectToAdd);
                    return(RedirectToAction("CreateOtherProject"));
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else
            {
                return(View());
            }
        }
Esempio n. 2
0
        public ActionResult CreateOtherProject(OtherProjects otherProject)
        {
            if (otherProject.Other_requestor_id != null)
            {
                //Changes the lab project null to 2=Laboratory
                otherProject.Other_projectType = 5;
                try
                {
                    if (!ModelState.IsValid)
                    {
                        return(View());
                    }

                    var otherProjectToAdd = Mapper.Map <DATA.OtherProjects>(otherProject);
                    oProjec.AddOtherProject(otherProjectToAdd);
                    int x = (Int32)Session["UserType"];
                    switch (x)
                    {
                    case 1:
                        return(RedirectToAction("PmProjects", "User"));

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

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

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

                    default:
                        return(RedirectToAction("Index", "Home"));
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else
            {
                return(View());
            }
        }