static bool Update(Address j) { return UpdateByID(j); }
public Address(Address o) { Copy(o); }
static bool Delete(Address p) { pmanAPI.App_Data.pmanDBTableAdapters.AddressTableAdapter ta = new pmanAPI.App_Data.pmanDBTableAdapters.AddressTableAdapter(); return ta.DeleteByID(p.id) == 0 ? false : true; }
static Address LoadFromModel(pmanAPI.App_Data.pmanDB.AddressRow row) { Address d = new Address(); LoadAddress(row, d); return d; }
public void Copy(Address o) { this.id = o.id; this.name = o.name; this.address_1 = o.address_1; this.address_2 = o.address_2; this.city = o.city; this.state = o.state; this.zip = o.zip; this.contact_id = o.contact_id; this.createdate = o.createdate; this.modifydate = o.modifydate; }
public bool Equals(Address o) { if(this.id != o.id)return false; if(this.name != o.name)return false; if(this.address_1 != o.address_1)return false; if(this.address_2 != o.address_2)return false; if(this.city != o.city)return false; if(this.state != o.state)return false; if(this.zip != o.zip)return false; if(this.contact_id != o.contact_id)return false; if(this.createdate.ToString() != o.createdate.ToString())return false; if(this.modifydate.ToString() != o.modifydate.ToString())return false; return true; }
public static bool Save(Address j) { if (!Address.isValid(j)) return false; if (Exists(j)) { return Address.Update(j); } return Address.Insert(j); }
public static bool UpdateByID(Address o) { o.modifydate = DateTime.Now; pmanAPI.App_Data.pmanDBTableAdapters.AddressTableAdapter ta = new pmanAPI.App_Data.pmanDBTableAdapters.AddressTableAdapter(); int ret = ta.UpdateByID( o.name, o.address_1, o.address_2, o.city, o.state, o.zip, o.contact_id, o.createdate , o.modifydate, o.id ); if(ret == 1) return true; return false; }
public static bool Remove(Address j) { if (Exists(j)) { return Delete(j); } return false; }
public static void LoadAddress(pmanAPI.App_Data.pmanDB.AddressRow row, Address d) { try { d.id = row.id; } catch (Exception) { } try { d.name = row.name; } catch (Exception) { } try { d.address_1 = row.address_1; } catch (Exception) { } try { d.address_2 = row.address_2; } catch (Exception) { } try { d.city = row.city; } catch (Exception) { } try { d.state = row.state; } catch (Exception) { } try { d.zip = row.zip; } catch (Exception) { } try { d.contact_id = row.contact_id; } catch (Exception) { } try { d.createdate = row.createdate; } catch (Exception) { } try { d.modifydate = row.modifydate; } catch (Exception) { } }
public static bool isValid(Address o) { //if (o.id == 0) // return false; return true; }
public static bool Insert(Address o) { o.createdate = o.modifydate = DateTime.Now; pmanAPI.App_Data.pmanDBTableAdapters.AddressTableAdapter ta = new pmanAPI.App_Data.pmanDBTableAdapters.AddressTableAdapter(); o.id = Convert.ToInt32(ta.InsertQuery( o.name, o.address_1, o.address_2, o.city, o.state, o.zip, o.contact_id, o.createdate, o.modifydate )); return true; }
public static bool Exists(Address o) { return Exists(o.id); }