Beispiel #1
0
        public ActionResult Create([Bind(Include = "InvoiceReminderId,InvoiceReminderDate,InvoiceReminderTypeId")] InvoiceReminder invoiceReminder)
        {
            if (ModelState.IsValid)
            {
                db.InvoiceReminders.Add(invoiceReminder);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.InvoiceReminderTypeId = new SelectList(db.InvoiceReminderTypes, "InvoiceReminderTypeId", "ReminderSubject", invoiceReminder.InvoiceReminderTypeId);
            return(View(invoiceReminder));
        }
Beispiel #2
0
        // GET: InvoiceReminders/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            InvoiceReminder invoiceReminder = db.InvoiceReminders.Find(id);

            if (invoiceReminder == null)
            {
                return(HttpNotFound());
            }
            return(View(invoiceReminder));
        }
Beispiel #3
0
        // GET: InvoiceReminders/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            InvoiceReminder invoiceReminder = db.InvoiceReminders.Find(id);

            if (invoiceReminder == null)
            {
                return(HttpNotFound());
            }
            ViewBag.InvoiceReminderTypeId = new SelectList(db.InvoiceReminderTypes, "InvoiceReminderTypeId", "ReminderSubject", invoiceReminder.InvoiceReminderTypeId);
            return(View(invoiceReminder));
        }
Beispiel #4
0
 public ActionResult DeleteConfirmed(int id)
 {
     try
     {
         InvoiceReminder invoiceReminder = db.InvoiceReminders.Find(id);
         db.InvoiceReminders.Remove(invoiceReminder);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch (DbUpdateConcurrencyException)
     {
         ViewBag.Message = "Sorry, couldn't delete due to a concurrency issue <br />Please try again";
         return(RedirectToAction("Delete"));
     }
 }
Beispiel #5
0
        private void CreateReminder()
        {
            // TODO Report

            InvoiceReminder reminder = new InvoiceReminder()
            {
                Date           = DateTime.Now,
                IsLastReminder = false,
                RefInvoiceId   = Invoice.InvoiceId,
                ReminderType   = Models.Enums.ReminderType.Mail,
                Username       = Globals.ActiveUser.Name
            };

            InvoiceReminders.Insert(reminder);
            Invoice.InvoiceReminders.Add(reminder);
        }
Beispiel #6
0
 public ActionResult Edit([Bind(Include = "InvoiceReminderId,InvoiceReminderDate,InvoiceReminderTypeId, RowVersion")] InvoiceReminder invoiceReminder)
 {
     ViewBag.InvoiceReminderTypeId = new SelectList(db.InvoiceReminderTypes, "InvoiceReminderTypeId", "ReminderSubject", invoiceReminder.InvoiceReminderTypeId);
     if (!ModelState.IsValid)
     {
         return(View(invoiceReminder));
     }
     try
     {
         db.Entry(invoiceReminder).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch (DbUpdateConcurrencyException)
     {
         ViewBag.Message = "Sorry, couldn't update due to a concurrency issue <br />Please try again";
         return(View(invoiceReminder));
     }
 }
 public static bool Update(InvoiceReminder InvoiceReminder)
 {
     return(WebApi <bool> .PutAsync(controllerName, InvoiceReminder, "Put").Result);
 }
 public static int Insert(InvoiceReminder InvoiceReminder)
 {
     return(WebApi <int> .PostAsync(controllerName, InvoiceReminder, "SinglePost").Result);
 }