Esempio n. 1
0
        public IActionResult Approved(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var order = _context.Orders.SingleOrDefault(m => m.Id == id);

            _context.Update(order);
            order.Status = _context.Status.SingleOrDefault(s => s.Name == "AdminApproved");
            _context.SaveChanges();

            return(RedirectToAction("Index"));
        }
        // GET: Admin/CustomerCard/Create
        public async Task <IActionResult> Create(int id)
        {
            var Subscriber = await _context.NewSubscribes.
                             Include(s => s.Package).
                             Include(s => s.SetBox).
                             SingleOrDefaultAsync(s => s.Id == id);

            _context.Update(Subscriber);
            Subscriber.Status = await _context.Status.FirstOrDefaultAsync(st => st.Name == "Viewed");

            _context.SaveChanges();

            CardAddModel card = new CardAddModel()
            {
                Id            = id,
                Address       = Subscriber.Address,
                CardNumber    = CardNumberGenerator.CardNumber(),
                ContactNumber = Subscriber.ContactNumber,
                OwnerName     = Subscriber.OwnerName,
                PackageId     = Subscriber.Package.Id,
                SetBoxId      = Subscriber.SetBox.Id,
                SubscribeDate = DateTime.Now
            };

            return(View(card));
        }
        public IActionResult UpdateStatus()
        {
            DateTime now = DateTime.Now;

            var status = _con.Status.
                         SingleOrDefault(m => m.Name == "Recharged");

            var cp = _con.CustomerPackages.
                     Include(c => c.Status).
                     Where(c => c.ExpirationDate < now).ToList();

            cp.ForEach(c => c.Status = status);
            _con.SaveChanges();

            return(RedirectToAction("Index", "Admin"));
        }
Esempio n. 4
0
        // GET: Admin/MOD/Edit/5
        public async Task <IActionResult> Viewed(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var movieOnDemand = await _context.MoviesOnDemand.SingleOrDefaultAsync(m => m.Id == id);

            if (movieOnDemand != null)
            {
                _context.Update(movieOnDemand);
                movieOnDemand.Status = _context.Status.SingleOrDefault(s => s.Name == "AdminApproved");
                _context.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(NotFound());
        }
Esempio n. 5
0
        // GET: Admin/FeedBack/Edit/5
        public async Task <IActionResult> Viewed(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var Feedback = await _context.FeedBacks.SingleOrDefaultAsync(m => m.Id == id);

            if (Feedback != null)
            {
                _context.Update(Feedback);
                Feedback.Status = _context.Status.SingleOrDefault(s => s.Name == "Viewed");
                _context.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(NotFound());
        }
 public void Add(NewSetBoxRequest newRequest)
 {
     _con.Add(newRequest);
     _con.SaveChanges();
 }
Esempio n. 7
0
 public void Update(Package package)
 {
     _context.Update(package);
     _context.SaveChanges();
 }
Esempio n. 8
0
 public void AddSubscribe(NewSubscribe newSub)
 {
     _context.NewSubscribes.Add(newSub);
     _context.SaveChanges();
 }
Esempio n. 9
0
 public void Add(CustomerPackage newCp)
 {
     _con.Add(newCp);
     _con.SaveChanges();
 }
Esempio n. 10
0
 public void Add(Customer newCustomer)
 {
     _con.Customers.Add(newCustomer);
     _con.SaveChanges();
 }
Esempio n. 11
0
 public void Add(Order newOrder)
 {
     _con.Add(newOrder);
     _con.SaveChanges();
 }
Esempio n. 12
0
 public void Add(FeedBack newFeedback)
 {
     _context.Add(newFeedback);
     _context.SaveChanges();
 }
Esempio n. 13
0
 public void Add(Faq newFaq)
 {
     _con.Faqs.Add(newFaq);
     _con.SaveChanges();
 }
Esempio n. 14
0
 public void Update(CustomerCard card)
 {
     _con.Update(card);
     _con.SaveChanges();
 }
Esempio n. 15
0
 public void Add(MovieOnDemand newMovie)
 {
     _con.MoviesOnDemand.Add(newMovie);
     _con.SaveChanges();
 }
Esempio n. 16
0
 public void Add(Payment newPayment)
 {
     _con.Add(newPayment);
     _con.SaveChanges();
 }
Esempio n. 17
0
 public void Add(Recharge newRecharge)
 {
     _con.Add(newRecharge);
     _con.SaveChanges();
 }