Esempio n. 1
0
        public ActionResult AcceptDeleterequest(int Id)
        {
            try
            {
                jdreq = db.JDRequests.Find(Id);

                db.JDRequests.Remove(jdreq);

                ViewBag.Error = "RequestDeleted";

                db.SaveChanges();

                return(RedirectToAction("Allrequest"));
            }

            catch
            {
                return(View());
            }
        }
Esempio n. 2
0
        public ActionResult SendRequestJD(JDRequest jdreq, ApprovedProject approve, user user)
        {
            if (ModelState.IsValid)
            {
                int id     = Convert.ToInt32(Session["ID"]);
                var writer = db.users.Where(model => model.user_Type == 5).FirstOrDefault();
                jdreq.User_ID   = writer.Id;
                jdreq.proj_ID   = approve.project_id;
                jdreq.Rj_status = 0;
                db.JDRequests.Add(jdreq);
                db.SaveChanges();
                return(RedirectToAction("JuniorDeveloper"));
            }
            var PrjList =
                from prj in db.ApprovedProjects
                join Pr in db.projects on prj.project_id equals Pr.PostID
                select new { Project_ID = prj.project_id, Project_name = Pr.Title }; //produces flat sequence

            ViewBag.Projects = new SelectList(PrjList, "Project_ID", "Project_name", approve.project_id);
            return(View());
        }
Esempio n. 3
0
        public ActionResult SubmitProject(JDRequest jdreq, TLRequest tlrequest, user user)
        {
            if (ModelState.IsValid)
            {
                int id     = Convert.ToInt32(Session["ID"]);
                var writer = db.users.Where(model => model.user_Type == 5).FirstOrDefault();
                jdreq.User_ID   = writer.Id;
                jdreq.proj_ID   = tlrequest.Project_ID;
                jdreq.Rj_status = 0;
                db.JDRequests.Add(jdreq);
                db.SaveChanges();
                return(RedirectToAction("JDMembers"));
            }
            var PrjList =
                from prj in db.TLRequests
                join Pr in db.projects on prj.Project_ID equals Pr.PostID
                select new { Project_ID = prj.Project_ID, Project_name = Pr.Title }; //produces flat sequence

            ViewBag.Projects = new SelectList(PrjList, "Project_ID", "Project_name", tlrequest.Project_ID);
            return(View());
        }
Esempio n. 4
0
        public ActionResult ApprovedRequest(JDRequest Jdreq)
        {
            if (ModelState.IsValid)
            {
                int id     = Convert.ToInt32(Session["ID"]);
                var writer = db.users.Where(model => model.Id == id).FirstOrDefault();
                //approve.Cust_id = writer.Id;
                //approve.project_id = request.Project_ID;
                //approve.ProjectMang_id = request.PM_ID;

                //db.ApprovedProjects.Add(approve);

                // db.SaveChanges();

                Con = new SqlConnection(@"Data source=DESKTOP-OJT395D;initial catalog=projectMSys;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework");
                Con.Open();
                UpdateStatment = new SqlCommand("Update JDRequests set Rj_status = '" + 1 + "' Where  proj_ID = '" + jdreq.proj_ID + "' ", Con);
                UpdateStatment.ExecuteNonQuery();

                return(RedirectToAction("Allrequest"));
            }

            return(View());
        }
Esempio n. 5
0
        //GET : JuniorDeveloper/ApproveRequest
        public ActionResult ApproveRequest(int Id)
        {
            if (Id != 0)
            {
                if ((Convert.ToInt32(Session["UserType"]) == 5))
                {
                    jdreq = db.JDRequests.Find(Id);

                    if (jdreq == null)
                    {
                        return(HttpNotFound());
                    }
                    return(View(jdreq));
                }
                else
                {
                    return(RedirectToAction("../Home/Index"));
                }
            }
            else
            {
                return(RedirectToAction("../Home/Index"));
            }
        }