/// <summary> /// permet la création d'un projet /// </summary> /// <param name="project">l'objet project à crer</param> /// <returns>true si tout se passe bien sinon false</returns> public static bool CreateProject(T_Project project) { try { BugTrackEntities model = new BugTrackEntities(); model.AddToT_Project(project); model.SaveChanges(); return true; } catch (Exception ex) { return false; } }
protected void Page_Load(object sender, EventArgs e) { DataAccess.T_User user = new lemett_aBugTrack.DataAccess.T_User() { email = "*****@*****.**", firstname = "toto", name = "titi", password = "******", phone = "023565", }; BusinessManagement.User.CreateUser(user); user = BusinessManagement.User.GetUser(1); user.password = "******"; BusinessManagement.User.UpdateUser(user); T_Project project = new T_Project() { name = "APM", startDate = DateTime.Now, version = "0.0.1" }; BusinessManagement.Project.CreateProject(project); project = BusinessManagement.Project.GetProject(1); project.version = "0.0.2"; BusinessManagement.Project.UpdateProject(project); T_BugCritic bugCritic = new T_BugCritic() { CreateDate = DateTime.Now, Description = "bug critic", title = "plantage grave", }; BusinessManagement.Bug.CreateBugCritic(bugCritic, project.id); T_Bug bug = BusinessManagement.Bug.GetBug(1); T_Transaction trans = new T_Transaction() { statut = (int)DBO.EnumStatut.Accepted, }; BusinessManagement.Transaction.CreateTransaction(trans, bug.id, user.id); T_Comment comment = new T_Comment() { details = "voir msdn", }; BusinessManagement.Comment.CreateComment(comment, user.id, bug.id); comment = BusinessManagement.Comment.GetComment(1); comment.details = "ou microsoft"; BusinessManagement.Comment.UpdateComment(comment); BusinessManagement.GenerateDocx.GenerateReportBug(1); BusinessManagement.Comment.DeleteComment(comment.id); BusinessManagement.Transaction.DeleteTransaction(trans.id); BusinessManagement.Bug.DeleteBug(bug.id); BusinessManagement.Project.DeleteProject(project.id); BusinessManagement.User.DeleteUser(user.id); }
/// <summary> /// permet de mettre à jour le projet /// </summary> /// <param name="project">le projet a mettre a jour</param> /// <returns>true si ca c'est binen passé sinon false</returns> public static bool UpdateProject(T_Project project) { try { BugTrackEntities model = new BugTrackEntities(); T_Project projectDB = model.T_Project.Where(x => x.id == project.id).FirstOrDefault(); if (projectDB != null) { projectDB.name = project.name; projectDB.startDate = project.startDate; projectDB.version = project.version; model.SaveChanges(); return true; } else { return false; } } catch (Exception ex) { return false; } }
/// <summary> /// Create a new T_Project object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="name">Initial value of the name property.</param> /// <param name="version">Initial value of the version property.</param> /// <param name="startDate">Initial value of the startDate property.</param> public static T_Project CreateT_Project(global::System.Int64 id, global::System.String name, global::System.String version, global::System.DateTime startDate) { T_Project t_Project = new T_Project(); t_Project.id = id; t_Project.name = name; t_Project.version = version; t_Project.startDate = startDate; return t_Project; }
/// <summary> /// Deprecated Method for adding a new object to the T_Project EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToT_Project(T_Project t_Project) { base.AddObject("T_Project", t_Project); }
/// <summary> /// permet de mettre à jour le projet /// </summary> /// <param name="project">le projet a mettre a jour</param> /// <returns>true si ca c'est binen passé sinon false</returns> public static bool UpdateProject(T_Project project) { return DataAccess.Project.UpdateProject(project); }