public ActionResult CreateProject(ProjectModel tproject, string Command)
        {
            T_Projects Obj = new T_Projects();
            Obj.C_ProjectName = tproject.C_ProjectName;
            Obj.C_ProjectDescription = tproject.C_ProjectDescription;
            Obj.C_LastModified = DateTime.Now;

            bool IsSuccess = mobjModel.AddProject(Obj);
            if (IsSuccess)
            {
                TempData["OperStatus"] = "Project added successfully";
                ModelState.Clear();
                return RedirectToAction("SearchProject", "ManageProjects");
            }

            return PartialView("_CreateProject");
        }
        public ActionResult UpdateProject(ProjectModel tproject, string Command)
        {
            if (!ModelState.IsValid)
            {
                return PartialView("_EditProject", tproject);
            }
            else
            {
                T_Projects Obj = new T_Projects();
                Obj.C_ProjectID = tproject.C_ProjectID;
                Obj.C_ProjectName = tproject.C_ProjectName;
                Obj.C_ProjectDescription = tproject.C_ProjectDescription;
                Obj.C_LastModified = DateTime.Now;

                bool IsSuccess = mobjModel.UpdateProject(Obj);
                if (IsSuccess)
                {
                    TempData["OperStatus"] = "Project updated successfully";
                    ModelState.Clear();
                    return RedirectToAction("SearchProject", "ManageProjects");
                }
            }

            return PartialView("_EditProject");
        }
        /// <summary>
        /// Method to get the webgrid of the project
        /// </summary>
        /// <param name="page"></param>
        /// <param name="sort"></param>
        /// <param name="sortDir"></param>
        /// <returns></returns>
        public ActionResult SearchProject(int page = 1, string sort = "name", string sortDir = "ASC")
        {
            const int pageSize = 5;
            var totalRows = mobjModel.CountAllProjects();

            sortDir = sortDir.Equals("desc", StringComparison.CurrentCultureIgnoreCase) ? sortDir : "asc";

            var validColumns = new[] { "Project ID", "Project Name", "Project Description", "Last Modified" };

            if (!validColumns.Any(c => c.Equals(sort, StringComparison.CurrentCultureIgnoreCase)))
                sort = "id";

            var project = mobjModel.GetProjectPage(page, pageSize, "it." + sort + " " + sortDir);

            var data = new ProjectModel()
             {
                 TotalRows = totalRows,
                 PageSize = pageSize,
                 Project = project
             };
            return View(data);
        }
        /// <summary>
        /// Method to populate the edit popup
        /// </summary>
        /// <param name="page"></param>
        /// <param name="sort"></param>
        /// <param name="sortDir"></param>
        /// <returns></returns>
        //Edit Project
        public ActionResult EditProject(int id)
        {
            var data = mobjModel.GetProjectDetails(Convert.ToInt32(id));

            ProjectModel Obj = new ProjectModel();
            Obj.C_ProjectID = data.C_ProjectID;
            Obj.C_ProjectName = data.C_ProjectName;
            Obj.C_ProjectDescription = data.C_ProjectDescription;
            Obj.C_LastModified = data.C_LastModified;

            ViewBag.IsUpdate = true;
            return View("_EditProject", Obj);
        }