Ejemplo n.º 1
0
 static bool Update(Project j)
 {
     return UpdateByID(j);
 }
Ejemplo n.º 2
0
 public Project(Project o)
 {
     Copy(o);
 }
Ejemplo n.º 3
0
 public bool Equals(Project o)
 {
     if(this.id != o.id)return false;
      if(this.name != o.name)return false;
      if(this.description != o.description)return false;
      if(this.creator_id != o.creator_id)return false;
      if(this.createdate.ToString() != o.createdate.ToString())return false;
      if(this.modifydate.ToString() != o.modifydate.ToString())return false;
      if(this.startdate.ToString() != o.startdate.ToString())return false;
      if(this.enddate.ToString() != o.enddate.ToString())return false;
      return true;
 }
Ejemplo n.º 4
0
 static Project LoadFromModel(pmanAPI.App_Data.pmanDB.ProjectRow row)
 {
     Project d = new Project();
     LoadProject(row, d);
     return d;
 }
Ejemplo n.º 5
0
        public static bool UpdateByID(Project o)
        {
            o.modifydate = DateTime.Now;
            pmanAPI.App_Data.pmanDBTableAdapters.ProjectTableAdapter ta = new pmanAPI.App_Data.pmanDBTableAdapters.ProjectTableAdapter();
            int ret  = ta.UpdateByID(
              o.name,
              o.description,
              o.creator_id,
              o.createdate,
              o.modifydate,
              o.startdate,
              o.enddate,
              o.id

               );
               if(ret == 1) return true;
               return false;
        }
Ejemplo n.º 6
0
 public void Copy(Project o)
 {
     this.id = o.id;
      this.name = o.name;
      this.description = o.description;
      this.creator_id = o.creator_id;
      this.createdate = o.createdate;
      this.modifydate = o.modifydate;
      this.startdate = o.startdate;
      this.enddate = o.enddate;
 }
Ejemplo n.º 7
0
 public static bool Remove(Project j)
 {
     if (Exists(j))
     {
         return Delete(j);
     }
     return false;
 }
Ejemplo n.º 8
0
 public static bool Save(Project j)
 {
     if (!Project.isValid(j))
         return false;
     if (Exists(j))
     {
         return Project.Update(j);
     }
     return Project.Insert(j);
 }
Ejemplo n.º 9
0
        public static void LoadProject(pmanAPI.App_Data.pmanDB.ProjectRow row, Project d)
        {
            try { d.id = row.id; }
            catch (Exception) { }

            try { d.name = row.name; }
            catch (Exception) { }

            try { d.description = row.description; }
            catch (Exception) { }

            try { d.creator_id = row.creator_id; }
            catch (Exception) { }

            try { d.createdate = row.createdate; }
            catch (Exception) { }

            try { d.modifydate = row.modifydate; }
            catch (Exception) { }

            try { d.startdate = row.startdate; }
            catch (Exception) { }

            try { d.enddate = row.enddate; }
            catch (Exception) { }
        }
Ejemplo n.º 10
0
 public static bool isValid(Project o)
 {
     return true;
 }
Ejemplo n.º 11
0
        public static bool Insert(Project o)
        {
            o.createdate = o.modifydate = DateTime.Now;
            pmanAPI.App_Data.pmanDBTableAdapters.ProjectTableAdapter ta = new pmanAPI.App_Data.pmanDBTableAdapters.ProjectTableAdapter();
            o.id = Convert.ToInt32(ta.InsertQuery(o.name,o.description,o.creator_id,o.createdate,o.modifydate,o.startdate,o.enddate));

               return true;
        }
Ejemplo n.º 12
0
 public static bool Exists(Project o)
 {
     return Exists(o.id);
 }
Ejemplo n.º 13
0
        public static bool Delete(Project o)
        {
            pmanAPI.App_Data.pmanDBTableAdapters.ProjectTableAdapter ta = new pmanAPI.App_Data.pmanDBTableAdapters.ProjectTableAdapter();

            return ta.DeleteQuery(o.id) == 0?false:true;
        }