/// <summary> /// Initializes a new instance of the <see cref="PackageService"/> class. /// </summary> /// <param name="packageRepository">The package repository.</param> /// <param name="connectionStringRepository">The connection string repository.</param> /// <param name="packageSettingRepository">The package setting repository.</param> public PackageService(IPackageRepository packageRepository, IConnectionStringRepository connectionStringRepository, IPackageSettingRepository packageSettingRepository, ServiceModel.IHoardeManager hoardeManager) { _packageRepository = packageRepository; _connectionStringRepository = connectionStringRepository; _packageSettingRepository = packageSettingRepository; _hoardManager = hoardeManager; }
public ActionResult Create() { ViewBag.AllLanguages = _languageService.GetAllLanguages(true); var model = new ServiceModel(); AddLocales(_languageService, model.Locales); return View(model); }
/// <summary> /// Configuration routine of the autofac container. /// </summary> /// <param name="eventBus">The event bus.</param> /// <param name="hoardeManager">The hoarde manager.</param> /// <param name="configurationManager">The host's configuration manager.</param> public static void Configure(IEventBus eventBus, ServiceModel.IHoardeManager hoardeManager, INutConfiguration configurationManager) { var builder = new ContainerBuilder(); builder.RegisterInstance(eventBus); builder.RegisterInstance(hoardeManager); builder.RegisterInstance(configurationManager); builder.RegisterType<ServiceModel.ServicesManager>().AsImplementedInterfaces().SingleInstance(); builder.RegisterType<ServiceModel.PollingClientCollection>().AsSelf().SingleInstance(); builder.RegisterType<ServiceModel.RegisteredPackagesPollingClient>().AsSelf().SingleInstance(); builder.RegisterType<ServiceModel.ReleasesPollingClient>(); builder.RegisterType<ConfigurationManagement.DbConfigurationSettings>(); // we will apply most of the configuration in one or more assembly modules. builder.RegisterAssemblyModules(typeof(AutofacConfig).Assembly); switch (configurationManager.Mode) { case ExecutionMode.Development: builder.RegisterType<Repositories.OnDisk.OnDiskPackageRepository>().AsImplementedInterfaces().InstancePerLifetimeScope(); break; case ExecutionMode.Production: builder.RegisterType<Repositories.SQLiteRepositories.PackageRepository>().AsImplementedInterfaces().InstancePerLifetimeScope(); break; default: builder.RegisterType<Repositories.SQLiteRepositories.PackageRepository>().AsImplementedInterfaces().InstancePerLifetimeScope(); _log.WarnFormat("Unknown execution mode '{mode}'. Registered Sqlite Repository.", configurationManager.Mode); break; } _container = builder.Build(); }
public object Any(ServiceModel.Wms.Confirm_Imgr1 request) { CommonResponse ecr = new CommonResponse(); ecr.initial(); try { ServiceInterface.Wms.ConfirmService cs = new ServiceInterface.Wms.ConfirmService(); cs.ConfirmImgr1(auth, request, confirm_Imgr1_Logic, ecr, this.Request.Headers.GetValues("Signature"), this.Request.RawUrl); } catch (Exception ex) { cr(ecr, ex); } return ecr; }
public object Any(ServiceModel.Wms.List_Imgr2 request) { CommonResponse ecr = new CommonResponse(); ecr.initial(); try { ServiceInterface.Wms.TableService ls = new ServiceInterface.Wms.TableService(); ls.List_Imgr2(auth, request, list_Imgr2_Logic, ecr, this.Request.Headers.GetValues("Signature"), this.Request.RawUrl); } catch (Exception ex) { cr(ecr, ex); } return ecr; }
protected Service(ServiceModel service) { Name = service.Name; ServiceModel = service; Logger = ServiceFactory.ServiceLogger; PathService = Path.Combine(ServiceConfig.ServicesResourceLibLocation, Name); Directory.CreateDirectory(PathService); _assemblyCatalog = new AssemblyCatalog(GetType().Assembly); _compositionContainer = new CompositionContainer(_assemblyCatalog); _isInstaled = false; }
public static void AddOrReplaceEarthObservation(ServiceModel.Ogc.Eop20.EarthObservationType eo, IOpenSearchResultItem item) { if (eo != null) { foreach (var ext in item.ElementExtensions.ToArray()) { if (ext.OuterName == "EarthObservation") { item.ElementExtensions.Remove(ext); } } item.ElementExtensions.Add(Terradue.ServiceModel.Ogc.OgcHelpers.CreaterReader(eo)); } }
internal static void LoadAndConfigureServices(ServiceModel.IServiceProvider container, ApplicationConfiguration config) { if (config == null) return; if (container == null) return; foreach (ServiceDefinition srvDef in config.ServicesConfiguration.ServiceDefinitions) { Type contractType = Type.GetType(srvDef.Contract, true, true); Type serviceType = Type.GetType(srvDef.Service, true, true); IService service = (IService)Activator.CreateInstance(serviceType); container.RegisterService(contractType, service); // configure any IConfigurable service. if (typeof(IConfigurable).IsAssignableFrom(serviceType) && srvDef.Config != null) ((IConfigurable)service).Configure(srvDef.Config); } }
public ActionResult Create(ServiceModel model, bool continueEditing) { if (ModelState.IsValid) { var Service = model.ToEntity(); Service.CreatedOnUtc = DateTime.UtcNow; _serviceService.InsertService(Service); //locales UpdateLocales(Service, model); _serviceService.UpdateService(Service); SuccessNotification(_localizationService.GetResource("Toi.Plugin.Misc.Services.Service.Added")); return continueEditing ? RedirectToAction("Edit", new { id = Service.Id }) : RedirectToAction("List"); } return View(model); }
public virtual string AfterCallToAppLayer(ServiceModel service, OperationModel operation) => string.Empty;
protected void UpdateLocales(Service Service, ServiceModel model) { foreach (var localized in model.Locales) { _localizedEntityService.SaveLocalizedValue(Service, x => x.Title, localized.Title, localized.LanguageId); _localizedEntityService.SaveLocalizedValue(Service, x => x.Full, localized.Full, localized.LanguageId); } }
public virtual string DeclarePrivateVariables(ServiceModel service) => string.Empty;
public virtual string ConstructorInit(ServiceModel service) => string.Empty;
public object Any(ServiceModel.Freight.Freight_Login request) { CommonResponse ecr = new CommonResponse(); ecr.initial(); try { ServiceInterface.Freight.LoginService ls = new ServiceInterface.Freight.LoginService(); ls.initial(auth, request, freight_Login_Logic, ecr, this.Request.Headers.GetValues("Signature"), this.Request.RawUrl); } catch (Exception ex) { cr(ecr, ex); } return ecr; }
public string ConstructorParams(ServiceModel service) => @"";
// GET: VehicleModel public ActionResult Index() { var vModel = ServiceModel.Instance().GetAllVModel(); return(View(vModel)); }
// GET: VehicleModel/Details/5 public ActionResult Details(int id) { return(View(ServiceModel.Instance().DetailsVModel(id))); }
public async Task <IActionResult> Add([FromBody] ServiceModel data) { var dataEntity = await _servicesService.Add(ServiceMapper.Map(data)); return(Ok(dataEntity)); }
public async Task <IActionResult> Update([FromBody] ServiceModel data) { var dataUpdate = await _servicesService.Update(ServiceMapper.Map(data)); return(Ok()); }
public string AfterCallToAppLayer(ServiceModel service, ServiceOperationModel operation) => @"";
public string BeforeTransaction(ServiceModel service, ServiceOperationModel operation) => @"";
public string ConstructorInit(ServiceModel service) => @"";
public object Any(ServiceModel.Freight.Jmjm request) { CommonResponse ecr = new CommonResponse(); ecr.initial(); try { ServiceInterface.Freight.TableService ts = new ServiceInterface.Freight.TableService(); ts.TS_Jmjm(auth, request, jmjm_Logic, ecr, this.Request.Headers.GetValues("Signature"), this.Request.RawUrl); } catch (Exception ex) { cr(ecr, ex); } return ecr; }
public static Task AddServerNode(ServiceModel model) => _repo.Create(model);
public object Get(ServiceModel.Freight.Tracking request) { CommonResponse ecr = new CommonResponse(); ecr.initial(); try { ServiceInterface.Freight.TableService ls = new ServiceInterface.Freight.TableService(); ls.TS_Tracking(auth, request, list_Tracking_Logic, ecr, this.Request.Headers.GetValues("Signature"), this.Request.RawUrl); } catch (Exception ex) { cr(ecr, ex); } return ecr; }
public static Task Update(ServiceModel model) => _repo.Update(model);
public ActionResult Create([Bind(Include = "Id,MakeId,Name")] VehicleModel vehicleModel) { ServiceModel.Instance().AddVehicleModel(vehicleModel); return(View()); }
public string DeclarePrivateVariables(ServiceModel service) => @" private static readonly Logger Logger = LogManager.GetCurrentClassLogger();";
public static Task DeleteServerNode(ServiceModel model) => _repo.Delete(model);
public ActionResult Delete(int id) { ServiceModel.Instance().DeleteVehicleModel(id); return(View()); }
private ServiceModel PopulateTestModel(int id) { ServiceModel model; switch (id) { case 1: model = new ServiceModel { ServiceId = 1, ServiceName = "Security Dog Handler", Heading = "Security Dog Handler" }; break; case 2: model = new ServiceModel { ServiceId = 1, ServiceName = "Search Dog", Heading = "Search Dog" }; break; case 3: model = new ServiceModel { ServiceId = 1, ServiceName = "Event Security", Heading = "Event Security" }; break; case 4: model = new ServiceModel { ServiceId = 1, ServiceName = "Surveillance", Heading = "Surveillance" }; break; case 5: model = new ServiceModel { ServiceId = 1, ServiceName = "Parks Security", Heading = "Parks Security" }; break; case 6: model = new ServiceModel { ServiceId = 1, ServiceName = "Close Protection", Heading = "Close Protection" }; break; case 7: model = new ServiceModel { ServiceId = 1, ServiceName = "Maritime Security", Heading = "Maritime Security" }; break; case 8: model = new ServiceModel { ServiceId = 1, ServiceName = "Training", Heading = "Training" }; break; default: model = new ServiceModel { ServiceId = 1, ServiceName = "Security Dog Handler", Heading = "Security Dog Handler" }; break; } return(model); }
public CodeGenerationContext(ServiceModel serviceModel, CodeGenerationOptions options) { this.Options = options; this.ServiceModel = serviceModel; }
public virtual string ConstructorParams(ServiceModel service) => string.Empty;
public override string DeclarePrivateVariables(ServiceModel service) => @" private readonly IUserContextProvider<IUserContextData> _userContextProvider;";
public virtual string BeginOperation(ServiceModel service, OperationModel operation) => string.Empty;
public override string ConstructorParams(ServiceModel service) => @" , IUserContextProvider<IUserContextData> userContextProvider";
public ActionResult Edit(ServiceModel model, bool continueEditing) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageNews)) return AccessDeniedView(); var Service = _serviceService.GetServiceById(model.Id); if (Service == null) //No news item found with the specified id return RedirectToAction("List"); if (ModelState.IsValid) { Service = model.ToEntity(Service); _serviceService.UpdateService(Service); //locales UpdateLocales(Service, model); _serviceService.UpdateService(Service); SuccessNotification(_localizationService.GetResource("Toi.Plugin.Misc.Services.Service.Updated")); return continueEditing ? RedirectToAction("Edit", new { id = Service.Id }) : RedirectToAction("List"); } return View(model); }
public override string ConstructorInit(ServiceModel service) => @" _userContextProvider = userContextProvider;";
public object Get(ServiceModel.Freight.ViewPDF request) { if (this.Request.RawUrl.IndexOf("/pdf/file") > 0) { byte[] heByte = viewPDF_Logic.Get_File(request); return new HttpResult(heByte, "application/pdf"); } else //this.Request.RawUrl.IndexOf("/pdf") > 0 { CommonResponse ecr = new CommonResponse(); ecr.initial(); try { ServiceInterface.Freight.PdfService ps = new ServiceInterface.Freight.PdfService(); ps.PS_View(auth, request, viewPDF_Logic, ecr, this.Request.Headers.GetValues("Signature"), this.Request.RawUrl); } catch (Exception ex) { cr(ecr, ex); } return ecr; } }
public override string BeginOperation(ServiceModel service, ServiceOperationModel operation) => @" var userContext = _userContextProvider.GetUserContext(); ServiceCallContext.Instance.Set<IUserContextData>(userContext);";
public object Any(ServiceModel.Freight.UploadFile request) { CommonResponse ecr = new CommonResponse(); ecr.initial(); try { ServiceInterface.Freight.FileService ps = new ServiceInterface.Freight.FileService(); if (this.Request.Files.Length > 0) { request.RequestStream = this.Request.Files[0].InputStream; request.FileName = this.Request.Files[0].FileName; } ps.FS_Upload(auth, request, uploadImg_Logic, ecr, this.Request.Headers.GetValues("Signature"), this.Request.RawUrl); } catch (Exception ex) { cr(ecr, ex); } return ecr; }
public object Post(ServiceModel.Event.Update_Done request) { CommonResponse ecr = new CommonResponse(); ecr.initial(); try { ServiceInterface.Event.DoneService ds = new ServiceInterface.Event.DoneService(); ds.initial(auth, request, update_Done_Logic, ecr, this.Request.Headers.GetValues("Signature"), this.Request.RawUrl); } catch (Exception ex) { cr(ecr, ex); } return ecr; }
public object Any(ServiceModel.Utils.QiniuToken request) { QiniuTokenResponse qtr = new QiniuTokenResponse(); try { ServiceInterface.Utils.Qiniu q = new ServiceInterface.Utils.Qiniu(); qtr.uptoken = q.Q_UpToken(request, qiniuToken_Logic); } catch (Exception ex) { qtr.uptoken = ex.Message; } return qtr; }
public RestXmlValidator(string operation, object request, IRequest marshalledRequest, ServiceModel serviceModel) : base(operation, request, marshalledRequest, serviceModel) { }
public object Get(ServiceModel.Freight.ViewFile request) { if (this.Request.RawUrl.IndexOf("/file/list") < 0 && !string.IsNullOrEmpty(request.eDoc) && !string.IsNullOrEmpty(request.Type)) { bool blnEDoc = false; if (request.eDoc.Equals("1")) { blnEDoc = true; } byte[] heByte = viewFile_Logic.Get_File(request, blnEDoc); string type = "application/octet-stream"; if (request.Type.ToLower().Equals("img")) { type = "image/jpeg"; } else if (request.Type.ToLower().Equals("txt")) { type = "text/plain"; } else if (request.Type.ToLower().Equals("pdf")) { type = "application/pdf"; } return new HttpResult(heByte, type); } else { CommonResponse ecr = new CommonResponse(); ecr.initial(); try { ServiceInterface.Freight.FileService fs = new ServiceInterface.Freight.FileService(); fs.FS_View(auth, request, viewFile_Logic, ecr, this.Request.Headers.GetValues("Signature"), this.Request.RawUrl); } catch (Exception ex) { cr(ecr, ex); } return ecr; } }
public XmlSampleGenerator(ServiceModel model, Operation operation) { this._model = model; this._operation = operation; }
public IHttpActionResult CreateService([FromBody] ServiceModel model) { var op = _servicemanager.CreateService(model); return(this.OperationResult(op)); }
//[DebuggerStepThrough] ////[DebuggerHidden] public ServiceInstance(ServiceModel compositeModel, ModuleInstance moduleInstance, object[] mixins) : base(compositeModel, moduleInstance, mixins, null) { }
public bool Add(ServiceModel service) { return(storage.TryAdd(new Guid(), service)); }
public object Get(ServiceModel.Event.List_Jmjm6 request) { CommonResponse ecr = new CommonResponse(); ecr.initial(); try { ServiceInterface.Event.ListService ls = new ServiceInterface.Event.ListService(); ls.ListJmjm6(auth, request, list_Jmjm6_Logic, ecr, this.Request.Headers.GetValues("Signature"), this.Request.RawUrl); } catch (Exception ex) { cr(ecr, ex); } return ecr; }