/// <summary> /// permet la création d'un bug /// </summary> /// <param name="bug">l'objet bug à crer</param> /// <returns>true si tout se passe bien sinon false</returns> public static bool CreateBug(T_Bug bug, long idProject) { try { BugTrackEntities model = new BugTrackEntities(); bug.T_Project = model.T_Project.Where(x => x.id == idProject).FirstOrDefault(); //model.Attach(bug.T_Project); model.AddToT_Bug(bug); model.SaveChanges(); return true; } catch (Exception ex) { return false; } }
/// <summary> /// permet la création d'un bug /// </summary> /// <param name="bug">l'objet bug à crer</param> /// <returns>true si tout se passe bien sinon false</returns> public static bool CreateBug(T_Bug bug, long idProject) { bug.CreateDate = DateTime.Now; return DataAccess.Bug.CreateBug(bug,idProject); }
/// <summary> /// permet de mettre à jour le bug /// </summary> /// <param name="bug">le bug a mettre a jour</param> /// <returns>true si ca c'est binen passé sinon false</returns> public static bool UpdateBug(T_Bug bug) { return DataAccess.Bug.UpdateBug(bug); }
/// <summary> /// permet de mettre à jour le bug /// </summary> /// <param name="bug">le bug a mettre a jour</param> /// <returns>true si ca c'est binen passé sinon false</returns> public static bool UpdateBug(T_Bug bug) { try { BugTrackEntities model = new BugTrackEntities(); T_Bug bugDB = model.T_Bug.Where(x => x.id == bug.id).FirstOrDefault(); if (bugDB != null) { bugDB.title = bug.title; model.SaveChanges(); return true; } else { return false; } } catch (Exception ex) { return false; } }
/// <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); }