Ejemplo n.º 1
0
 public ActionResult Create(BDSComment model)
 {
     model.Name        = model.NameComment;
     model.Description = model.Description;
     model.Status      = 0;
     if (!ModelState.IsValid)
     {
         return(View(model));
     }
     model.KeySearch = model.Name.NormalizeD() + " " + model.TextComment.NormalizeD() + " " + model.DateComment.Value.ToString(MvcApplication.DateTimeFormat.ShortDatePattern).NormalizeD() + " " +
                       (String.IsNullOrEmpty(model.Description)
                         ? ""
                         : model.Description.NormalizeD());
     _service.CreateItem(model);
     return(RedirectToAction("Index"));
 }
Ejemplo n.º 2
0
 public ActionResult Edit(BDSComment model)
 {
     model.Name        = model.NameComment;
     model.Description = model.Description;
     if (!ModelState.IsValid)
     {
         ViewBag.Success = false;
         ViewBag.Message = Resource.SaveFailed;
         return(View(model));
     }
     model.KeySearch = model.Name.NormalizeD() + " " + model.TextComment.NormalizeD() + " " + model.DateComment.Value.ToString(MvcApplication.DateTimeFormat.ShortDatePattern).NormalizeD() + " " +
                       (String.IsNullOrEmpty(model.Description)
                        ? ""
                        : model.Description.NormalizeD());
     _service.UpdateItem(model);
     ViewBag.Success = true;
     ViewBag.Message = Resource.SaveSuccessful;
     return(Edit(model.ID));
 }
Ejemplo n.º 3
0
        public ActionResult Edit(int id)
        {
            BDSComment model = _service.GetItem(id);

            return(View(model));
        }