public IHttpActionResult PostRejectStudent(RejectedModel model) //TODO crear interefaz
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var student = StudentsServices.RejectUser(model.AccountId);

            if (student != null)
            {
                MailManager.SendSimpleMessage(student.Email, model.Message, "Vinculación");
                return(Ok(student));
            }

            return(NotFound());
        }
예제 #2
0
        public ActionResult Rejected()
        {
            RejectedModel model = new RejectedModel();

            using (var db = new CopiosisEntities())
            {
                model.rejected = db.transactions.Where(a => (a.status == "Rejected")).Select(t => new RejectedTransactionModel
                {
                    transactionID = t.transactionID,
                    dateRejected  = t.dateClosed ?? DateTime.MinValue,
                    producer      = db.users.Where(u => u.userID == t.providerID).Select(u => u.username).FirstOrDefault(),
                    consumer      = db.users.Where(u => u.userID == t.receiverID).Select(u => u.username).FirstOrDefault(),
                    name          = t.product.name,
                    gateway       = t.product.gateway
                }).OrderByDescending(t => t.dateRejected).ToList();
            }
            return(View(model));
        }