public User(User o) { Copy(o); }
public static bool Exists(User o) { return Exists(o.contactid); }
static User LoadFromModel(pmanAPI.App_Data.pmanDB.UserRow row) { User d = new User(); LoadUser(row, d); return d; }
static bool Update(User j) { return UpdateByID(j); }
public bool Equals(User o) { if(this.contactid != o.contactid)return false; if(this.accesslevel != o.accesslevel)return false; if (this.userid != o.userid) return false; return true; }
static bool Delete(User p) { throw new NotImplementedException(); }
public static bool UpdateByID(User o) { throw new NotImplementedException(); /*pmanAPI.App_Data.pmanDBTableAdapters.UserTableAdapter ta = new pmanAPI.App_Data.pmanDBTableAdapters.UserTableAdapter(); int ret = ta.UpdateByID( o.accesslevel, o.contactid ); if(ret == 1) return true; return false;*/ }
public void Copy(User o) { this.contactid = o.contactid; this.accesslevel = o.accesslevel; this.userid = o.userid; }
public static bool Save(User j) { if (!User.isValid(j)) return false; if (Exists(j)) { return User.Update(j); } return User.Insert(j); }
public static bool Remove(User j) { if (Exists(j)) { return Delete(j); } return false; }
public static void LoadUser(pmanAPI.App_Data.pmanDB.UserRow row, User d) { try { d.contactid = row.ContactID; } catch (Exception) { } try { d.accesslevel = row.AccessLevel; } catch (Exception) { } try { d.userid = row.UserID; } catch (Exception) { } }
public static bool isValid(User o) { if (o.contactid == String.Empty) return false; return true; }
public static bool Insert(User o) { throw new NotImplementedException(); /* pmanAPI.App_Data.pmanDBTableAdapters.UserTableAdapter ta = new pmanAPI.App_Data.pmanDBTableAdapters.UserTableAdapter(); ta.InsertQuery( o.contactid, o.accesslevel ); return true;*/ }