Пример #1
0
        public PeripheralHistory Create(PeripheralHistory peripheralhistory)
        {
            //var ePeripheral = _iDPeripheral.Create(EPeripheral(peripheral));

            //return (Peripheral(ePeripheral));
            EPeripheralHistory ePeripheralHistory = EPeripheralHistory(peripheralhistory);

            ePeripheralHistory = _iDPeripheralHistory.Create(ePeripheralHistory);
            return(PeripheralHistory(ePeripheralHistory));
        }
Пример #2
0
        private void CreatePeripheralHistory(int createdBy, EPeripheral ePeripheral)
        {
            EPeripheralHistory ePeripheralHistory = new EPeripheralHistory
            {
                CreatedDate  = DateTime.Now,
                DateAssigned = DateTime.Now,

                CreatedBy    = createdBy,
                EmployeeId   = ePeripheral.EmployeeId,
                PeripheralId = ePeripheral.PeripheralId
            };

            _iDPeripheral.Create(ePeripheralHistory);
        }
Пример #3
0
        private EPeripheralHistory EPeripheralHistory(PeripheralHistory peripheralhistory)
        {
            EPeripheralHistory returnEPeripheralHistory = new EPeripheralHistory
            {
                PeripheralHistoryId = peripheralhistory.PeripheralHistoryId,

                PeripheralId = peripheralhistory.PeripheralId,
                EmployeeId   = peripheralhistory.EmployeeId,
                Date         = peripheralhistory.Date,

                CreatedBy = peripheralhistory.CreatedBy,
                UpdatedBy = peripheralhistory.UpdatedBy
            };

            return(returnEPeripheralHistory);
        }
Пример #4
0
        private PeripheralHistory PeripheralHistory(EPeripheralHistory ePeripheralHistory)
        {
            PeripheralHistory returnPeripheralHistory = new PeripheralHistory
            {
                PeripheralHistoryId = ePeripheralHistory.PeripheralHistoryId,

                PeripheralId = ePeripheralHistory.PeripheralId,
                EmployeeId   = ePeripheralHistory.EmployeeId,
                Date         = ePeripheralHistory.Date,

                CreatedBy = ePeripheralHistory.CreatedBy,
                UpdatedBy = ePeripheralHistory.UpdatedBy
            };

            return(returnPeripheralHistory);
        }
Пример #5
0
        public Peripheral Update(Peripheral peripheral)
        {
            EPeripheral currentPeripheral = _iDPeripheral.Read <EPeripheral>(a => a.PeripheralId == peripheral.PeripheralId);
            var         ePeripheral       = _iDPeripheral.Update(EPeripheral(peripheral));

            if (peripheral.EmployeeId != currentPeripheral.EmployeeId)
            {
                EPeripheralHistory ePeripheralHistory = new EPeripheralHistory
                {
                    CreatedDate  = DateTime.Now,
                    Date         = ePeripheral.Date,
                    EmployeeId   = ePeripheral.EmployeeId,
                    PeripheralId = ePeripheral.PeripheralId,
                };

                _iDPeripheral.Create(ePeripheralHistory);
            }
            return(Peripheral(ePeripheral));
        }
Пример #6
0
        public Peripheral Create(Peripheral peripheral)
        {
            //var ePeripheral = _iDPeripheral.Create(EPeripheral(peripheral));

            //return (Peripheral(ePeripheral));
            EPeripheral ePeripheral = EPeripheral(peripheral);

            ePeripheral = _iDPeripheral.Create(ePeripheral);

            EPeripheralHistory ePeripheralHistory = new EPeripheralHistory
            {
                CreatedDate  = DateTime.Now,
                Date         = ePeripheral.Date,
                EmployeeId   = ePeripheral.EmployeeId,
                PeripheralId = ePeripheral.PeripheralId
            };

            _iDPeripheral.Create(ePeripheralHistory);
            return(Peripheral(ePeripheral));
        }
Пример #7
0
        public PeripheralHistory Read(int peripheralhistoryId)
        {
            EPeripheralHistory ePeripheralHistory = _iDPeripheralHistory.Read <EPeripheralHistory>(a => a.PeripheralHistoryId == peripheralhistoryId);

            return(PeripheralHistory(ePeripheralHistory));
        }