Exemple #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());
            }
        }
Exemple #2
0
        public ActionResult EditOtherProject(OtherProjects other)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View());
                }
                var updateOtherProject = Mapper.Map <DATA.OtherProjects>(other);
                oProjec.UpdateOtherProject(updateOtherProject);
                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
            {
                return(View());
            }
        }
 public void DeleteOtherProject(OtherProjects otherProject)
 {
     try
     {
         unitOfWork.Repository <OtherProjects>().Delete(otherProject);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #4
0
 public ActionResult EditOtherProject(OtherProjects other)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             return(View());
         }
         var updateOtherProject = Mapper.Map <DATA.OtherProjects>(other);
         oProjec.UpdateOtherProject(updateOtherProject);
         return(RedirectToAction("Index", "Home"));
     }
     catch
     {
         return(View());
     }
 }
Exemple #5
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());
            }
        }
Exemple #6
0
 public void UpdateOtherProject(OtherProjects otherProject)
 {
     _db.Update(otherProject);
 }
Exemple #7
0
 public void AddOtherProject(OtherProjects otherProject)
 {
     _db.Insert(otherProject);
 }