Esempio n. 1
0
 public override string ToString()
 {
     return(string.Format("Key:{0} - Services:{1} - Class:{2}",
                          Key,
                          ServiceTypes.Select(t => t.Name).ToCommaSeparatedString(),
                          Classtype.Name));
 }
Esempio n. 2
0
 /// <summary>
 /// Обработчик события нажатия клавиши мыши на кнопку,
 /// который производит отмену последнего добавления/редактирования
 /// </summary>
 private void btn_Cancel_Click(object sender, EventArgs e)
 {
     if (_formMode != FormMode.None)
     {
         var result = MessageBox.Show("Изменения не будут сохранены! Продолжить?", "Отмена изменений",
                                      MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk);
         if (result == DialogResult.Yes)
         {
             try
             {
                 if (_formMode == FormMode.Edit)
                 {
                     int indexOfElement = ServiceTypes.IndexOf(CurrentServiceType);
                     CurrentServiceType           = _ctx.CancelChanges(CurrentServiceType);
                     ServiceTypes[indexOfElement] = CurrentServiceType;
                 }
                 else
                 {
                     ServiceTypes.CancelNew(ServiceTypes.IndexOf(CurrentServiceType));
                 }
                 EnDisFields(false);
                 _formMode = FormMode.None;
             }
             catch
             {
                 MessageBox.Show("Произошла ошибка при отмене изменений!", "Ошибка", MessageBoxButtons.OK,
                                 MessageBoxIcon.Error);
             }
         }
     }
 }
Esempio n. 3
0
        public NodeService(string name, Uri endPoint, ApiTypes api, ServiceTypes serviceType) : base(name)
        {
            // Default account icon
            PathIcon = "M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z";

            EndPoint = endPoint;

            Api = api;

            ServiceType = serviceType;

            //Id = Guid.NewGuid().ToString();
            Id = endPoint.AbsoluteUri;

            switch (api)
            {
            case ApiTypes.atAtomPub:
                Client = new AtomPubClient(UserName, UserPassword, EndPoint);
                break;

            case ApiTypes.atXMLRPC_MovableType:
                Client = new XmlRpcClient(UserName, UserPassword, EndPoint);
                break;

            case ApiTypes.atXMLRPC_WordPress:
                Client = new XmlRpcClient(UserName, UserPassword, EndPoint);
                break;

            case ApiTypes.atFeed:
                Client = new FeedClient();
                break;

                //TODO: WP, AtomAPI
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Обработчик события нажатия клавиши мыши на кнопку,
 /// который совершает добавление нового типа сервиса
 /// </summary>
 private void button2_Click(object sender, EventArgs e)
 {
     ServiceTypes.AddNew();
     serviceTypeBindingSource.MoveLast();
     EnDisFields(true);
     _formMode = FormMode.Add;
 }
Esempio n. 5
0
        public ServiceTypes PostServiceTypes(object obj)
        {
            ServiceTypes SR = new ServiceTypes();

            WSP_Mst_ServiceTypes_GetList_Result data = obj.GetData <WSP_Mst_ServiceTypes_GetList_Result>();
            string oper = obj.GetOperation();

            List <WSP_Mst_ServiceTypes_GetList_Result> serviceTypes = new List <WSP_Mst_ServiceTypes_GetList_Result>();

            try
            {
                db.WSP_Mst_ServiceTypes_DML_Oper(data.id, data.text, data.serviceTypeNameAr, data.kilometre, data.active, oper);

                serviceTypes = db.WSP_Mst_ServiceTypes_GetList().ToList();
                if (serviceTypes.Count() > 0)
                {
                    SR.status = 1; SR.serviceTypes = serviceTypes; SR.message = "Success.!!";
                }
                return(SR);
            }
            catch
            {
                SR.message = "Error Occured "; SR.serviceTypes = serviceTypes; SR.status = 0;
                return(SR);
            }
        }
Esempio n. 6
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            isReset = true;
            try
            {
                if (string.IsNullOrEmpty(this.txtServiceType.Text.Trim()))
                {
                    PageCommon.AlertMsg(this, "Service Type cannot be blank.");
                    return;
                }
                if (!serviceTypeMgr.IsSerivceTypeExsits(this.txtServiceType.Text.Trim()))
                {
                    ServiceTypes serviceType = new ServiceTypes();
                    serviceType.Name    = this.txtServiceType.Text.Trim();
                    serviceType.Enabled = true;
                    serviceTypeMgr.Add(serviceType);
                    this.txtServiceType.Text = "";

                    BindGrid();
                    PageCommon.AlertMsg(this, "Added service type successfully!");
                }
                else
                {
                    PageCommon.AlertMsg(this, "Failed to add service type, the Service Type already exsits.");
                }
            }
            catch (Exception ex)
            {
                PageCommon.AlertMsg(this, "Failed to add the Service Type.");
                LPLog.LogMessage(LogType.Logerror, "Failed to add the Service Type, exception: " + ex.Message);
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Authors: Ameet Toor, Karanbir Toor
        /// Sets the service type for the service being added and changes the current page to the page that should be displayed after the button is clicked.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void nextPage_Click(object sender, RoutedEventArgs e)
        {
            MainWindow mainWindow = Application.Current.MainWindow as MainWindow;

            if ((bool)DriverRadioButton.IsChecked)
            {
                myServiceTypes = ServiceTypes.Drive;
                mainWindow.setServiceType(myServiceTypes);
                IInputElement target = NavigationHelper.FindFrame("ListPage1", this);
                NavigationCommands.GoToPage.Execute("/Informationpage.xaml", target);
            }
            else if ((bool)DonateRadioButton.IsChecked)
            {
                myServiceTypes = ServiceTypes.Donate;
                mainWindow.setServiceType(myServiceTypes);
                IInputElement target = NavigationHelper.FindFrame("ListPage1", this);
                NavigationCommands.GoToPage.Execute("/RequestGoodsPage.xaml", target);
            }
            else if ((bool)EducateRadioButton.IsChecked)
            {
                myServiceTypes = ServiceTypes.Educate;
                mainWindow.setServiceType(myServiceTypes);
                IInputElement target = NavigationHelper.FindFrame("ListPage1", this);
                NavigationCommands.GoToPage.Execute("/EducatePage.xaml", target);
            }
            else if ((bool)RequestGoodsButton.IsChecked)
            {
                myServiceTypes = ServiceTypes.Request;
                mainWindow.setServiceType(myServiceTypes);
                IInputElement target = NavigationHelper.FindFrame("ListPage1", this);
                NavigationCommands.GoToPage.Execute("/RequestGoodsPage.xaml", target);
            }
        }
Esempio n. 8
0
 public static IApplicationBuilder RegisterAsService(this IApplicationBuilder app,
                                                     ServiceTypes serviceType,
                                                     string IPResolverHost,
                                                     ILogger logger)
 {
     try
     {
         using (var client = new HttpClient())
         {
             var jsonString = JsonConvert.SerializeObject(new
             {
                 token       = GlobalTokens.RegisterServiseToken,
                 serviceType = serviceType.ToString()
             });
             logger.LogDebug($"Registration string is {jsonString}");
             StringContent content = new StringContent(jsonString, Encoding.UTF8, "application/json");
             var           result  = client.PostAsync($"http://{IPResolverHost}/ip/register", content).Result;
             logger.LogInformation($"result from registration {(int)result.StatusCode} {result.StatusCode}");
             if (result.StatusCode != System.Net.HttpStatusCode.OK)
             {
                 throw new Exception("Can't register service!!!");
             }
         }
     }
     catch
     {
         Console.WriteLine("ERROR BLYAT");
     }
     return(app);
 }
 public override ICommandLineParserResult ParseArgs(string[] args)
 {
     SetFlag <string>("name", "The name used for the deployment and other artifacts in kubernetes", n =>
     {
         KubernetesHelper.ValidateKubernetesName(n);
         Name = n;
     }, isRequired: true);
     SetFlag <string>("image-name", "Image to use for the pod deployment and to read functions from", n => ImageName = n);
     SetFlag <string>("registry", "When set, a docker build is run and the image is pushed to that registry/name. This is mutually exclusive with --image-name. For docker hub, use username.", r => Registry = r);
     SetFlag <string>("namespace", "Kubernetes namespace to deploy to. Default: default", ns => Namespace = ns);
     SetFlag <string>("pull-secret", "The secret holding a private registry credentials", s => PullSecret = s);
     SetFlag <int>("polling-interval", "The polling interval for checking non-http triggers. Default: 30 (seconds)", p => PollingInterval = p);
     SetFlag <int>("cooldown-period", "The cooldown period for the deployment before scaling back to 0 after all triggers are no longer active. Default: 300 (seconds)", p => CooldownPeriod = p);
     SetFlag <int>("min-replicas", "Minimum replica count", m => MinReplicaCount = m);
     SetFlag <int>("max-replicas", "Maximum replica count to scale to by HPA", m => MaxReplicaCount = m);
     SetFlag <string>("keys-secret-name", "The name of a kubernetes secret collection to use for the function app keys (host keys, function keys etc.)", ksn => KeysSecretCollectionName = ksn);
     SetFlag <bool>("mount-funckeys-as-containervolume", "The flag indicating to mount the func app keys as container volume", kmv => MountFuncKeysAsContainerVolume = kmv);
     SetFlag <string>("secret-name", "The name of an existing kubernetes secret collection, containing func app settings, to use in the deployment instead of creating new a new one based upon local.settings.json", sn => SecretsCollectionName = sn);
     SetFlag <string>("config-map-name", "The name of an existing config map with func app settings to use in the deployment", cm => ConfigMapName = cm);
     SetFlag <string>("service-type", "Kubernetes Service Type. Default LoadBalancer  Valid options: " + string.Join(",", ServiceTypes), s =>
     {
         if (!string.IsNullOrEmpty(s) && !ServiceTypes.Contains(s))
         {
             throw new CliArgumentsException($"serviceType {ServiceType} is not supported. Valid options are: {string.Join(",", ServiceTypes)}");
         }
         ServiceType = s;
     });
     SetFlag <bool>("no-docker", "With --image-name, the core-tools will inspect the functions inside the image. This will require mounting the image filesystem. Passing --no-docker uses current directory for functions.", nd => NoDocker = nd);
     SetFlag <bool>("use-config-map", "Use a ConfigMap/V1 instead of a Secret/V1 object for function app settings configurations", c => UseConfigMap = c);
     SetFlag <bool>("dry-run", "Show the deployment template", f => DryRun = f);
     SetFlag <bool>("ignore-errors", "Proceed with the deployment if a resource returns an error. Default: false", f => IgnoreErrors = f);
     return(base.ParseArgs(args));
 }
Esempio n. 10
0
        private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
        {
            Assembly assembly = null;

            if (args.Name.StartsWith("@#"))
            {
                var fileDll = args.Name.Substring(2);

                assembly = Assembly.LoadFrom(Path.GetFullPath(fileDll));
            }
            else
            {
                if (ServiceTypesCrossDomain != null)
                {
                    if (ServiceTypesCrossDomain.ContainsKey(args.Name))
                    {
                        assembly = ServiceTypesCrossDomain[args.Name];
                    }
                    else
                    {
                        assembly = ServiceTypesCrossDomain
                                   .Where(asm => asm.Key.Split(',')[0].Equals(args.Name))
                                   .Select(asm => asm.Value).FirstOrDefault();
                    }

                    if (assembly == null && ServiceTypes != null && ServiceTypes.ContainsKey(args.Name))
                    {
                        assembly = ServiceTypes[args.Name];
                    }
                }
            }

            return(assembly);
        }
Esempio n. 11
0
        public Type[] GetExposedServiceTypes(Type targetType)
        {
            var serviceList = ServiceTypes.ToList();

            if (IncludeSelf)
            {
                if (!serviceList.Contains(targetType))
                {
                    serviceList.Add(targetType);
                }
            }

            if (IncludeDefaults)
            {
                foreach (var type in GetDefaultServices(targetType))
                {
                    if (!serviceList.Contains(type))
                    {
                        serviceList.Add(type);
                    }
                }
            }

            return(serviceList.ToArray());
        }
Esempio n. 12
0
        public static bool CreateService(string serviceName, string displayName, ServiceAccess access,
            ServiceTypes type, ServiceStart start, ServiceError error, string path,
            string orderGroup, string tagId, string dep, string username, string password, string server = null)
        {
            IntPtr manager = IntPtr.Zero;
            IntPtr service = IntPtr.Zero;

            try
            {
                manager = OpenSCManager(server, null, ScmAccess.ScManagerAllAccess);

                if (manager != IntPtr.Zero)
                {
                    service = CreateService(manager, serviceName, displayName, (uint) access, (uint) type, (uint) start,
                        (uint) error, path, orderGroup, tagId, dep, username, password);

                    if (service != IntPtr.Zero)
                    {
                        return true;
                    }
                }
            }
            finally
            {
                if (service != IntPtr.Zero) CloseServiceHandle(service);
                if (manager != IntPtr.Zero) CloseServiceHandle(manager);
            }

            return false;
        }
Esempio n. 13
0
        /// <summary>
        /// Returns a string representing the service type
        /// </summary>
        /// <param name="service"></param>
        /// <returns>Service Type</returns>
        // Revision History
        // MM/DD/YY who Version Issue# Description
        // -------- --- ------- ------ ---------------------------------------
        // 05/01/09 RCG 2.20.03 N/A    Created

        private string GetServiceTypeDescription(ServiceTypes service)
        {
            string strServiceType;

            //Create the service type string
            switch (service)
            {
            case ServiceTypes.ThreeElem3Phase4WireWYE:
            case ServiceTypes.TwoAndHalfElem3Phase4WireWYE6S46S:
            case ServiceTypes.TwoElemNetwork:
            case ServiceTypes.ThreeElem3Phase4WireDelta:
            case ServiceTypes.TwoElem3Phase4WireWYE:
            case ServiceTypes.TwoElem3Phase3WireDelta:
            case ServiceTypes.TwoElem3Phase4WireDelta:
            case ServiceTypes.TwoElemSinglePhase:
            case ServiceTypes.OneElemSinglePhase3Wire:
            case ServiceTypes.OneElemSinglePhase2Wire:
            case ServiceTypes.TwoAndHalfElem3Phase4WireWYE9S:
            {
                strServiceType = EnumDescriptionRetriever.RetrieveDescription(service);
                break;
            }

            case ServiceTypes.AutoServiceSense:
            default:
            {
                // Since this is the value in use we want to show unknown if 255
                strServiceType = m_rmStrings.GetString("UNKNOWN");
                break;
            }
            }

            return(strServiceType);
        }
Esempio n. 14
0
        public async Task Add(string referenceCode, ServiceTypes serviceType, MoneyAmount convertedSupplierPrice, MoneyAmount originalSupplierPrice,
                              Deadline deadline, int supplier, SupplierPaymentType paymentType, DateTime paymentDate)
        {
            var now           = _dateTimeProvider.UtcNow();
            var supplierOrder = new SupplierOrder
            {
                Created           = now,
                Modified          = now,
                ConvertedPrice    = convertedSupplierPrice.Amount,
                ConvertedCurrency = convertedSupplierPrice.Currency,
                Price             = originalSupplierPrice.Amount,
                Currency          = originalSupplierPrice.Currency,
                RefundableAmount  = 0,
                State             = SupplierOrderState.Created,
                Supplier          = supplier,
                Type          = serviceType,
                ReferenceCode = referenceCode,
                Deadline      = deadline,
                PaymentDate   = paymentDate,
                PaymentType   = paymentType
            };

            _context.SupplierOrders.Add(supplierOrder);

            await _context.SaveChangesAsync();

            _context.Detach(supplierOrder);
        }
Esempio n. 15
0
        protected override void Seed(AksonApp.Models.ApplicationDbContext context)
        {
            using (Models.ApplicationDbContext db = new Models.ApplicationDbContext())
            {
                string[] service = { "Brake fluid flush overdue",
                                     "Front brake pads due",
                                     "Rear brake pads due",
                                     "Micro filter due",
                                     "Statutory emmissions due",
                                     "Vehicle check service due",
                                     "Service overdue" };

                bool checkIfExits = db.ServiceTypes.Any();
                if (!checkIfExits)
                {
                    for (int i = 0; i <= service.Length - 1; i++)
                    {
                        ServiceTypes serviceTypes = new ServiceTypes()
                        {
                            Name = service[i]
                        };
                        db.ServiceTypes.Add(serviceTypes);
                        db.SaveChanges();
                    }
                }
            }
        }
        public override void Run(ContainerBuilder builder, ServiceTypes serviceTypes)
        {
            base.Run(builder, serviceTypes);

            //tasks
            Tasks.DR.Bootstrapping.BootstrapHandler.Run(builder, serviceTypes);
        }
        public virtual void Run(ContainerBuilder builder, ServiceTypes serviceTypes)
        {
            //calls into base components that are apart of every feature

            //framework
            Framework.Infrastructure.Bootstrapping.BootstrapHandler.Run(builder, serviceTypes);

            //user defined fields
            UserDefinedFields.DR.Bootstrapping.BootstrapHandler.Run(builder, serviceTypes);

            //clients
            Clients.DR.Bootstrapping.BootstrapHandler.Run(builder, serviceTypes);

            //multilingual
            ML.DR.Bootstrapping.BootstrapHandler.Run(builder, serviceTypes);

            //user management
            UserManagement.DR.Bootstrapping.BootstrapHandler.Run(builder, serviceTypes);

            //security groups
            SecurityGroups.DR.Bootstrapping.BootstrapHandler.Run(builder, serviceTypes);

            //tasks
            Tasks.DR.Bootstrapping.BootstrapHandler.Run(builder, serviceTypes);
        }
Esempio n. 18
0
        static void FindCosmeticByServiceType(List <Cosmetic> cosmetics)
        {
            string       selector;
            int          i         = 0;
            ServiceTypes st        = ServiceTypes.SKINCARE;
            bool         isCorrect = true;

            do
            {
                Console.WriteLine("\tChoose cosmetic type");
                foreach (var item in Enum.GetValues(typeof(ServiceTypes)))
                {
                    Console.WriteLine($"{++i}. {item}");
                }
                Console.Write("Enter your choise: ");
                selector  = Console.ReadLine();
                isCorrect = true;
                switch (selector)
                {
                case "1":
                    st = ServiceTypes.SKINCARE;
                    break;

                case "2":
                    st = ServiceTypes.HAIRCARE;
                    break;

                case "3":
                    st = ServiceTypes.FACECARE;
                    break;

                case "4":
                    st = ServiceTypes.TREATMENT;
                    break;

                case "5":
                    st = ServiceTypes.PERSONALCARE;
                    break;

                default:
                    Console.WriteLine("Wrong type number!");
                    isCorrect = false;
                    break;
                }
            } while (!isCorrect);
            bool wasFound = false;

            foreach (var item in cosmetics)
            {
                if (item.ServiceType == st)
                {
                    Console.WriteLine(item);
                    wasFound = true;
                }
            }
            if (!wasFound)
            {
                Console.WriteLine($"There is no cosmetics having {st} type");
            }
        }
        public async Task <IActionResult> Edit(int id, [Bind("TypeId,Title,DateCreated")] ServiceTypes serviceTypes)
        {
            if (id != serviceTypes.TypeId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(serviceTypes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ServiceTypesExists(serviceTypes.TypeId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(serviceTypes));
        }
Esempio n. 20
0
        private void InitServicesInformation(CloudFoundryClient client)
        {
            this.RefreshingServiceInformations = true;
            Task.Run(async() =>
            {
                this.EnterInit();

                var services = await client.Services.ListAllServices();
                foreach (var service in services)
                {
                    if (service.Active == true)
                    {
                        OnUIThread(() => { ServiceTypes.Add(service); });
                    }
                }

                var plans = await client.ServicePlans.ListAllServicePlans();
                foreach (var plan in plans)
                {
                    OnUIThread(() => { servicePlans.Add(plan); });
                }
            }).ContinueWith((antecedent) =>
            {
                if (antecedent.Exception != null)
                {
                    this.ExitInit(antecedent.Exception);
                }
                else
                {
                    this.ExitInit();
                }
            }).Forget();
        }
Esempio n. 21
0
        /// <summary>
        /// Create a new descriptor instance.
        /// </summary>
        /// <remarks>
        /// <see cref="Descriptor.IsValid"/> will only be set if the payload is
        /// consistent.
        /// </remarks>
        /// <param name="container">The related container instance.</param>
        /// <param name="offset">First byte of the descriptor data - the first byte after the tag.</param>
        /// <param name="length">Number of payload bytes for this descriptor.</param>
        public Service(IDescriptorContainer container, int offset, int length)
            : base(container, offset, length)
        {
            // Validate size
            if (length < 1)
            {
                return;
            }

            // Attach to data
            Section section = container.Section;

            // Load static
            ServiceType = (ServiceTypes)section[offset++];

            // Adjust
            length -= 1;

            // Validate size
            if (length < 1)
            {
                return;
            }

            // Load length
            int providerLen = section[offset++];

            // Adjust
            length -= 1 + providerLen;

            // Validate
            if (length < 1)
            {
                return;
            }

            // Read
            ProviderName = Section.ReadEncodedString(offset, providerLen, true);

            // Adjust
            offset += providerLen;

            // Load length
            int serviceLen = section[offset++];

            // Adjust
            length -= 1 + serviceLen;

            // Validate
            if (0 != length)
            {
                return;
            }

            // Read
            ServiceName = Section.ReadEncodedString(offset, serviceLen, true);

            // We are valid
            m_Valid = true;
        }
Esempio n. 22
0
        /// <summary>
        ///     Gets USPS's special services for domestic insurance
        /// </summary>
        private SpecialServices GetSpecialServicesForInsurance(ServiceTypes baseService)
        {
            if (!_uspsSettings.InsuranceEnabled)
            {
                return(null);
            }

            var expressServices = new[] {
                ServiceTypes.Express, ServiceTypes.ExpressCommercial, ServiceTypes.ExpressHfp, ServiceTypes.ExpressHfpCommercial,
                ServiceTypes.ExpressSh, ServiceTypes.ExpressShCommercial
            };

            if (expressServices.Any(e => e == baseService))
            {
                // 11 = Express Mail Insurance
                return(new SpecialServices {
                    SpecialService = new[] { "11" }
                });
            }

            var priorityServices = new[] { ServiceTypes.Priority, ServiceTypes.PriorityCommercial, ServiceTypes.PriorityHfpCommercial };

            return(priorityServices.Any(p => p == baseService) ? new SpecialServices {
                SpecialService = new[] { "1" }
            } : null);
        }
 public Cosmetic(string name, decimal price, int count, TimeSpan receiveTime, ServiceTypes serviceType)
 {
     Name        = name;
     Price       = price;
     Count       = count;
     ReceiveTime = receiveTime;
     ServiceType = serviceType;
 }
Esempio n. 24
0
        ///-------------------------------------------------------------------------------------------------
        /// <summary>   Registers this object. </summary>
        ///
        /// <param name="auditDetailManagement">    The audit detail management. </param>
        /// <param name="web">                      The web. </param>
        ///-------------------------------------------------------------------------------------------------
        public OrionDependencyResolver Register(FeatureType auditDetailManagement, ServiceTypes web)
        {
            BoostrapHandler.RegisterDependencies(this, FeatureType.DocumentPolicyManagement, ServiceTypes.Windows);

            RegisterFilters();

            return(SetDependencyResolver());
        }
Esempio n. 25
0
        public async Task <string> GenerateNonSequentialReferenceCode(ServiceTypes serviceType, string destinationCode)
        {
            var itineraryNumber = await GenerateItn();

            return(string.Join(ReferenceCodeItemsSeparator, serviceType,
                               destinationCode,
                               itineraryNumber));
        }
 public PaymentLinkCreationRequest(decimal amount, string email, ServiceTypes serviceType, Currencies currency, string comment)
 {
     Amount      = amount;
     Email       = email;
     ServiceType = serviceType;
     Currency    = currency;
     Comment     = comment;
 }
Esempio n. 27
0
        /*
         * private enum _atomType
         * {
         *  atomFeed,
         *  atomPub,
         *  atomAPI,
         *  atomGData
         * }
         */

        public ServiceDiscovery()
        {
            _httpClient = new HttpClient();

            _serviceDocKind = _serviceDocumentKind.Unknown;

            _serviceTypes = ServiceTypes.Unknown;
        }
Esempio n. 28
0
        public async Task <string> GenerateReferenceCode(ServiceTypes serviceType, string destinationCode, string itineraryNumber)
        {
            var currentNumber = await _context.GenerateNextItnMember(itineraryNumber);

            return(string.Join(ReferenceCodeItemsSeparator, serviceType,
                               destinationCode,
                               itineraryNumber,
                               currentNumber.ToString("D2")));
        }
Esempio n. 29
0
 public static void InvokeServiceMethod(ServiceTypes type, string method, CallbackMethod callback, params string[] args)
 {
     if (callback != null)
     {
         string url = string.Format("{0}{1}/{2}.cshtml", Singleton.ServicesURL, convertType(type), method);
         Debug.Log("Invoking URL: " + url);
         Singleton.StartCoroutine(Singleton.invokeWebMethod(convertAPI_Key(type), url, callback, args));
     }
 }
Esempio n. 30
0
 private void XFSDevice_RegisterComplete(ServiceTypes serviceType)
 {
     lock (syncObject)
     {
         XFS_DevicesCollection.Instance.GetValue(serviceType).CurrentCommand.IsExecuteSuccessfully = true;
         XFS_DevicesCollection.Instance.GetValue(serviceType).CurrentCommand.Detail = "XFSDevice_RegisterComplete";
         SendResponse(XFS_DevicesCollection.Instance.GetValue(serviceType).CurrentCommand);
     }
 }
Esempio n. 31
0
 public T SetupService <T>(Type target) where T : class, IAgentService
 {
     if (!typeof(T).IsAssignableFrom(target))
     {
         throw new ArgumentException("The target type must implement the specified interface");
     }
     ServiceTypes.TryAdd(typeof(T), target);
     return(GetService <T>());
 }
	private static string convertType(ServiceTypes type)
	{
		switch (type)
		{
			case ServiceTypes.Managers: return "Managers";
			case ServiceTypes.Clients: return "Clients";
			case ServiceTypes.Games: return "Games";
			case ServiceTypes.Users: return "Users";
			default: throw new Exception("Invalid type: " + type);
		}
	}
Esempio n. 33
0
        /// <summary>
        /// Create a new descriptor instance.
        /// </summary>
        /// <remarks>
        /// <see cref="Descriptor.IsValid"/> will only be set if the payload is 
        /// consistent.
        /// </remarks>
        /// <param name="container">The related container instance.</param>
        /// <param name="offset">First byte of the descriptor data - the first byte after the tag.</param>
        /// <param name="length">Number of payload bytes for this descriptor.</param>
        public Service(IDescriptorContainer container, int offset, int length)
            : base(container, offset, length)
		{
			// Validate size
			if ( length < 1 ) return;

            // Attach to data
            Section section = container.Section;

            // Load static
            ServiceType = (ServiceTypes)section[offset++];

            // Adjust
            length -= 1;

            // Validate size
            if (length < 1) return;

            // Load length
            int providerLen = section[offset++];

            // Adjust
            length -= 1 + providerLen;

            // Validate
            if (length < 1) return;

            // Read
            ProviderName = Section.ReadEncodedString(offset, providerLen, true);

            // Adjust
            offset += providerLen;

            // Load length
            int serviceLen = section[offset++];

            // Adjust
            length -= 1 + serviceLen;

            // Validate
            if (0 != length) return;

            // Read
            ServiceName = Section.ReadEncodedString(offset, serviceLen, true);

            // We are valid
			m_Valid = true;
		}
 public ServiceWrapper(ServiceTypes serviceType, object service) {
     ServiceType = serviceType;
     Service = service;
 }
 public string GetServiceStatus(string strServiceNames, ServiceTypes serviceStatus)
 {
     object[] results = this.Invoke("GetServiceStatus", new object[] {
             strServiceNames,
             serviceStatus});
     return ((string)(results[0]));
 }
 /// <remarks/>
 public System.IAsyncResult BeginGetServiceStatus(string strServiceNames, ServiceTypes serviceStatus, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("GetServiceStatus", new object[] {
             strServiceNames,
             serviceStatus}, callback, asyncState);
 }
 /// <remarks/>
 public void GetServiceStatusAsync(string strServiceNames, ServiceTypes serviceStatus)
 {
     this.GetServiceStatusAsync(strServiceNames, serviceStatus, null);
 }
	private static string convertAPI_Key(ServiceTypes type)
	{
		switch (type)
		{
			case ServiceTypes.Managers: return Singleton.Manager_API_Key;
			case ServiceTypes.Clients: return Singleton.Client_API_Key;
			case ServiceTypes.Games: return Singleton.Game_API_Key;
			case ServiceTypes.Users: return Singleton.User_API_Key;
			default: throw new Exception("Invalid type: " + type);
		}
	}
	public static void InvokeServiceMethod(ServiceTypes type, string method, CallbackMethod callback, params string[] args)
	{
		if (callback != null)
		{
			string url = string.Format("{0}{1}/{2}.cshtml", Singleton.ServicesURL, convertType(type), method);
			Debug.Log("Invoking URL: " + url);
			Singleton.StartCoroutine(Singleton.invokeWebMethod(convertAPI_Key(type), url, callback, args));
		}
	}
 /// <remarks/>
 public void GetServiceStatusAsync(string strServiceNames, ServiceTypes serviceStatus, object userState)
 {
     if ((this.GetServiceStatusOperationCompleted == null))
     {
         this.GetServiceStatusOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetServiceStatusOperationCompleted);
     }
     this.InvokeAsync("GetServiceStatus", new object[] {
             strServiceNames,
             serviceStatus}, this.GetServiceStatusOperationCompleted, userState);
 }
Esempio n. 41
0
 protected AState GetNextState(ServiceTypes type)
 {
     Type nextType = _transitionsTable[type];
     AState state = (AState)nextType.Assembly.CreateInstance(nextType.FullName);
     state.MainView = this._mainView;
     state.ConversationControllers = this._conversationControllers;
     return state;
 }
        public DataTable GetServiceStatus(string allServiceNames, ServiceTypes status)
        {
            try
            {
                lock (obj_lock)
                {
                DataTable dataTableServices = new DataTable("Services");
                dataTableServices.Columns.Add("ServiceName");
                dataTableServices.Columns.Add("Status");
                string[] serviceNames = allServiceNames.Split(',');

                foreach (string serviceName in serviceNames)
                {
                    if (!string.IsNullOrEmpty(serviceName))
                    {
                        using (ServiceController serviceController = new ServiceController())
                        {
                            serviceController.ServiceName = serviceName.Trim();

                            switch (status)
                            {
                                case ServiceTypes.All:
                                    PopulateServiceData(dataTableServices, serviceName, serviceController);
                                    break;
                                case ServiceTypes.Running:
                                    try
                                    {
                                        if (serviceController.Status == ServiceControllerStatus.Running)
                                            PopulateServiceData(dataTableServices, serviceName, serviceController);
                                    }
                                    catch (InvalidOperationException)
                                    { }
                                    break;
                                case ServiceTypes.NotRunning:
                                    try
                                    {
                                        if (serviceController.Status != ServiceControllerStatus.Running)
                                            PopulateServiceData(dataTableServices, serviceName, serviceController);
                                    }
                                    catch (InvalidOperationException)
                                    {
                                        PopulateServiceData(dataTableServices, serviceName, serviceController);
                                    }
                                    break;
                            }
                        }
                    }
                }
                return dataTableServices;
            }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                return new DataTable("Error");
            }
        }
Esempio n. 43
0
        public static bool SetServiceConfig(
            string serviceName,
            ServiceTypes? type = null,
            ServiceStart? startMode = null,
            ServiceError? error = null,
            string binaryPathName = null,
            string loadOrderGroup = null,
            IntPtr tagId = default(IntPtr),
            string dependencies = null,
            string startName = null,
            string password = null,
            string displayName = null,
            string server = null)
        {
            IntPtr manager = IntPtr.Zero;
            IntPtr service = IntPtr.Zero;

            try
            {
                manager = OpenSCManager(server, null, ScmAccess.ScManagerAllAccess);

                if (manager != IntPtr.Zero)
                {
                    service = OpenService(manager, serviceName, ServiceAccess.ServiceChangeConfig);

                    if (service != IntPtr.Zero)
                    {
                        return ChangeServiceConfig(
                            service,
                            type.HasValue ? (uint) type.Value : ServiceNoChange,
                            startMode.HasValue ? (uint) startMode.Value : ServiceNoChange,
                            error.HasValue ? (uint) error.Value : ServiceNoChange,
                            binaryPathName,
                            loadOrderGroup,
                            tagId,
                            dependencies,
                            startName,
                            password,
                            displayName);
                    }
                }
            }
            finally
            {
                if (service != IntPtr.Zero) CloseServiceHandle(service);
                if (manager != IntPtr.Zero) CloseServiceHandle(manager);
            }

            return false;
        }
Esempio n. 44
0
 public MessageHeader(ServiceTypes service)
 {
     _serviceType = service;
 }