Ejemplo n.º 1
0
        public ImportStaffDC GetImportStaff(string userName, string currentUserName, string appID, string overrideID, string code, IRepository <ImportStaff> dataRepository, IUnitOfWork uow)
        {
            try
            {
                using (uow)
                {
                    Guid codeGuid = Guid.Parse(code);

                    ImportStaff dataEntity = dataRepository.Single(x => x.Code == codeGuid);

                    ImportStaffDC destination = Mapper.Map <ImportStaff, ImportStaffDC>(dataEntity);

                    return(destination);
                }
            }
            catch (Exception e)
            {
                //Prevent exception from propogating across the service interface
                ExceptionManager.ShieldException(e);

                return(null);
            }
        }
Ejemplo n.º 2
0
        public void CreateImportStaff(string userName, string currentUserName, string appID, string overrideID, ImportStaffDC dc, IRepository <ImportStaff> dataRepository, IUnitOfWork uow)
        {
            try
            {
                using (uow)
                {
                    ImportStaff destination = Mapper.Map <ImportStaffDC, ImportStaff>(dc);

                    dataRepository.Add(destination);

                    uow.Commit();
                }
            }
            catch (Exception e)
            {
                //Prevent exception from propogating across the service interface
                ExceptionManager.ShieldException(e);
            }
        }
Ejemplo n.º 3
0
        public void CreateImportStaff(string userName, string currentUserName, string appID, string overrideID, ImportStaffDC dc)
        {
            IUnitOfWork uow = new UnitOfWork();

            Repository <ImportStaff> dataRepository = new Repository <ImportStaff>(uow.ObjectContext);

            CreateImportStaff(userName, currentUserName, appID, overrideID, dc, dataRepository, uow);
        }