Exemplo n.º 1
0
        public IActionResult SendComplaint(int ComplaintId)
        {
            var result = _complaint.GetComplaint(ComplaintId);
            ComplaintIndexListingModel model = new ComplaintIndexListingModel()
            {
                OrderNumber = result.OrderNumber,
                Status      = result.Status,
                CreateDate  = result.CreateDate,
                Description = result.Description
            };

            return(View(model));
        }
Exemplo n.º 2
0
        public IActionResult ResolveComplaint(int ComplaintId)
        {
            ViewBag.ComplaintId = ComplaintId;
            var result = _complaint.GetComplaint(ComplaintId);
            ComplaintIndexListingModel model = new ComplaintIndexListingModel()
            {
                OrderNumber = result.OrderNumber,
                Status      = result.Status,
                CreateDate  = result.CreateDate,
                Description = result.Description,
                ChangeDate  = result.ChangeDate,
                Resolution  = result.Resolution
            };

            return(View(model));
        }
Exemplo n.º 3
0
        public IActionResult ResolveComplaint(ComplaintIndexListingModel model, int ComplaintId)
        {
            var Complaint = _complaint.GetComplaint(ComplaintId);

            if (Complaint != null)
            {
                Complaint.Resolution = model.Resolution;
                Complaint.Status     = model.Status;
                Complaint.ChangeDate = DateTime.Now;
                _complaint.UpdateComplaint(Complaint);
            }

            return(RedirectToAction("Index", "Home"));



            //return View();
        }
Exemplo n.º 4
0
        public IActionResult CreateComplaint(ComplaintIndexListingModel model, int OrderId)
        {
            Complaint complaint = new Complaint()
            {
                CreateDate  = DateTime.Now,
                Description = model.Description,
                Order       = _order.GetOrder(OrderId),
                OrderNumber = _order.GetOrder(OrderId).OrderNumber
            };

            _complaint.AddComplaint(complaint);

            var test = _complaint.GetComplaint(complaint.Id);

            if (test != null)
            {
                _complaint.ChangeStatus(test.Id, "Złożone");
            }
            else
            {
                _complaint.ChangeStatus(test.Id, "Błąd");
            }
            return(RedirectToAction("SendComplaint", "Complaint", new { ComplaintId = test.Id }));
        }