コード例 #1
0
        public bool Insert(string Name, Guid RowGuid, DateTime ModifiedDate)
        {
            AddressTypeDAC addresstypeComponent = new AddressTypeDAC();
            int            AddressTypeId        = 0;

            return(addresstypeComponent.InsertNewAddressType(ref AddressTypeId, Name, RowGuid, ModifiedDate));
        }
コード例 #2
0
        public List <AddressType> GetAll()
        {
            AddressTypeDAC     _addressTypeComponent = new AddressTypeDAC();
            IDataReader        reader           = _addressTypeComponent.GetAllAddressType().CreateDataReader();
            List <AddressType> _addressTypeList = new List <AddressType>();

            while (reader.Read())
            {
                if (_addressTypeList == null)
                {
                    _addressTypeList = new List <AddressType>();
                }
                AddressType _addressType = new AddressType();
                if (reader["AddressTypeId"] != DBNull.Value)
                {
                    _addressType.AddressTypeId = Convert.ToInt32(reader["AddressTypeId"]);
                }
                if (reader["Name"] != DBNull.Value)
                {
                    _addressType.Name = Convert.ToString(reader["Name"]);
                }
                if (reader["RowGuid"] != DBNull.Value)
                {
                    _addressType.RowGuid = new Guid(reader["RowGuid"].ToString());
                }
                if (reader["ModifiedDate"] != DBNull.Value)
                {
                    _addressType.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
                }
                _addressType.NewRecord = false;
                _addressTypeList.Add(_addressType);
            }
            reader.Close();
            return(_addressTypeList);
        }
コード例 #3
0
        public AddressType GetByID(int _addressTypeId)
        {
            AddressTypeDAC _addressTypeComponent = new AddressTypeDAC();
            IDataReader    reader       = _addressTypeComponent.GetByIDAddressType(_addressTypeId);
            AddressType    _addressType = null;

            while (reader.Read())
            {
                _addressType = new AddressType();
                if (reader["AddressTypeId"] != DBNull.Value)
                {
                    _addressType.AddressTypeId = Convert.ToInt32(reader["AddressTypeId"]);
                }
                if (reader["Name"] != DBNull.Value)
                {
                    _addressType.Name = Convert.ToString(reader["Name"]);
                }
                if (reader["RowGuid"] != DBNull.Value)
                {
                    _addressType.RowGuid = new Guid(reader["RowGuid"].ToString());
                }
                if (reader["ModifiedDate"] != DBNull.Value)
                {
                    _addressType.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
                }
                _addressType.NewRecord = false;
            }
            reader.Close();
            return(_addressType);
        }
コード例 #4
0
        public bool Insert(AddressType addresstype)
        {
            int            autonumber           = 0;
            AddressTypeDAC addresstypeComponent = new AddressTypeDAC();
            bool           endedSuccessfuly     = addresstypeComponent.InsertNewAddressType(ref autonumber, addresstype.Name, addresstype.RowGuid, addresstype.ModifiedDate);

            if (endedSuccessfuly)
            {
                addresstype.AddressTypeId = autonumber;
            }
            return(endedSuccessfuly);
        }
コード例 #5
0
        public bool Update(string Name, Guid RowGuid, DateTime ModifiedDate, int Original_AddressTypeId)
        {
            AddressTypeDAC addresstypeComponent = new AddressTypeDAC();

            return(addresstypeComponent.UpdateAddressType(Name, RowGuid, ModifiedDate, Original_AddressTypeId));
        }
コード例 #6
0
        public bool Update(AddressType addresstype, int old_addressTypeId)
        {
            AddressTypeDAC addresstypeComponent = new AddressTypeDAC();

            return(addresstypeComponent.UpdateAddressType(addresstype.Name, addresstype.RowGuid, addresstype.ModifiedDate, old_addressTypeId));
        }
コード例 #7
0
        public int UpdateDataset(System.Data.DataSet dataset)
        {
            AddressTypeDAC addresstypecomponent = new AddressTypeDAC();

            return(addresstypecomponent.UpdateDataset(dataset));
        }
コード例 #8
0
        public void Delete(int Original_AddressTypeId)
        {
            AddressTypeDAC addresstypeComponent = new AddressTypeDAC();

            addresstypeComponent.DeleteAddressType(Original_AddressTypeId);
        }