public bool CreateBug(T_Bug bug, long idProject) { using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities()) { bug.T_Project.Id = idProject; bugtrack.AddToT_Bug(bug); bugtrack.SaveChanges(); var test = from b in bugtrack.T_Bug where b.id == bug.id select b; return (test.Count() > 0); } }
public bool UpdateBug(T_Bug bug) { using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities ()) { T_Bug b = bugtrack.T_Bug.Where(r => r.id == bug.id).FirstOrDefault(); if (b != null) { b.title = bug.title; b.T_Project.Id = bug.T_Project.Id; b.Createdate = bug.Createdate; bugtrack.SaveChanges(); return true; } else { return false; } } }
/// <summary> /// Create a new T_Bug object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="title">Initial value of the title property.</param> /// <param name="createDate">Initial value of the CreateDate property.</param> public static T_Bug CreateT_Bug(global::System.Int64 id, global::System.String title, global::System.DateTime createDate) { T_Bug t_Bug = new T_Bug(); t_Bug.id = id; t_Bug.title = title; t_Bug.CreateDate = createDate; return t_Bug; }
/// <summary> /// Deprecated Method for adding a new object to the T_Bug EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToT_Bug(T_Bug t_Bug) { base.AddObject("T_Bug", t_Bug); }