Пример #1
0
        //
        // GET: /StudentFees/Delete/5

        public ActionResult Delete(string id)
        {
            Int32       theId   = Convert.ToInt32(Models.Encript.DecryptString(id, true));
            StudentFees feeItem = work.StudentFeesRepository.GetByID(theId);

            return(View(feeItem));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            StudentFees studentFees = db.StudentFees.Find(id);

            db.StudentFees.Remove(studentFees);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "StudentFeeId,FeeId,GradeFee,FeeBalance")] StudentFees studentFees)
 {
     if (ModelState.IsValid)
     {
         db.Entry(studentFees).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FeeId = new SelectList(db.Fees, "FeeId", "GradeName", studentFees.FeeId);
     return(View(studentFees));
 }
        // GET: StudentFees/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StudentFees studentFees = db.StudentFees.Find(id);

            if (studentFees == null)
            {
                return(HttpNotFound());
            }
            return(View(studentFees));
        }
Пример #5
0
        public ActionResult Delete(StudentFees model)
        {
            try
            {
                // TODO: Add delete logic here
                work.StudentFeesRepository.Delete(model);
                work.Save();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Пример #6
0
        public ActionResult Edit(StudentFees model)
        {
            try
            {
                work.StudentFeesRepository.Update(model);
                work.Save();
                // TODO: Add update logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
        public ActionResult SMSReminder(int?id)
        {
            var message = string.Empty;

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StudentFees studentFees = db.StudentFees.Find(id);

            message = "Hi, " + studentFees.GuardianName + "\n\nPlease note outstanding Fees Balance Of: " + studentFees.FeeBalance + " is over due.\nPlease pay as soon as possible.";
            studentFees.SMSMessage = message;

            return(View(studentFees));
        }
        // GET: StudentFees/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StudentFees studentFees = db.StudentFees.Find(id);

            if (studentFees == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FeeId = new SelectList(db.Fees, "FeeId", "GradeName", studentFees.FeeId);
            return(View(studentFees));
        }
        public ActionResult SMSReminder([Bind(Include = "StudentFeeId,FeeId,GradeFee,FeeBalance,SMSMessage")] StudentFees studentFees)
        {
            var client = new Client(creds: new Nexmo.Api.Request.Credentials
            {
                ApiKey    = "7692f400",
                ApiSecret = "Zua8eJBJEcveP0Zn"
            });
            var results = client.SMS.Send(request: new SMS.SMSRequest
            {
                from = "DGS",
                to   = "27817375820",
                //update to include book information

                text = studentFees.SMSMessage
            });

            return(View(studentFees));
        }
Пример #10
0
        public ActionResult Create(StudentFees model)
        {
            try
            {
                if (!(ModelState.IsValid))
                {
                    return(View(model));
                }

                work.StudentFeesRepository.Insert(model);
                work.Save();
                // TODO: Add insert logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }