Exemplo n.º 1
0
        /// <summary>
        /// Deletes a LegalEntity record
        /// </summary>
        public static int Delete(LegalEntityDO DO)
        {
            SqlParameter _LegalEntityID = new SqlParameter("LegalEntityID", SqlDbType.VarChar);

            _LegalEntityID.Value = DO.LegalEntityID;

            SqlParameter[] _params = new SqlParameter[] {
                _LegalEntityID
            };

            return DataCommon.ExecuteScalar("[dbo].[LegalEntity_Delete]", _params, "dbo");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new LegalEntity record
        /// </summary>
        public static void Create(LegalEntityDO DO)
        {
            SqlParameter _LegalEntityID = new SqlParameter("LegalEntityID", SqlDbType.VarChar);

            _LegalEntityID.Value = DO.LegalEntityID;

            SqlParameter[] _params = new SqlParameter[] {
                _LegalEntityID
            };

            DataCommon.ExecuteNonQuery("[dbo].[LegalEntity_Insert]", _params, "dbo");
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets all LegalEntity records
        /// </summary>
        public static LegalEntityDO[] GetAll()
        {
            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[LegalEntity_GetAll]", new SqlParameter[] { }, "dbo");

            List<LegalEntityDO> objs = new List<LegalEntityDO>();

            while(sr.Read()){

                LegalEntityDO obj = new LegalEntityDO();

                obj.LegalEntityID = sr.GetString(sr.GetOrdinal("LegalEntityID"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Selects LegalEntity records by PK
        /// </summary>
        public static LegalEntityDO[] GetByPK(String LegalEntityID)
        {
            SqlParameter _LegalEntityID = new SqlParameter("LegalEntityID", SqlDbType.VarChar);

            _LegalEntityID.Value = LegalEntityID;

            SqlParameter[] _params = new SqlParameter[] {
                _LegalEntityID
            };

            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[LegalEntity_GetByPK]", _params, "dbo");

            List<LegalEntityDO> objs = new List<LegalEntityDO>();

            while(sr.Read())
            {
                LegalEntityDO obj = new LegalEntityDO();

                obj.LegalEntityID = sr.GetString(sr.GetOrdinal("LegalEntityID"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }