Ejemplo n.º 1
0
        // GET: Bites/Details/5
        //public ActionResult Details(string id)
        //{
        //    if (id == null)
        //    {
        //        return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
        //    }
        //    Bite bite = db.Bites.Find(id);
        //    if (bite == null)
        //    {
        //        return HttpNotFound();
        //    }
        //    return View(bite);
        //}

        public ActionResult GenerateLetter(string biteId, FormCollection form)
        {
            if (biteId == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }



            var selectedLetter = form["Letter Type"];


            try
            {
                int result;
                int.TryParse(selectedLetter, out result);
                ActionsHelper.SaveActions(ActionsHelper.GenerateSendLetterAction(biteId, result));
            }
            catch (Exception)
            {
                throw;
            }



            return(RedirectToAction("Details", new { biteId = biteId }));
        }