Example #1
0
        public bool Insert(string TypeName)
        {
            TransportationTypeDAC transportationtypeComponent = new TransportationTypeDAC();
            int ID = 0;

            return(transportationtypeComponent.InsertNewTransportationType(ref ID, TypeName));
        }
Example #2
0
        public List <TransportationType> GetAll()
        {
            TransportationTypeDAC     _transportationTypeComponent = new TransportationTypeDAC();
            IDataReader               reader = _transportationTypeComponent.GetAllTransportationType().CreateDataReader();
            List <TransportationType> _transportationTypeList = new List <TransportationType>();

            while (reader.Read())
            {
                if (_transportationTypeList == null)
                {
                    _transportationTypeList = new List <TransportationType>();
                }
                TransportationType _transportationType = new TransportationType();
                if (reader["ID"] != DBNull.Value)
                {
                    _transportationType.ID = Convert.ToInt32(reader["ID"]);
                }
                if (reader["TypeName"] != DBNull.Value)
                {
                    _transportationType.TypeName = Convert.ToString(reader["TypeName"]);
                }
                _transportationType.NewRecord = false;
                _transportationTypeList.Add(_transportationType);
            }
            reader.Close();
            return(_transportationTypeList);
        }
Example #3
0
        public bool Insert(TransportationType transportationtype)
        {
            int autonumber = 0;
            TransportationTypeDAC transportationtypeComponent = new TransportationTypeDAC();
            bool endedSuccessfuly = transportationtypeComponent.InsertNewTransportationType(ref autonumber, transportationtype.TypeName);

            if (endedSuccessfuly)
            {
                transportationtype.ID = autonumber;
            }
            return(endedSuccessfuly);
        }
Example #4
0
        public TransportationType GetByID(int _iD)
        {
            TransportationTypeDAC _transportationTypeComponent = new TransportationTypeDAC();
            IDataReader           reader = _transportationTypeComponent.GetByIDTransportationType(_iD);
            TransportationType    _transportationType = null;

            while (reader.Read())
            {
                _transportationType = new TransportationType();
                if (reader["ID"] != DBNull.Value)
                {
                    _transportationType.ID = Convert.ToInt32(reader["ID"]);
                }
                if (reader["TypeName"] != DBNull.Value)
                {
                    _transportationType.TypeName = Convert.ToString(reader["TypeName"]);
                }
                _transportationType.NewRecord = false;
            }
            reader.Close();
            return(_transportationType);
        }
Example #5
0
        public void Delete(int Original_ID)
        {
            TransportationTypeDAC transportationtypeComponent = new TransportationTypeDAC();

            transportationtypeComponent.DeleteTransportationType(Original_ID);
        }
Example #6
0
        public bool Update(string TypeName, int Original_ID)
        {
            TransportationTypeDAC transportationtypeComponent = new TransportationTypeDAC();

            return(transportationtypeComponent.UpdateTransportationType(TypeName, Original_ID));
        }
Example #7
0
        public bool Update(TransportationType transportationtype, int old_iD)
        {
            TransportationTypeDAC transportationtypeComponent = new TransportationTypeDAC();

            return(transportationtypeComponent.UpdateTransportationType(transportationtype.TypeName, old_iD));
        }
Example #8
0
        public int UpdateDataset(System.Data.DataSet dataset)
        {
            TransportationTypeDAC transportationtypecomponent = new TransportationTypeDAC();

            return(transportationtypecomponent.UpdateDataset(dataset));
        }