Exemple #1
0
 //
 // GET: /Traffic/Delete/5
 public ActionResult Delete(int id)
 {
     if (!IsLoggedIn())
         return RedirectToAction("Authenticate", "Home");
     var traffic = new Traffic { ID = id };
     return View(OpenErpConnection.GetConnection().GetEntity<Traffic>(e => e.ID == traffic.ID));
 }
Exemple #2
0
 public ActionResult Delete(Traffic traffic)
 {
     try
     {
         OpenErpConnection.GetConnection().DeleteEntity(traffic);
         return RedirectToAction("Index");
     }
     catch (Exception ex)
     {
         return View();
     }
 }
Exemple #3
0
 public ActionResult Create(Traffic traffic)
 {
     try
     {
         var now = DateTime.Now;
         traffic.UpdateDate = string.Format("{0}/{1}/{2} {3}:{4}:{5}", now.Year, now.Month, now.Day, now.Hour,
             now.Minute, now.Second);
         OpenErpConnection.GetConnection().AddEntity(traffic);
         return RedirectToAction("Index");
     }
     catch (Exception ex)
     {
         return View();
     }
 }