/// <summary> /// Deprecated Method for adding a new object to the WorkEntries EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToWorkEntries(WorkEntry workEntry) { base.AddObject("WorkEntries", workEntry); }
public ActionResult LogHours(WorkEntry entry) { if (entry.Hours > 0) { entry.UserName = UserModel.Current.UserName; entry.Logged = DateTime.Now; _repositories.WorkEntries.Add(entry); _repositories.WorkEntries.SaveChanges(); TempData["message"] = "Your hours have been logged and you have been successfully logged out."; } TempData["message"] = "You have been successfully logged out."; return RedirectToAction("SignOut", "Account"); }
/// <summary> /// Create a new WorkEntry object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="userName">Initial value of the UserName property.</param> /// <param name="hours">Initial value of the Hours property.</param> /// <param name="logged">Initial value of the Logged property.</param> public static WorkEntry CreateWorkEntry(global::System.Int32 id, global::System.String userName, global::System.Double hours, global::System.DateTime logged) { WorkEntry workEntry = new WorkEntry(); workEntry.Id = id; workEntry.UserName = userName; workEntry.Hours = hours; workEntry.Logged = logged; return workEntry; }