Exemplo n.º 1
0
 public virtual ActionResult Create(FormCollection collection)
 {
     try
     {
         var tEntity = collection.FormParse <TEntity>();
         tEntity.SetDefaultDateTime("CreatedDate");
         var add = _typeService.Add(tEntity);
         SetAlertMessage(add);
         return(RedirectToAction("Index"));
     }
     catch (Exception e)
     {
         SetAlertMessage(e.Message);
         return(RedirectToAction("Create"));
     }
 }
Exemplo n.º 2
0
 public virtual ActionResult Edit(int id, FormCollection collection)
 {
     try
     {
         var tEntity = collection.FormParse(_typeService.Get(FuncFilter(id)).ResultObject);
         tEntity.SetDefaultDateTime("UpdateDate");
         var edit = _typeService.Update(tEntity);
         SetAlertMessage(edit);
         return(RedirectToAction("Index"));
     }
     catch (Exception e)
     {
         SetAlertMessage(e.Message);
         return(RedirectToAction("Index"));
     }
 }