예제 #1
0
        public static void Init()
        {
            if (Inited == false)
            {
                Inited = true;
                IRouteRepository             _IRouteRepository             = new RouteRepository();
                IRouteService                _IRouteService                = new RouteService(_IRouteRepository);
                IConnectionRepository        _IConnectionRepository        = new ConnectionRepository();
                IConnectionService           _IConnectionService           = new ConnectionService(_IConnectionRepository);
                IStationRepository           _IStationRepository           = new StationRepository();
                IStationService              _IStationService              = new StationService(_IStationRepository, _IConnectionRepository);
                IWalkingConnectionRepository _IWalkingConnectionRepository = new WalkingConnectionRepository();
                IWalkingConnectionService    _IWalkingConnectionService    = new WalkingConnectionService(_IWalkingConnectionRepository);

                oldStationList           = _IStationService.GetAllStation();
                oldConnectionList        = _IConnectionService.GetAllConnection();
                oldWalkingConnectionList = _IWalkingConnectionService.GetAllWalkingConnection();
                oldRouteList             = _IRouteService.GetRoute();
                newConnectionList        = new List <ViewModelNewConnection>();
                newStationList           = new List <ViewModelNewStation>();
                fanOut = new Dictionary <int, List <Vertex> >();
                //Graph.CreateNewGraph();
                Graph.CreateNewWalkingGraph();
                InitCompleted = true;
                _IRouteRepository.Dispose();
                _IConnectionRepository.Dispose();
                _IStationRepository.Dispose();
            }
        }
예제 #2
0
 public BasePusher(IOptionManager optionManager, ConnectionRepository connectionRepository, IRichAdapter adapter, IRichProvider provider)
 {
     OptionManager             = optionManager;
     this.Adapter              = adapter;
     this.Provider             = provider;
     this.ConnectionRepository = connectionRepository;
 }
예제 #3
0
        void LoadUserControls()
        {
            List <Models.DeviceAttribute> Devices = new List <Models.DeviceAttribute>();

            Devices = GetData();
            ConnectionRepository     Cr  = new ConnectionRepository();
            Dictionary <string, int> dec = Cr.GetComportCategory();

            foreach (var item in dec)
            {
                List <byte> addList = new List <byte>();
                int         j       = 0;
                foreach (var device in Devices.Select((value, i) => new { i, value }))
                {
                    if (device.value.Comport == item.Key)
                    {
                        addList.Add(device.value.Address);
                        if (j == item.Value - 1)
                        {
                            ETP98 = new ETP98UserCtrl(addList, device.value.Comport);
                            TempPnl.Controls.Add(ETP98);
                        }
                        j++;
                    }
                }
            }
        }
예제 #4
0
 public BaseIndexer(IOptionManager optionManager, IRichAdapter adapter, IRichProvider provider, ConnectionRepository connectionRepository)
 {
     OptionManager        = optionManager;
     Adapter              = adapter;
     Provider             = provider;
     ConnectionRepository = connectionRepository;
 }
예제 #5
0
 public EntityIndexer(EntityProcessor processor,
                      EntityIndexerOptionManager optionManager,
                      FastProvider provider,
                      FastAdapter adapter,
                      EntityRepository entityRepository,
                      ConnectionRepository connectionRepository) : base(processor, optionManager, provider, adapter, entityRepository, connectionRepository)
 {
 }
예제 #6
0
 public ProductPusher(ProductPusherOptionManager optionManager,
                      ProductProcessor processor,
                      FastProvider provider,
                      FastAdapter adapter,
                      EntityRepository entityRepository,
                      ConnectionRepository connectionRepository) : base(optionManager, processor, provider, adapter, entityRepository, connectionRepository)
 {
 }
예제 #7
0
 public ParentCategoryMapper(ParentCategoryProcessor processor,
                             ParentCategoryMapperOptionManager optionManager,
                             FastProvider provider,
                             FastAdapter adapter,
                             EntityRepository entityRepository,
                             ConnectionRepository connectionRepository) : base(processor, optionManager, provider, adapter, entityRepository, connectionRepository)
 {
 }
예제 #8
0
 public OrderPuller(OrderPullerOptionManager optionManager,
                    OrderProcessor processor,
                    FastProvider provider,
                    FastAdapter adapter,
                    EntityRepository entityRepository,
                    ConnectionRepository connectionRepository) : base(optionManager, processor, provider, adapter, entityRepository, connectionRepository)
 {
 }
예제 #9
0
 public SubCategoryPusher(SubCategoryPusherOptionManager optionManager,
                          SubCategoryProcessor processor,
                          FastProvider provider,
                          FastAdapter adapter,
                          EntityRepository entityRepository,
                          ConnectionRepository connectionRepository) : base(optionManager, processor, provider, adapter, entityRepository, connectionRepository)
 {
 }
예제 #10
0
 public IEnumerable <Cliente> GetClientes()
 {
     using (IDbConnection connection = new SqlConnection(ConnectionRepository.GetConnectionString()))
     {
         connection.Open();
         var clientes = connection.Query <Cliente>("sp_cliente_listar", commandType: CommandType.StoredProcedure);
         return(clientes);
     }
 }
 public IEnumerable <Credito> GetAll()
 {
     using (IDbConnection connection = new SqlConnection(ConnectionRepository.GetConnectionString()))
     {
         connection.Open();
         var creditos = connection.Query <Credito>("sp_credito_listar", commandType: CommandType.StoredProcedure);
         return(creditos);
     }
 }
예제 #12
0
 public AttributeSetMapper(
     AttributeSetProcessor processor,
     AttributeSetMapperOptionManager optionManager,
     FastProvider provider,
     FastAdapter adapter,
     EntityRepository entityRepository,
     ConnectionRepository connectionRepository) : base(processor, optionManager, provider, adapter, entityRepository, connectionRepository)
 {
 }
예제 #13
0
 public EntityPuller(EntityPullerOptionManager optionManager,
                     EntityProcessor processor,
                     FastProvider provider,
                     FastAdapter adapter,
                     EntityRepository entityRepository,
                     ConnectionRepository connectionRepository) : base(optionManager, processor, provider, adapter, entityRepository, connectionRepository)
 {
     this.adapter = adapter;
 }
예제 #14
0
 public ProductStockPusher(ProductStockPusherOptionManager optionManager,
                           ProductProcessor entityProcessor,
                           StockAttributeProcessor attributeProcessor,
                           FastProvider provider,
                           FastAdapter adapter,
                           EntityRepository entityRepository,
                           AttributeRepository attributeRepository,
                           ConnectionRepository connectionRepository) : base(optionManager, entityProcessor, attributeProcessor, provider, adapter, entityRepository, attributeRepository, connectionRepository)
 {
 }
예제 #15
0
 public BaseEntityPuller(IOptionManager optionManager,
                         IProcessor processor,
                         IRichProvider provider,
                         IRichAdapter adapter,
                         EntityRepository entityRepository,
                         ConnectionRepository connectionRepository) : base(optionManager, provider, adapter, connectionRepository)
 {
     EntityProcessor  = processor;
     EntityRepository = entityRepository;
 }
예제 #16
0
 public QueueIndexChangesStep(ResolverFactory resolver,
                              EntityRepository entityRepository,
                              AttributeRepository attributeRepository,
                              ConnectionRepository connectionRepository,
                              QueueChangesManager queueChangesManager) : base(resolver)
 {
     this.entityRepository     = entityRepository;
     this.attributeRepository  = attributeRepository;
     this.connectionRepository = connectionRepository;
     this.queueChangesManager  = queueChangesManager;
 }
예제 #17
0
 public AttributeIndexer(
     EntityProcessor entityProcessor,
     AttributeProcessor attributeProcessor,
     AttributeIndexerOptionManager optionManager,
     FastProvider provider,
     FastAdapter adapter,
     EntityRepository entityRepository,
     AttributeRepository attributeRepository,
     ConnectionRepository connectionRepository) : base(entityProcessor, attributeProcessor, optionManager, provider, adapter, entityRepository, attributeRepository, connectionRepository)
 {
 }
예제 #18
0
 public ConnectionsController(
     ConnectionRepository connectionRepository,
     DbTransaction transaction,
     IEnumerable <IRichProvider> providers,
     JsonSerializer serializer)
 {
     _connectionRepository = connectionRepository;
     _transaction          = transaction;
     _providers            = providers;
     this.serializer       = serializer;
 }
예제 #19
0
        public Cliente GetCliente(string numeroDocumento)
        {
            using (IDbConnection connection = new SqlConnection(ConnectionRepository.GetConnectionString()))
            {
                connection.Open();
                var parameters = new DynamicParameters();
                parameters.Add("NumeroDocumento", numeroDocumento);

                var cliente = connection.QuerySingle <Cliente>("sp_cliente_obtener", param: parameters, commandType: CommandType.StoredProcedure);
                return(cliente);
            }
        }
        public bool Delete(int id)
        {
            using (IDbConnection connection = new SqlConnection(ConnectionRepository.GetConnectionString()))
            {
                connection.Open();
                var parameters = new DynamicParameters();
                parameters.Add("IdCredito", id);

                var result = connection.Execute("sp_credito_eliminar", param: parameters, commandType: CommandType.StoredProcedure);
                return(result > 0);
            }
        }
예제 #21
0
        public SecurityRuleForm(Main form)
        {
            InitializeComponent();
            _form     = form;
            _connRepo = form.ConnRepo;

            InitializeDataGrid();
            InitializeDetailObjects();

            RefreshCmbConnections();
            RefreshServerInfo((Connection)cmbConnections.SelectedItem);
        }
예제 #22
0
 public AttributePuller(
     AttributePullerOptionManager optionManager,
     EntityProcessor entityProcessor,
     AttributeProcessor attributeProcessor,
     FastProvider provider,
     EntityRepository entityRepository,
     AttributeRepository attributeRepository,
     ConnectionRepository connectionRepository,
     FastAdapter adapter) : base(optionManager, entityProcessor, attributeProcessor, provider, adapter, entityRepository, attributeRepository, connectionRepository)
 {
     this.adapter = adapter;
 }
        public Credito GetById(int id)
        {
            using (IDbConnection connection = new SqlConnection(ConnectionRepository.GetConnectionString()))
            {
                connection.Open();
                var parameters = new DynamicParameters();
                parameters.Add("IdCredito", id);

                var credito = connection.QuerySingle <Credito>("sp_credito_obtener", param: parameters, commandType: CommandType.StoredProcedure);
                return(credito);
            }
        }
예제 #24
0
 //UPDATE CONNECTION ON FIRST LOAD OR START CREATION FORM
 private void CreateConnectionRepo()
 {
     try
     {
         _connRepo = new ConnectionRepository();
         RefreshCmbConnections();
     }
     catch (Exception ex)
     {
         CreateConnection ConnectionForm = new CreateConnection(this, ex.Message);
         ConnectionForm.ShowDialog();
     }
 }
예제 #25
0
 public PullersController(IEnumerable <IEntityPuller> entityPullers,
                          IEnumerable <IAttributePuller> attributePullers,
                          IEnumerable <IIndexer> indexers,
                          EntityRepository entityRepository,
                          AttributeRepository attributeRepository,
                          ConnectionRepository connectionRepository)
 {
     _entityPullers            = entityPullers;
     _attributePullers         = attributePullers;
     _indexers                 = indexers;
     this.entityRepository     = entityRepository;
     this.attributeRepository  = attributeRepository;
     this.connectionRepository = connectionRepository;
 }
예제 #26
0
        public HttpResponseMessage Logout()
        {
            // Change user status to Offline
            var userId = HttpContext.Current.GetOwinContext().Authentication.User.Identity.GetUserId();
            var hub    = GlobalHost.ConnectionManager.GetHubContext <ChatHub>();
            IConnectionRepository connectionRepository = new ConnectionRepository(new DataContext());

            connectionRepository.RemoveUser(new Guid(userId), null);
            hub.Clients.All.onUserDisconnected(userId);

            HttpContext.Current.GetOwinContext().Authentication.SignOut();

            return(Request.CreateResponse(HttpStatusCode.Accepted, true));
        }
예제 #27
0
 public BaseMapper(
     IProcessor processor,
     IOptionManager optionManager,
     IRichProvider provider,
     IRichAdapter adapter,
     EntityRepository entityRepository,
     ConnectionRepository connectionRepository)
 {
     Processor            = processor;
     OptionManager        = optionManager;
     Provider             = provider;
     Adapter              = adapter;
     EntityRepository     = entityRepository;
     ConnectionRepository = connectionRepository;
 }
예제 #28
0
 public BaseAttributeIndexer(
     IProcessor entityProcessor,
     IProcessor attributeProcessor,
     IOptionManager optionManager,
     IRichProvider provider,
     IRichAdapter adapter,
     EntityRepository entityRepository,
     AttributeRepository attributeRepository,
     ConnectionRepository connectionRepository) : base(optionManager, adapter, provider, connectionRepository)
 {
     AttributeProcessor  = attributeProcessor;
     EntityProcessor     = entityProcessor;
     EntityRepository    = entityRepository;
     AttributeRepository = attributeRepository;
 }
예제 #29
0
 public BaseAttributePusher(
     IOptionManager optionManager,
     IProcessor entityProcessor,
     IProcessor attributeProcessor,
     IRichProvider provider,
     IRichAdapter adapter,
     EntityRepository entityRepository,
     AttributeRepository attributeRepository,
     ConnectionRepository connectionRepository) : base(optionManager, connectionRepository, adapter, provider)
 {
     this.EntityProcessor     = entityProcessor;
     this.AttributeProcessor  = attributeProcessor;
     this.EntityRepository    = entityRepository;
     this.AttributeRepository = attributeRepository;
 }
예제 #30
0
        static void Main()
        {
            AppDomain.CurrentDomain.UnhandledException += UnhandledException;

            Application.ThreadException += ThreadException;
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var connectionRepository = new ConnectionRepository();
            var connectionView       = new ConnectionForm();
            var connectionPresenter  = new ConnectionPresenter(connectionView, connectionRepository);

            Application.Run(connectionView);
        }