Beispiel #1
0
 public LoginController(IConfiguration configuration, IHostingEnvironment env, ILoggerFactory loggerFactory, IDataInterface dataInterface)
 {
     this.dataInterface = dataInterface;
     this.configuration = configuration;
     this.env           = env;
     logger             = loggerFactory.CreateLogger(typeof(LoginController));
 }
        public void UpdateDataFileSource(IDataInterface dataInterface, string dataSourceFileName)
        {
            var connectionBuilder = DataInterfaceManager.GetBlaiseConnectionStringBuilder();

            connectionBuilder.DataSource = dataSourceFileName;
            dataInterface.ConnectionInfo.SetConnectionString(connectionBuilder.ConnectionString);
        }
Beispiel #3
0
 public CourseService(IDataInterface _dataSource, IConfiguration _config, ILoggerInterface _logger)
 {
     config     = _config;
     dataSource = _dataSource;
     data       = dataSource.GetDataSource();
     logger     = _logger;
 }
Beispiel #4
0
 public ReferralsService(IDataInterface dataInterface, IPdfConverter pdfConverter, ICurrentUser currentUser, IHostingEnvironment environment)
 {
     this.dataInterface = dataInterface;
     this.pdfConverter  = pdfConverter;
     this.userService   = currentUser;
     this.env           = environment;
 }
Beispiel #5
0
 public UrlController(ILogger <UrlController> logger, IConfiguration configuration, IDataInterface dataInterface,
                      IHttpContextAccessor httpContextAccessor)
 {
     _logger              = logger;
     _configuration       = configuration;
     _dataInterface       = dataInterface;
     _httpContextAccessor = httpContextAccessor;
 }
Beispiel #6
0
        public VolunteersController(IConfiguration configuration, IHttpContextAccessor httpContextAccessor, ILoggerFactory loggerFactory, IHostingEnvironment env, IDataInterface dataInterface)
        {
            this.dataInterface = dataInterface;
            this.configuration = configuration;

            this.httpContextAccessor = httpContextAccessor;
            logger   = loggerFactory.CreateLogger(typeof(VolunteersController));
            this.env = env;
        }
 protected override void InitializeInternal()
 {
     base.InitializeInternal();
     this.FindEBSVersion();
     this.InitWorkHandlers();
     _di = DataInterfaceFactory.GetInterface();
     _ns.Add("gsa", s2sHelper.NS_GSA);
     _ns.Add("bS2S", s2sHelper.NS_BS2S);
     InitializeSendDataToEBSThread();
 }
        public InformationBuilder CountAllDoneItems(int id)
        {
            classFactory = new ConcreteFactory();

            IDataInterface CountStatus = classFactory.StatusReports("done");

            CountStatus.Status(id);// DatalistID
            //_Name = name;
            return(this);
        }
        public InformationBuilder CountAllPendingItems(int id)
        {
            classFactory = new ConcreteFactory();

            IDataInterface CountStatus = classFactory.StatusReports("pending");

            CountStatus.Status(id);// DatalistID
            //_Description = des;
            return(this);
        }
 protected override void InitializeInternal()
 {
     base.InitializeInternal();
     this.FindEBSVersion();
     this.InitWorkHandlers();
     _di = DataInterfaceFactory.GetInterface();
     _ns.Add("gsa", s2sHelper.NS_GSA);
     _ns.Add("bS2S", s2sHelper.NS_BS2S);
     InitializeSendDataToEBSThread();
 }
Beispiel #11
0
 public SiteminderAuthenticationHandler(IOptionsMonitor <SiteMinderAuthOptions> configureOptions,
                                        ILoggerFactory loggerFactory,
                                        UrlEncoder encoder,
                                        ISystemClock clock,
                                        IDataInterface dataInterface,
                                        IHostingEnvironment environment)
     : base(configureOptions, loggerFactory, encoder, clock)
 {
     this.environment   = environment;
     this.dataInterface = dataInterface;
     logger             = loggerFactory.CreateLogger(typeof(SiteminderAuthenticationHandler));
 }
 public static IDataInterface GetInterface()
 {
     if (_object == null)
     {
         lock (_lock)
         {
             if (_object == null)
             {
                 try
                 {
                 	_object = MEFHelper.GetExportedValue<IDataInterface>("DataInterface");
             	}
                 catch (Exception)
                 {
                     _object = new CommonDataInterface();
         		}
    			 }
         }
     }
     return _object;
 }
 public static IDataInterface GetInterface()
 {
     if (_object == null)
     {
         lock (_lock)
         {
             if (_object == null)
             {
                 try
                 {
                     _object = MEFHelper.GetExportedValue<IDataInterface>("DataInterface");
                 }
                 catch (Exception)
                 {
                     _object = new CommonDataInterface();
                 }
        			 }
         }
     }
     return _object;
 }
        /// <summary>
        /// Updates Windows Update Operation Result
        /// </summary>
        /// <param name="fabricClient">fabric client to carry out operations on service fabric</param>
        /// <param name="applicationUri">Application name of the Patch Orchestration Application</param>
        /// <param name="operationResult">Result of Windows Update operation <see cref="WindowsUpdateOperationResult"/></param>
        /// <param name="timeout">Timeout for the operation</param>
        /// <param name="cancellationToken">Cancellation token to cancel this async operation</param>
        /// <returns>A Task representing the asnyc operation, result of the task would be <see cref="NodeAgentSfUtilityExitCodes"/></returns>
        internal static async Task <NodeAgentSfUtilityExitCodes> UpdateWuOperationResult(
            FabricClient fabricClient,
            Uri applicationUri,
            WindowsUpdateOperationResult operationResult,
            TimeSpan timeout,
            CancellationToken cancellationToken)
        {
            try
            {
                IDataInterface coordinatorServiceDataClient = ServiceProxy.Create <IDataInterface>(new Uri(applicationUri + CoordinatorServiceSuffix));
                await
                coordinatorServiceDataClient.UpdateWuOperationResult(
                    operationResult,
                    timeout,
                    cancellationToken);

                return(NodeAgentSfUtilityExitCodes.Success);
            }
            catch (Exception e)
            {
                ServiceEventSource.Current.ErrorMessage(
                    String.Format("CoordinatorServiceHelper.UpdateWuOperationResult failed. Exception details {0}", e));
                if (e is FabricTransientException)
                {
                    return(NodeAgentSfUtilityExitCodes.RetryableException);
                }
                else if (e is FabricServiceNotFoundException)
                {
                    return(NodeAgentSfUtilityExitCodes.ServiceNotFound);
                }
                else
                {
                    return(NodeAgentSfUtilityExitCodes.Failure);
                }
            }
        }
Beispiel #15
0
 /// <summary>
 /// public constructor for temperature data 
 /// </summary>
 /// <param name="tempRepo">accepts temperature repository</param>
 public TempController(IDataInterface tempRepo)
 {
     this.tempRepo = tempRepo;
 }
 public ReferralsService(IDataInterface dataInterface, IPdfConverter pdfConverter)
 {
     this.dataInterface = dataInterface;
     this.pdfConverter  = pdfConverter;
 }
Beispiel #17
0
 public OrganizationsController(
     ILoggerFactory loggerFactory, IDataInterface dataInterface)
 {
     logger             = loggerFactory.CreateLogger(typeof(OrganizationsController));
     this.dataInterface = dataInterface;
 }
Beispiel #18
0
 // public DataController() { }
 public DataController(IDataInterface dataInterface)
 {
     _dataInterface = dataInterface;
 }
Beispiel #19
0
 public CountriesController(ILoggerFactory loggerFactory, IDataInterface dataInterface)
 {
     this.dataInterface = dataInterface;
     logger             = loggerFactory.CreateLogger(typeof(CountriesController));
 }
 public NewRegistrationService(IDataInterface dataInterface, IEmailSender emailSender, IMediator mediator)
 {
     this.dataInterface = dataInterface;
     this.emailSender   = emailSender;
     this.mediator      = mediator;
 }
 public RegistrationEventStoreHandler(IDataInterface dataInterface, IHttpContextAccessor httpContext)
 {
     this.dataInterface = dataInterface;
     this.httpContext   = httpContext;
 }
Beispiel #22
0
 public ReferralsController(IDataInterface dataInterface, IReferralsService referralsService)
 {
     this.dataInterface    = dataInterface;
     this.referralsService = referralsService;
 }
 public DataInterClient(IDataInterface idataInteface)
 {
     this._idataInteface = idataInteface;
 }
Beispiel #24
0
 public AuditService(IDataInterface dataInterface, IHttpContextAccessor httpContext)
 {
     this.dataInterface = dataInterface;
     this.httpContext = httpContext;
 }
 public FamilyRelationshipsController(ILoggerFactory loggerFactory, IDataInterface dataInterface)
 {
     this.dataInterface = dataInterface;
     logger             = loggerFactory.CreateLogger(typeof(FamilyRelationshipsController));
 }
 /// <summary>
 /// Transforms a principal returned from KeyCloak authentication service
 /// </summary>
 /// <param name="dataInterface"></param>
 public KeyCloakClaimTransformer(IDataInterface dataInterface)
 {
     this.dataInterface = dataInterface;
 }
 public DeactivateRegistrationService(IDataInterface dataInterface, IMediator mediator)
 {
     this.dataInterface = dataInterface;
     this.mediator      = mediator;
 }
Beispiel #28
0
 public RegistrationQueryService(IDataInterface dataInterface, IMediator mediator, IMapper mapper)
 {
     this.dataInterface = dataInterface;
     this.mediator      = mediator;
     this.mapper        = mapper;
 }
        /// <summary>
        /// Method for consuming and processing messages on the RabbitMQ queue.
        /// </summary>
        public void ConsumeMessage()
        {
            // Objects for working with Blaise data sets.
            IDataLink4 dl_source    = null;
            IDatamodel dm_source    = null;
            IDataLink4 dl_dest_sql  = null;
            IDataLink  dl_dest_file = null;

            // Functionality to be performed when a message is received. (digestion)
            consumer.Received += (model, ea) =>
            {
                // Extract the message and encode it.
                var body    = ea.Body;
                var message = Encoding.UTF8.GetString(body);
                log.Info("Message received - " + message);

                MessageData data = null;
                try
                {
                    // Take the serialized JSON string and deserialize it into a MessageData object.
                    data = new JavaScriptSerializer().Deserialize <MessageData>(message);

                    // Connect to the Blaise source data set.
                    dl_source = GetDataLink(data.source_hostname, data.source_instrument, data.source_server_park);
                    dm_source = dl_source.Datamodel;

                    // Identify the primary key in the source data set.
                    var key = DataRecordManager.GetKey(dm_source, "PRIMARY");

                    // Assign the primary key the value of the 'serial_number' recieved from the RabbitMQ message.
                    key.Fields[0].DataValue.Assign(data.serial_number);

                    // Check if a case with this key exists in the source data set.
                    if (dl_source.KeyExists(key))
                    {
                        // Read in the case.
                        var case_record = dl_source.ReadRecord(key);

                        if (data.action == "delete")
                        {
                            dl_source.Delete(key);
                            SendStatus(MakeStatusJson(data, "Case Deleted"));
                        }
                        else
                        {
                            // Connect to the Blaise sql database destination data set  if provided in payload.
                            if ((data.dest_hostname != "" && data.dest_hostname != null) && (data.dest_server_park != "" && data.dest_server_park != null))
                            {
                                dl_dest_sql = GetDataLink(data.dest_hostname, data.dest_instrument, data.dest_server_park);

                                // Copy or move the case from the source to destination based on the 'action' received from the message.
                                switch (data.action)
                                {
                                // Copy action received.
                                case "copy":
                                    dl_dest_sql.Write(case_record);
                                    if (!dl_dest_sql.KeyExists(key))
                                    {
                                        SendStatus(MakeStatusJson(data, "Error"));
                                        log.Error(data.dest_instrument + " case " + data.serial_number + " NOT copied from " + data.source_server_park + "@" + data.source_hostname + " to " + data.dest_server_park + "@" + data.dest_hostname + ".");
                                    }
                                    if (dl_dest_sql.KeyExists(key))
                                    {
                                        SendStatus(MakeStatusJson(data, "Case Copied"));
                                        log.Info(data.dest_instrument + " case " + data.serial_number + " copied from " + data.source_server_park + "@" + data.source_hostname + " to " + data.dest_server_park + "@" + data.dest_hostname + ".");
                                    }
                                    break;

                                // Move action received.
                                case "move":
                                    dl_dest_sql.Write(case_record);
                                    dl_source.Delete(key);
                                    if (!dl_dest_sql.KeyExists(key))
                                    {
                                        SendStatus(MakeStatusJson(data, "Error"));
                                        log.Error(data.dest_instrument + " case " + data.serial_number + " NOT moved from " + data.source_server_park + "@" + data.source_hostname + " to " + data.dest_server_park + "@" + data.dest_hostname + ".");
                                    }
                                    if ((dl_dest_sql.KeyExists(key)) && (dl_source.KeyExists(key)))
                                    {
                                        SendStatus(MakeStatusJson(data, "Warn"));
                                        log.Warn(data.dest_instrument + " case " + data.serial_number + " copied from " + data.source_server_park + "@" + data.source_hostname + " to " + data.dest_server_park + "@" + data.dest_hostname + " but also still exists in " + data.source_server_park + "@" + data.source_hostname + ".");
                                    }
                                    if ((dl_dest_sql.KeyExists(key)) && (!dl_source.KeyExists(key)))
                                    {
                                        SendStatus(MakeStatusJson(data, "Case Moved"));
                                        log.Info(data.dest_instrument + " case " + data.serial_number + " moved from " + data.source_server_park + "@" + data.source_hostname + " to " + data.dest_server_park + "@" + data.dest_hostname + ".");
                                    }
                                    break;

                                // Invalid action received.
                                default:
                                    SendStatus(MakeStatusJson(data, "Invalid Action"));
                                    log.Error("Invalid action requested - " + data.action);
                                    break;
                                }
                            }

                            // Connect to the Blaise file database destination data set if provided in payload.
                            if (data.dest_filepath != "" && data.dest_filepath != null)
                            {
                                // Check destination file database exists, and if not create it.
                                if (!File.Exists(data.dest_filepath + "\\" + data.dest_instrument + ".bdbx"))
                                {
                                    // Get source BMI and BDI to setup new file destination data set.
                                    string sourceBMI = GetSourceBMI(data.source_hostname, data.source_server_park, data.source_instrument);
                                    string sourceBDI = GetSourceBDI(data.source_hostname, data.source_server_park, data.source_instrument);

                                    // Create source directory from destination file path recieved in payload.
                                    Directory.CreateDirectory(data.dest_filepath);

                                    // Copy BMI from source to destination file path recieved in payload.
                                    File.Copy(sourceBMI, data.dest_filepath + "\\" + data.dest_instrument + ".bmix", true);

                                    // Create destination file data set.
                                    IDataInterface di = DataInterfaceManager.GetDataInterface();
                                    di.ConnectionInfo.DataSourceType   = DataSourceType.Blaise;
                                    di.ConnectionInfo.DataProviderType = DataProviderType.BlaiseDataProviderForDotNET;
                                    di.DataPartitionType = DataPartitionType.Stream;
                                    IBlaiseConnectionStringBuilder csb = DataInterfaceManager.GetBlaiseConnectionStringBuilder();
                                    csb.DataSource = data.dest_filepath + "\\" + data.dest_instrument + ".bdbx";
                                    di.ConnectionInfo.SetConnectionString(csb.ConnectionString);
                                    di.DatamodelFileName = data.dest_filepath + "\\" + data.dest_instrument + ".bmix";
                                    di.FileName          = data.dest_filepath + "\\" + data.dest_instrument + ".bdix";
                                    di.CreateTableDefinitions();
                                    di.CreateDatabaseObjects(null, true);
                                    di.SaveToFile(true);
                                }

                                // Connect to the Blaise file database destination data set.
                                dl_dest_file = DataLinkManager.GetDataLink(data.dest_filepath + "\\" + data.dest_instrument + ".bdix");

                                // Copy or move the case from the source to destination based on the 'action' received from the message.
                                switch (data.action)
                                {
                                // Copy action received.
                                case "copy":
                                    dl_dest_file.Write(case_record);
                                    if (dl_dest_file.ReadRecord(key) == null)
                                    {
                                        SendStatus(MakeStatusJson(data, "Error"));
                                        log.Error(data.dest_instrument + " case " + data.serial_number + " NOT copied from " + data.source_server_park + "@" + data.source_hostname + " to " + data.dest_filepath + ".");
                                    }
                                    if (dl_dest_file.ReadRecord(key) != null)
                                    {
                                        SendStatus(MakeStatusJson(data, "Case Copied"));
                                        log.Info(data.dest_instrument + " case " + data.serial_number + " copied from " + data.source_server_park + "@" + data.source_hostname + " to " + data.dest_filepath + ".");
                                    }
                                    break;

                                // Move action received.
                                case "move":
                                    dl_dest_file.Write(case_record);
                                    dl_source.Delete(key);
                                    if (dl_dest_file.ReadRecord(key) == null)
                                    {
                                        SendStatus(MakeStatusJson(data, "Error"));
                                        log.Error(data.dest_instrument + " case " + data.serial_number + " NOT moved from " + data.source_server_park + "@" + data.source_hostname + " to " + data.dest_filepath + ".");
                                    }
                                    if ((dl_dest_file.ReadRecord(key) != null) && (dl_source.KeyExists(key)))
                                    {
                                        SendStatus(MakeStatusJson(data, "Warn"));
                                        log.Warn(data.dest_instrument + " case " + data.serial_number + " copied from " + data.source_server_park + "@" + data.source_hostname + " to " + data.dest_filepath + " but also still exists in " + data.source_server_park + "@" + data.source_hostname + ".");
                                    }
                                    if ((dl_dest_file.ReadRecord(key) != null) && (!dl_source.KeyExists(key)))
                                    {
                                        SendStatus(MakeStatusJson(data, "Case Moved"));
                                        log.Info(data.dest_instrument + " case " + data.serial_number + " moved from " + data.source_server_park + "@" + data.source_hostname + " to " + data.dest_filepath + ".");
                                    }
                                    break;

                                // Invalid action received.
                                default:
                                    SendStatus(MakeStatusJson(data, "Invalid Action"));
                                    log.Error("Invalid action requested - " + data.action);
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        SendStatus(MakeStatusJson(data, "Case NOT Found"));
                        log.Error("Case " + data.serial_number.ToString() + " doesn't exist in source database.");
                    }
                }
                catch (Exception e)
                {
                    SendStatus(MakeStatusJson(data, "Error"));
                    log.Error(e);
                }
                // Remove from queue when done processing
                channel.BasicAck(ea.DeliveryTag, false);
            };

            // Consume and process any messages already held on the queue.
            string queueName = ConfigurationManager.AppSettings["HandlerQueueName"];

            channel.BasicConsume(queue: queueName, autoAck: false, consumer: consumer);
        }
Beispiel #30
0
 public EvacueesController(IDataInterface dataInterface)
 {
     this.dataInterface = dataInterface;
 }
Beispiel #31
0
        private void initForm()
        {
            if (!this.IsSaveAs)
            {
                this.textEdit1.Enabled = false;
            }

            switch (this.PutType)
            {
            case "单位工程":
                this.DataInterface = new CUActionData(this.CurrentBusiness);
                break;

            default:    //默认为项目导出
                this.DataInterface = new CPActionData(this.CurrentBusiness);
                break;
            }

            //默认文件名称为项目名称
            this.textEdit1.Text = (this.m_DataSource[0] as _COBJECTS).Name;

            this.buttonEdit1.Text = APP.Application.Global.AppFolder.FullName + "工程文件\\";



            //魔人文件路径为应用程序路径
            //this.ctrlAttributes1.IDataSource = (this.m_DataSource[0] as _COBJECTS).Reveal.Attributes;
            //this.ctrlAttributes1.DataBind();

            this.ctrlAttributes1.Invoke(new Action <IAttributes>(this.ctrlAttributes1.DataBind), (this.m_DataSource[0] as _COBJECTS).Reveal.Attributes);

            //MethodInfo method = typeof(CtrlAttributes).GetMethod("DataBind", new Type[] { typeof(IAttributes) });
            //method.Invoke(this.ctrlAttributes1, new object[] { (this.m_DataSource[0] as _COBJECTS).Reveal.Attributes });


            //根据对象类型判断如何选择
            switch (this.PutType)
            {
            case "单项工程":    //单项工程
            case "单位工程":
                this.radioOther.Visible   = true;
                this.radioProject.Visible = false;
                break;

            default:    //默认为项目
                this.radioOther.Visible   = false;
                this.radioProject.Visible = true;
                break;
            }
            //根据导出类型初始化选择
            switch (this.m_OutType)
            {
            case "TBS":
                this.radioProject.SelectedIndex = 1;
                this.radioProject.Enabled       = false;
                break;

            case "ZBS":
                this.radioProject.SelectedIndex = 2;
                this.radioProject.Enabled       = false;
                break;

            case "BD":
                this.radioProject.SelectedIndex = 3;
                this.radioProject.Enabled       = false;
                break;

            default:
                this.radioProject.SelectedIndex = 0;
                break;
            }
        }