Ejemplo n.º 1
0
        public ActionResult Create(DailyFuelLog dailyfuellog)
        {
            if (ModelState.IsValid)
            {
                db.DailyFuelLog.AddObject(dailyfuellog);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.EquipmentId = new SelectList(db.Equipment, "EquipmentId", "EquipmentNumber", dailyfuellog.EquipmentId);
            return View(dailyfuellog);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Create a new DailyFuelLog object.
 /// </summary>
 /// <param name="dailyFueLogId">Initial value of the DailyFueLogId property.</param>
 /// <param name="equipmentId">Initial value of the EquipmentId property.</param>
 /// <param name="date">Initial value of the Date property.</param>
 public static DailyFuelLog CreateDailyFuelLog(global::System.Int64 dailyFueLogId, global::System.Int32 equipmentId, global::System.DateTime date)
 {
     DailyFuelLog dailyFuelLog = new DailyFuelLog();
     dailyFuelLog.DailyFueLogId = dailyFueLogId;
     dailyFuelLog.EquipmentId = equipmentId;
     dailyFuelLog.Date = date;
     return dailyFuelLog;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the DailyFuelLog EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToDailyFuelLog(DailyFuelLog dailyFuelLog)
 {
     base.AddObject("DailyFuelLog", dailyFuelLog);
 }
Ejemplo n.º 4
0
 public ActionResult Edit(DailyFuelLog dailyfuellog)
 {
     if (ModelState.IsValid)
     {
         db.DailyFuelLog.Attach(dailyfuellog);
         db.ObjectStateManager.ChangeObjectState(dailyfuellog, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.EquipmentId = new SelectList(db.Equipment, "EquipmentId", "EquipmentNumber", dailyfuellog.EquipmentId);
     return View(dailyfuellog);
 }