Ejemplo n.º 1
0
        public ActionResult AcceptRequest(int id)
        {
            var project = db.projectRequest.Where(x => x.projectid == id).FirstOrDefault();

            if (project.statusid != 3)
            {
                project.statusid = 2;
                projectteams team = new projectteams();
                team.projectid = id;
                team.userid    = project.managerid;
                db.projectteams.Add(team);
                db.SaveChanges();
                return(RedirectToAction("listprojects"));
            }
            return(RedirectToAction("listprojects"));
        }
Ejemplo n.º 2
0
        public ActionResult AccepteRequest(int id)
        {
            var request = db.hiringRequest.Where(x => x.Id == id).FirstOrDefault();

            if (request != null)
            {
                if (request.statusid != 3)
                {
                    request.statusid = 2;
                    projectteams projectteam = new projectteams();
                    projectteam.projectid = request.projectid;
                    projectteam.userid    = request.userid;
                    db.projectteams.Add(projectteam);
                    db.SaveChanges();
                    return(RedirectToAction("requests"));
                }
            }

            return(RedirectToAction("requests"));
        }
Ejemplo n.º 3
0
        //************
        // to accept request from dierectors
        public ActionResult AcceptRequest(int id)
        {
            var hiring = db.hiringRequest.Where(x => x.Id == id).FirstOrDefault();

            if (hiring != null)
            {
                if (hiring.statusid != 3)
                {
                    hiring.statusid = 2;
                    projectteams team = new projectteams();
                    team.projectid = id;
                    team.userid    = hiring.userid;
                    db.projectteams.Add(team);
                    db.SaveChanges();
                }
                return(RedirectToAction("list"));
            }


            return(RedirectToAction("list"));
        }