/// <summary> /// copy the MBO attributes to current MBO /// </summary> public void CopyAll(YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq entity) { this._isNew = entity._isNew; this.__username = entity.__username; this.__remoteId = entity.__remoteId; this.__UsuarioParam = entity.__UsuarioParam; this.__id = entity.Id; }
/// <summary> /// Get the mobile business object by surrogate key. /// </summary> /// <param name="id">surrogate key</param> /// <returns>the mobile business object for the surroget key</returns> /// <exception cref="ObjectNotFoundException">Thrown if unable to retrieve mobile business object.</exception> /// <remarks> </remarks> public static YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq Load(long id) { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq _ent = Find(id); if (_ent == null) { throw new Sybase.Persistence.ObjectNotFoundException(); } return(_ent); }
/// <summary> /// Set current MBO attributes by specified MBO. /// </summary> public static YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq Merge(YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq entity) { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq ent = Find(entity._pk()); if (ent == null) { ent = new YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq(); } ent.CopyAll(entity); ent.Save(); return(ent); }
internal static com.sybase.afx.json.JsonObject ToJSON(YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq _object, bool __buildGraph, bool _includeBigAttribute, bool _includeUserAttributes) { if ((_object == null)) { return(null); } else { return(_object._toJSON(__buildGraph, _includeBigAttribute, _includeUserAttributes)); } }
/// <summary> /// Refresh the mobile business object from database. /// </summary> public void Refresh() { if (!_isNew) { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq ent = Load(_pk()); CopyAll(ent); _isNew = false; _isDirty = false; } }
/// <summary> /// Sybase internal use only. /// <summary> public static com.sybase.afx.json.JsonObject __toJSON(YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq _object, bool _includeBigAttribute) { if (_includeBigAttribute) { return(YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq.ToJSON(_object)); } else { return(YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq.ToJSONWithoutBigAttribute(_object)); } }
internal static YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq FromJSON(object _json) { if (_json == null) { return(null); } else { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq _obj = new YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq(); _obj._fromJSON((com.sybase.afx.json.JsonObject)_json); return(_obj); } }
/// <summary> /// override method /// </summary> public override bool Equals(object that) { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq that_1 = that as YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq; if (that_1 == null) { return(false); } long?id_2 = this._pk(); long?id_3 = that_1._pk(); if ((id_2 == null) || (id_3 == null)) { return(false); } return(id_2.Equals(id_3)); }
/// <summary> /// Find a mobile business object YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq /// </summary> /// <exception cref="PersistentException">Thrown if unable to retrieve mobile business object.</exception> /// <remarks> </remarks> public static YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq FindSub(string _username , string Usuario) { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq result_2 = null; System.Data.IDataReader rs_4 = null; int count_5 = 0; Sybase.Persistence.ConnectionWrapper _conn = null; try { _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection(); string _selectSQL = "select s.\"username\",s.\"remoteId\",s.\"UsuarioParam\",s.\"id\" from \"crmmobiledesa_1_0_representantecomercial_pull_pq\" s where s.\"username\" =? and ( s.\"UsuarioParam\"=? or (s.\"UsuarioParam\" IS NULL AND CAST(? AS varchar(100)) IS NULL))"; System.Data.IDbCommand ps_3 = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, _selectSQL); com.sybase.afx.db.CommandUtil.SetNullableString(_conn.GetConnectionProfile(), ps_3, "_username", _username); com.sybase.afx.db.CommandUtil.SetNullableString(_conn.GetConnectionProfile(), ps_3, "Usuario", Usuario); com.sybase.afx.db.CommandUtil.SetNullableString(_conn.GetConnectionProfile(), ps_3, "Usuario", Usuario); rs_4 = ps_3.ExecuteReader(); Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile(); while (com.sybase.afx.db.ReaderUtil.Read(profile, rs_4)) { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq entity_6 = new YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq(); entity_6.Bind(profile, rs_4); count_5++; result_2 = entity_6; } if (rs_4 != null) { com.sybase.afx.db.ReaderUtil.Close(profile, rs_4, count_5); } if (ps_3 != null) { ps_3.Dispose(); } _selectSQL = null; } catch (System.Data.DataException ex) { throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex); } finally { YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection(); } return(result_2); }
/// <summary> /// Find a List of YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq /// </summary> /// <exception cref="PersistentException">Thrown if unable to retrieve mobile business object.</exception> /// <remarks> </remarks> public static Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq> FindAll(int skip, int take) { skip = skip + 1; Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq> result_2 = new Sybase.Collections.GenericList <YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq>(); System.Data.IDataReader rs_4 = null; int count_5 = 0; Sybase.Persistence.ConnectionWrapper _conn = null; try { _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection(); string _selectSQL = " s.\"username\",s.\"remoteId\",s.\"UsuarioParam\",s.\"id\" from \"crmmobiledesa_1_0_representantecomercial_pull_pq\" s"; _selectSQL = "select top " + take + " start at " + skip + " " + _selectSQL; System.Data.IDbCommand ps_3 = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, _selectSQL); rs_4 = ps_3.ExecuteReader(); Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile(); while (com.sybase.afx.db.ReaderUtil.Read(profile, rs_4)) { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq entity_6 = new YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq(); entity_6.Bind(profile, rs_4); count_5++; result_2.Add(entity_6); } if (rs_4 != null) { com.sybase.afx.db.ReaderUtil.Close(profile, rs_4, count_5); } if (ps_3 != null) { ps_3.Dispose(); } _selectSQL = null; } catch (System.Data.DataException ex) { throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex); } finally { YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection(); } return(result_2); }
private static YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq _find(long id, String sql, bool findOs, bool findNonPending) { Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection(); System.Data.IDataReader _rs = null; int count = 0; try { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq _rt = null; System.Data.IDbCommand ps = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, sql); com.sybase.afx.db.CommandUtil.SetLong(_conn.GetConnectionProfile(), ps, "id", id); _rs = ps.ExecuteReader(); Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile(); while (com.sybase.afx.db.ReaderUtil.Read(profile, _rs)) { _rt = new YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq(); _rt.Bind(profile, _rs); count++; } if (_rs != null) { com.sybase.afx.db.ReaderUtil.Close(profile, _rs, count); } if (ps != null) { ps.Dispose(); } return(_rt); } catch (System.Data.DataException ex) { throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex); } finally { YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection(); } }
private static void Subscribe_pull(bool _sync, string _username, string Usuario) { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq pq_1 = YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq.FindSub(_username, Usuario); if (pq_1 == null || pq_1.IsDeleted) { pq_1 = new YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq(); } pq_1.UsuarioParam =(Usuario); if(pq_1.IsDirty || pq_1.IsNew) { pq_1.Save(); if (_sync) { YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.Synchronize("RepresentanteComercial"); pq_1 = YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq.FindSub(_username, Usuario); } else { } } if (_sync && (pq_1.RemoteId == null)) { throw new Sybase.Persistence.SynchronizeRequiredException("Illegal key generator status: the key generator must be populated first."); } }
internal static YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq FromJSON(object _json) { if (_json == null) { return null; } else { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq _obj = new YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq(); _obj._fromJSON((com.sybase.afx.json.JsonObject)_json); return _obj; } }
/// <summary> /// Find a mobile business object YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq /// </summary> /// <exception cref="PersistentException">Thrown if unable to retrieve mobile business object.</exception> /// <remarks> </remarks> public static YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq FindSub(string _username ,string Usuario) { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq result_2 = null; System.Data.IDataReader rs_4 = null; int count_5 = 0; Sybase.Persistence.ConnectionWrapper _conn = null; try { _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection(); string _selectSQL = "select s.\"username\",s.\"remoteId\",s.\"UsuarioParam\",s.\"id\" from \"crmmobiledesa_1_0_representantecomercial_pull_pq\" s where s.\"username\" =? and ( s.\"UsuarioParam\"=? or (s.\"UsuarioParam\" IS NULL AND CAST(? AS varchar(100)) IS NULL))"; System.Data.IDbCommand ps_3 = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, _selectSQL); com.sybase.afx.db.CommandUtil.SetNullableString(_conn.GetConnectionProfile(), ps_3, "_username", _username); com.sybase.afx.db.CommandUtil.SetNullableString(_conn.GetConnectionProfile(), ps_3, "Usuario", Usuario); com.sybase.afx.db.CommandUtil.SetNullableString(_conn.GetConnectionProfile(), ps_3, "Usuario", Usuario); rs_4 = ps_3.ExecuteReader(); Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile(); while (com.sybase.afx.db.ReaderUtil.Read(profile, rs_4)) { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq entity_6 = new YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq(); entity_6.Bind(profile, rs_4); count_5++; result_2 = entity_6; } if (rs_4 != null) com.sybase.afx.db.ReaderUtil.Close(profile, rs_4, count_5); if (ps_3 != null) ps_3.Dispose(); _selectSQL = null; } catch (System.Data.DataException ex) { throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex); } finally { YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection(); } return result_2; }
/// <summary> /// Find a List of YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq /// </summary> /// <exception cref="PersistentException">Thrown if unable to retrieve mobile business object.</exception> /// <remarks> </remarks> public static Sybase.Collections.GenericList<YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq> FindAll(int skip, int take) { skip = skip + 1; Sybase.Collections.GenericList<YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq> result_2 = new Sybase.Collections.GenericList<YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq>(); System.Data.IDataReader rs_4 = null; int count_5 = 0; Sybase.Persistence.ConnectionWrapper _conn = null; try { _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection(); string _selectSQL = " s.\"username\",s.\"remoteId\",s.\"UsuarioParam\",s.\"id\" from \"crmmobiledesa_1_0_representantecomercial_pull_pq\" s"; _selectSQL = "select top " + take + " start at " + skip + " " + _selectSQL; System.Data.IDbCommand ps_3 = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, _selectSQL); rs_4 = ps_3.ExecuteReader(); Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile(); while (com.sybase.afx.db.ReaderUtil.Read(profile, rs_4)) { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq entity_6 = new YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq(); entity_6.Bind(profile, rs_4); count_5++; result_2.Add(entity_6); } if (rs_4 != null) com.sybase.afx.db.ReaderUtil.Close(profile, rs_4, count_5); if (ps_3 != null) ps_3.Dispose(); _selectSQL = null; } catch (System.Data.DataException ex) { throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex); } finally { YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection(); } return result_2; }
/// <summary> /// Set current MBO attributes by specified MBO. /// </summary> public static YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq Merge(YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq entity) { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq ent = Find(entity._pk()); if (ent == null) { ent = new YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq(); } ent.CopyAll(entity); ent.Save(); return ent; }
private static YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq _find(long id, String sql, bool findOs, bool findNonPending) { Sybase.Persistence.ConnectionWrapper _conn = YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.AcquireDBReadConnection(); System.Data.IDataReader _rs = null; int count = 0; try { YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq _rt = null; System.Data.IDbCommand ps = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, sql); com.sybase.afx.db.CommandUtil.SetLong(_conn.GetConnectionProfile(), ps, "id", id); _rs = ps.ExecuteReader(); Sybase.Persistence.ConnectionProfile profile = _conn.GetConnectionProfile(); while (com.sybase.afx.db.ReaderUtil.Read(profile, _rs)) { _rt = new YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq(); _rt.Bind(profile, _rs); count++; } if (_rs != null) com.sybase.afx.db.ReaderUtil.Close(profile, _rs, count); if (ps != null) ps.Dispose(); return _rt; } catch(System.Data.DataException ex) { throw new Sybase.Persistence.PersistenceException(ex.ToString(), ex); } finally { YPF.Comercial.RRCC.SUP.CRMMobileDesaDB.ReleaseDBConnection(); } }
internal static com.sybase.afx.json.JsonObject ToJSON(YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq _object, bool __buildGraph, bool _includeBigAttribute) { return(ToJSON(_object, __buildGraph, _includeBigAttribute, true)); }
internal static com.sybase.afx.json.JsonObject ToJSON(YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq _object) { return(YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq.ToJSON(_object, false, true, true)); }
internal static com.sybase.afx.json.JsonObject ToJSONWithoutUserAttributes(YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq _object) { return(YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq.ToJSON(_object, false, false, false)); }
private void CreateBySQL(Sybase.Persistence.ConnectionWrapper _conn, string sql, YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq __theObject) { System.Data.IDbCommand ps = com.sybase.afx.db.CommandUtil.CreateCommand(_conn, sql); com.sybase.afx.db.CommandUtil.SetNullableString(_conn.GetConnectionProfile(), ps, "username", __theObject.Username); com.sybase.afx.db.CommandUtil.SetNullableString(_conn.GetConnectionProfile(), ps, "remoteId", __theObject.RemoteId); com.sybase.afx.db.CommandUtil.SetNullableString(_conn.GetConnectionProfile(), ps, "UsuarioParam", __theObject.UsuarioParam); com.sybase.afx.db.CommandUtil.SetLong(_conn.GetConnectionProfile(), ps, "id", __theObject.Id); ps.ExecuteNonQuery(); ps.Dispose();; }
/// <summary> /// Sybase internal use only. /// <summary> public static com.sybase.afx.json.JsonObject __toJSON(YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq _object) { return(YPF.Comercial.RRCC.SUP.intrnl.RepresentanteComercial_pull_pq.ToJSON(_object)); }