public Person SinglePerson(int BusinessEntityID)
        {
            var repo = new PersonRespository(ConnectionString);

            _person = repo.GetById(BusinessEntityID);
            return(_person);
        }
        public IEnumerable <Person> Build()
        {
            var repository = new PersonRespository(ConnectionString);
            var people     = repository.GetAll();

            return(people);
        }
Beispiel #3
0
        public UnitOfWork(OneSmallStepContext context)
        {
            _context = context;

            Person      = new PersonRespository(_context);
            PersonType  = new PersonTypeRespository(_context);
            MessageType = new MessageTypeRepository(_context);

            Message = new MessageRepository(_context);

            //Authors = new AuthorRepository(_context);
        }
 public void UpdatePerson(Person person)
 {
     try
     {
         PersonRespository repo = new PersonRespository(ConnectionString);
         repo.EditPerson(person);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
 public void  InsertPerson(Person p)
 {
     try
     {
         PersonRespository repo = new PersonRespository(ConnectionString);
         repo.CreatePerson(p);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        public FrmPersonInfo(PersonInfo personInfo, LocationInfo locationInfo)
        {
            this.PersonToUpdate   = personInfo;
            this.LocationToUpdate = locationInfo;
            string exePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            dbPath = string.Format($"{exePath}\\{DBConstant.SqlLiteDBFileName}");

            InitializeComponent();
            personRespository           = new PersonRespository(dbPath);
            propertyLocationRespository = new LocationRespository(dbPath);
        }
Beispiel #7
0
        public FrmCreateAsset()
        {
            string exePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            dbPath = string.Format($"{exePath}\\{DBConstant.SqlLiteDBFileName}");

            InitializeComponent();
            this.WindowState            = FormWindowState.Maximized;
            personRespository           = new PersonRespository(dbPath);
            assetManagementRepository   = new AssetManagementRepository(dbPath);
            propertyLocationRespository = new LocationRespository(dbPath);
        }
        public FrmAssetSearch()
        {
            InitializeComponent();

            string exePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            dbPath = string.Format($"{exePath}\\{DBConstant.SqlLiteDBFileName}");
            assetManagementRepository = new AssetManagementRepository(dbPath);
            personRespository         = new PersonRespository(dbPath);

            this.WindowState = FormWindowState.Maximized;
            assetCollection  = new List <AssetViewModel>();
            InitDataGridView();
        }
Beispiel #9
0
        public FrmSearchPersonInfo()
        {
            string exePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            dbPath = string.Format($"{exePath}\\{DBConstant.SqlLiteDBFileName}");

            InitializeComponent();
            InitDataGridView();

            this.WindowState             = FormWindowState.Maximized;
            personRespository            = new PersonRespository(dbPath);
            propertyLocationRespository  = new LocationRespository(dbPath);
            personGridView.MultiSelect   = false;
            personGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
        }