Exemplo n.º 1
0
 public ActionResult AcceptOrReject([Bind(Include = "ID,CustomerName,PMName,TLName,JEName,Name,Description,Price,Date,Code,Comment,Approval,PMAccept,TLAccept,JEAccept,Assign,Delivered,Feedback")] Project project)
 {
     if (ModelState.IsValid)
     {
         db.Entry(project).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(project));
 }
Exemplo n.º 2
0
        public ActionResult Create([Bind(Include = "ID,FirstName,LastName,UserName,Password,Mobile,Email,JobDescription,JobRole")] User user)
        {
            if (ModelState.IsValid)
            {
                db.Users.Add(user);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(user));
        }
        public ActionResult Create([Bind(Include = "ID,CustomerName,PMName,TLName,JEName,Name,Description,Price,Date,Code,Comment,Approval,TLAccept,JEAccept,Assign,Delivered,Feedback")] Project project)
        {
            if (ModelState.IsValid)
            {
                db.Projects.Add(project);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(project));
        }
Exemplo n.º 4
0
        public ActionResult Register(User user)
        {
            if (ModelState.IsValid)
            {
                using (RealState2Context db = new RealState2Context())
                {
                    db.Users.Add(user);
                    db.SaveChanges();
                }
                ModelState.Clear();
                ViewBag.Message = user.UserName + " " + "Success.";

                if (user.JobRole == "Admin")
                {
                    return(RedirectToAction("Index", "Admin"));
                }
                else if (user.JobRole == "PM")
                {
                    return(RedirectToAction("Index", "PM"));
                }
                else if (user.JobRole == "TL")
                {
                    return(RedirectToAction("Index", "TL"));
                }
                else if (user.JobRole == "JE")
                {
                    return(RedirectToAction("Index", "JE"));
                }
                else if (user.JobRole == "Customer")
                {
                    return(RedirectToAction("Index", "Customer"));
                }
            }
            return(View());
        }