Example #1
0
        public ActionResult RejectConfirmed(int ID)
        {
            if (Session["currentUser"] == "")
            {
                return(RedirectToAction("AdminLogin", "Home"));
            }

            using (SSC_TicketEntities Tic = new SSC_TicketEntities())
            {
                Tic.Ticket_PerformCRUD("UPDATEReject", ID, null, null, null, null, null);
                db.SaveChanges();
            }
            return(RedirectToAction("Index"));
        }
Example #2
0
        public ActionResult View()
        {
            if (Session["currentUser"] == "")
            {
                return(RedirectToAction("AdminLogin", "Home"));
            }
            //return View(db.Ticket.ToList());

            using (SSC_TicketEntities Tic = new SSC_TicketEntities())
            {
                List <Ticket> Ticket = Tic.Ticket_PerformCRUD("SELECT", null, null, null, null, null, null).ToList();

                return(View(Ticket.ToList()));
            }
        }
        // GET: Employee
        public ActionResult Index()
        {
            if (Session["currentUser"] == "")
            {
                return(RedirectToAction("EmployeeLogin", "Home"));
            }
            SSC_Ticket_Management.Models.User userObj = (SSC_Ticket_Management.Models.User)Session["currentUser"];
            Session["currentUser"] = userObj;
            string currentuser = userObj.UserName;

            using (SSC_TicketEntities Tic = new SSC_TicketEntities())
            {
                List <Ticket> Ticket = Tic.Ticket_PerformCRUD("SELECTEmployee", null, null, null, null, currentuser, null).ToList();

                return(View(Ticket.ToList()));
            }
        }
        public ActionResult Create(Ticket Ticket)
        {
            if (Session["currentUser"] == "")
            {
                return(RedirectToAction("EmployeeLogin", "Home"));
            }

            SSC_Ticket_Management.Models.User userObj = (SSC_Ticket_Management.Models.User)Session["currentUser"];
            Session["currentUser"] = userObj;
            string currentuser = userObj.UserName;

            if (ModelState.IsValid)
            {
                using (SSC_TicketEntities Tic = new SSC_TicketEntities())
                {
                    Ticket Tick = Tic.Ticket_PerformCRUD("INSERT", null, Ticket.Ticket_Title, Ticket.Ticket_Description, null, currentuser, null).FirstOrDefault();
                    Tic.SaveChanges();
                }

                return(RedirectToAction("Index"));
            }

            return(View(Ticket));
        }