示例#1
0
文件: Project.cs 项目: yoan-durand/TP
        public bool CreateProject(T_Project project)
        {
            using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
            {

                bugtrack.AddToT_Project(project);
                bugtrack.SaveChanges();

                var test = from b in bugtrack.T_Project
                           where b.id == project.id
                           select b;

                return (test.Count() > 0);
            }
        }
示例#2
0
文件: Project.cs 项目: yoan-durand/TP
        public bool UpdateProject(T_Project project)
        {
            using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
            {
                T_Project proj = bugtrack.T_Project.Where(p => p.id == project.id).FirstOrDefault();

                if (proj != null)
                {
                    proj = project;
                    bugtrack.SaveChanges();
                    return true;
                }
                else
                {
                    return false;
                }

            }
        }
示例#3
0
 /// <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;
 }
示例#4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the T_Project EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToT_Project(T_Project t_Project)
 {
     base.AddObject("T_Project", t_Project);
 }