コード例 #1
0
        public ActionResult GetAllProjects()
        {
            DALClasses ObjDALClasses = new DALClasses();

            ModelState.Clear();
            return(View(ObjDALClasses.GetAllProjects()));
        }
コード例 #2
0
        public ActionResult ProjectSingleDetails(int id)
        {
            DALClasses ObjDALClasses = new DALClasses();



            return(View(ObjDALClasses.SelectSingleProjects(id)));
        }
コード例 #3
0
        public ActionResult UpdateProjectDetail(int ProjectId)
        {
            DALClasses ObjDALClasses = new DALClasses();
            Projects   ObjProjects   = new Projects();

            ObjProjects = ObjDALClasses.SelectSingleProjects(ProjectId);
            //return View("UpdateProjectDetail");
            return(View(ObjProjects));
        }
コード例 #4
0
 public ActionResult DeleteProjects(int ProjectId)
 {
     try
     {
         DALClasses ObjDALClasses = new DALClasses();
         if (ObjDALClasses.DeleteProjects(ProjectId))
         {
             ViewBag.AlertMsg = "Project deleted successfully";
         }
         return(RedirectToAction("GetAllProjects"));
     }
     catch
     {
         return(View());
     }
 }
コード例 #5
0
        public ActionResult UpdateProjectDetail(Projects ObjProjects)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    DALClasses ObjDALClasses = new DALClasses();

                    if (ObjDALClasses.UpdateProjects(ObjProjects))
                    {
                        ViewBag.Message = "Project Details Updated Successfully";
                    }
                }

                return(RedirectToAction("GetAllProjects"));
            }
            catch
            {
                return(View());
            }
        }
コード例 #6
0
        public ActionResult AddProjects(Projects ObjProjects)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    DALClasses ObjDALClasses = new DALClasses();

                    if (ObjDALClasses.AddProject(ObjProjects))
                    {
                        ViewBag.Message = "Project details added successfully";
                    }
                }

                //return View();
                return(RedirectToAction("GetAllProjects"));
            }
            catch
            {
                return(View());
            }
        }