public ActionResult AddProject(FormCollection colection, ProjectDKC Project)
        {
            String   ProjectSymbol    = colection["ProjectSymbol"];
            String   ProjectName      = colection["ProjectName"];
            int?     ManagerProject   = colection["ManagerProject"].Equals("0") ? (int?)null : Convert.ToInt32(colection["ManagerProject"]);
            String   Address          = colection["Address"];
            DateTime?FromDate         = colection["FromDate"].Equals("") ? (DateTime?)null : Convert.ToDateTime(colection["FromDate"]);
            DateTime?ToDate           = colection["ToDate"].Equals("") ? (DateTime?)null : Convert.ToDateTime(colection["ToDate"]);
            int?     Status           = colection["Status"].Equals("0") ? (int?)null : Convert.ToInt32(colection["Status"]);
            var      lstProjectSymbol = Ql.ProjectDKCs.Where(x => x.ProjectSymbol.Trim() == ProjectSymbol.Trim()).ToList();
            var      CountPr          = lstProjectSymbol.Count();

            if (CountPr > 0)
            {
                ViewBag.Tb             = "Mã bị trùng";
                ViewBag.ProjectSymbol  = ProjectSymbol;
                ViewBag.ProjectName    = ProjectName;
                ViewBag.ManagerProject = ManagerProject;
                ViewBag.Address        = Address;
                ViewBag.FromDate       = @String.Format("{0:yyyy-MM-dd}", FromDate);
                ViewBag.ToDate         = @String.Format("{0:yyyy-MM-dd}", ToDate);
                ViewBag.Status         = Status;
                ViewData["User"]       = Ql.Users.Where(x => x.Status != 1 && x.IsDeleted != true).ToList();
                return(View());
            }
            else
            {
                Ql.AddProject_(ProjectSymbol, ProjectName, ManagerProject, Address, FromDate, ToDate, Status);
                return(RedirectToAction("Project", "Project"));
            }
        }
        public ActionResult SeachProject(FormCollection colection, ProjectDKC Project)
        {
            ViewData["User"] = Ql.Users.ToList();
            String ProjectSymbol  = colection["ProjectSymbol"].Trim();
            int?   Status         = colection["Status"].Equals("0") ? (int?)null : Convert.ToInt32(colection["Status"]);
            int?   ManagerProject = colection["ManagerProject"].Equals("0") ? (int?)null : Convert.ToInt32(colection["ManagerProject"]);
            var    lstProject     = Ql.SearchProject(ManagerProject, Status, 0, ProjectSymbol).ToList();
            var    ViewProject    = lstProject;

            ViewBag.Status         = Status;
            ViewBag.ManagerProject = ManagerProject;
            ViewBag.ProjectSymbol  = ProjectSymbol;
            ViewBag.ProjectNb      = Ql.SearchProject(ManagerProject, Status, 0, ProjectSymbol).Count();
            return(View("Project", ViewProject));
        }
Beispiel #3
0
        public ActionResult SeachDepartment(FormCollection colection, ProjectDKC Project)
        {
            ViewData["User"] = Ql.Users.Where(x => x.Status != 1 && x.IsDeleted == false).ToList();
            String ProjectSymbol = colection["ProjectSymbol"].Trim();
            //   int? Status = colection["Status"].Equals("0") ? (int?)null : Convert.ToInt32(colection["Status"]);
            int?ManagerProject = colection["ManagerProject"].Equals("0") ? (int?)null : Convert.ToInt32(colection["ManagerProject"]);
            var lstProject     = Ql.SearchProject(ManagerProject, null, 1, ProjectSymbol).ToList();
            var ViewProject    = lstProject;

            // ViewBag.Status = Status;
            ViewBag.ManagerProject = ManagerProject;
            ViewBag.ProjectSymbol  = ProjectSymbol;
            ViewBag.ProjectNb      = Ql.SearchProject(ManagerProject, null, 1, ProjectSymbol).Count();
            return(View("Department", ViewProject));
        }
        public ActionResult EditProject(FormCollection colection, ProjectDKC Project)
        {
            int?     Id             = colection["Id"].Equals("0") ? (int?)null : Convert.ToInt32(colection["Id"]);
            String   ProjectSymbol  = colection["ProjectSymbol"];
            String   ProjectName    = colection["ProjectName"];
            int?     ManagerProject = colection["ManagerProject"].Equals("0") ? (int?)null : Convert.ToInt32(colection["ManagerProject"]);
            String   Address        = colection["Address"];
            DateTime?FromDate       = colection["FromDate"].Equals("") ? (DateTime?)null : Convert.ToDateTime(colection["FromDate"]);
            DateTime?ToDate         = colection["ToDate"].Equals("") ? (DateTime?)null : Convert.ToDateTime(colection["ToDate"]);
            DateTime?CreatedDate    = colection["CreatedDate"].Equals("") ? (DateTime?)null : Convert.ToDateTime(colection["CreatedDate"]);
            DateTime ModifiedDate   = Convert.ToDateTime(colection["ModifiedDate"]);
            int?     Status         = colection["Status"].Equals("0") ? (int?)null : Convert.ToInt32(colection["Status"]);
            bool     IsDeleted      = Convert.ToBoolean(colection["IsDeleted"]);

            Ql.UpdateProject(Id, ProjectSymbol, ProjectName, ManagerProject, Address, FromDate, ToDate, CreatedDate, ModifiedDate, Status, IsDeleted);
            return(RedirectToAction("EditProject", "Project"));
        }