public ActionResult Delete(int productId, string type, string name)
        {
            IComponents deletedProduct = null;

            switch (type)
            {
            case "Products":
                deletedProduct = productRepository.DeleteProduct(productId);
                break;

            case "Categories":
                deletedProduct = productRepository.DeleteCategory(name);
                break;

            case "Characteristics":
                deletedProduct = productRepository.DeleteCharacteristic(productId);
                break;

            case "CharValues":
                productRepository.DeleteCharValue(productId);
                break;

            case "Cities":
                productRepository.DelteCity(productId);
                break;
            }
            if (deletedProduct != null)
            {
                TempData["message"] = $"\"{deletedProduct.Name}\" был удален";
            }

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        //
        // GET: /Account/Login
        public AccountController(IServices services, ISettings settings, IComponents components, IUserStore<ApplicationUser, Guid> userStore)
            : base(services, settings)
        {
            _userManager = new ApplicationUserManager(userStore, services, components);

            Mapper.CreateMap<ApplicationUser, UserDto>();
        }
Ejemplo n.º 3
0
 public GameObject(int id, string name, IComponent[] components = null)
 {
     Id         = id;
     Name       = name;
     Transform  = new Transform();
     Components = new ComponentCollection(UnionCommonComponents(components));
 }
Ejemplo n.º 4
0
        public GameService(IWebSocketConnection connection, IComponents components)
        {
            this.connection = connection;

            connection.OnOpen    += OnConnectionEstablished;
            connection.OnClose   += OnConnectionClosed;
            connection.OnError   += OnErrorOccurred;
            connection.OnMessage += OnMessageReceived;

            id = components.Get <IIdGenerator>().GenerateId();
            sessionCollection   = components.Get <IWebSocketSessionCollection>();
            gameSceneCollection = components.Get <IGameSceneCollection>();

            jsonSerializer    = new NativeJsonSerializer();
            handlerCollection = new MessageHandlerCollection(jsonSerializer);
            player            = new PlayerGameObject(id, new IComponent[]
            {
                new AnimationData(),
                new CharacterData(),
                new PresenceMapProvider(),
                new MessageSender(jsonSerializer),
                new PositionChangedMessageSender(),
                new AnimationStateChangedMessageSender(),
                new PlayerAttackedMessageSender(),
                new BubbleNotificationMessageSender()
            });
        }
Ejemplo n.º 5
0
        public GameObject()
        {
            var transform      = Substitute.For <Transform>();
            var dummyCharacter = Substitute.For <DummyCharacter>();
            var collection     = new IComponent[] { transform, dummyCharacter };

            Components = new ComponentCollection(collection);
        }
        public IntegrationController(IUserStore<ApplicationUser,Guid> userStore, IAdminServices adminServices, IServices services, ISettings settings, IComponents components)
            : base(services, settings)
        {
            //if(!(settings.Environment == Environment.Integration || settings.Environment == Environment.Debug))
            //    throw new SecurityException();

            _adminServices = adminServices;
            _userManager = new ApplicationUserManager(userStore, services, components);
        }
Ejemplo n.º 7
0
 public static void getParameterInfo(IParameter parameter, out string doc, out string group, out string compId)
 {
     if (parameter.Parent is Evel.engine.ContributedGroup)
     {
         compId = "-1";
         IGroup gr = (Evel.engine.ContributedGroup)parameter.Parent;
         group = gr.Definition.name;
         doc   = gr.OwningSpectrum.Container.Name;
     }
     else
     {
         Evel.interfaces.IComponent comp = (Evel.interfaces.IComponent)parameter.Parent;
         IComponents comps = (IComponents)comp.Parent;
         compId = ((comps.Size > 1) ? comps.IndexOf(comp) + 1 : 0).ToString();
         group  = comps.Parent.Definition.name;
         doc    = comps.Parent.OwningSpectrum.Container.Name;
     }
 }
Ejemplo n.º 8
0
        private void Config()
        {
            int    hr;
            object o;

            IComponents comps = (IComponents) new Components();

            IComponent icomp = (IComponent) new Component();

            for (int x = 0; x < 7; x++)
            {
                hr = comps.Add(icomp, out o);
                DsError.ThrowExceptionForHR(hr);
            }

            hr = comps.EnumComponents(out m_pEnum);
            DsError.ThrowExceptionForHR(hr);
        }
Ejemplo n.º 9
0
 public void GridCellValueChange(object sender, DataGridViewCellEventArgs e)
 {
     if (gridView[e.ColumnIndex, e.RowIndex] is DataGridViewParameterCell)
     {
         IParameter parameter = ((DataGridViewParameterCell)gridView[e.ColumnIndex, e.RowIndex]).Parameter;
         if (parameter.Definition.Name == "int")
         {
             double      sum        = parameter.Value;
             IComponents components = spectra[e.RowIndex - 1].Parameters[groupDefinition.name].Components;
             foreach (IComponent component in components)
             {
                 if (component[0] != parameter && component != components[0])
                 {
                     sum += component[0].Value;
                 }
             }
             components[0][0].Value = 1 - sum;
         }
     }
 }
Ejemplo n.º 10
0
        private void Config()
        {
            Components c = new Components();

            m_comps = (IComponents)c;
        }
Ejemplo n.º 11
0
        public IdGeneratorTests()
        {
            var collection = new[] { new IdGenerator() };

            components = new ComponentCollection(collection);
        }
 public SpecialistRegistrationController(IServices services, ISettings settings, IComponents components, IUserStore<ApplicationUser, Guid> userStore)
     : base(services, settings)
 {
     _userManager = new ApplicationUserManager(userStore, services, components);
     ModelMapper();
 }
Ejemplo n.º 13
0
        void IComponent.Awake(IComponents components)
        {
            Components = components;

            OnAwake();
        }
 public AccountApiController(IServices services, ISettings settings, IComponents components, IUserStore<ApplicationUser, Guid> userStore)
     : base(services, settings)
 {
     _userManager = new ApplicationUserManager(userStore, services, components);
 }
Ejemplo n.º 15
0
 public UserService(IUnitOfWork unitOfWork, IRepository repository, ISettings settings, IComponents components)
     : base(unitOfWork, repository, settings)
 {
     _components = components;
     bookingService = ServiceLocator.Current.GetInstance<IBookingService>();
 }
 public void SetComponent(IComponents component)
 {
     this.component = component;
 }
Ejemplo n.º 17
0
 public CallService(IUnitOfWork unitOfWork, IRepository repository, ISettings settings, IComponents components)
     : base(unitOfWork, repository, settings)
 {
     Client = new TwilioRestClient(AppSettings.AccountSid, AppSettings.AuthToken);
 }
 public CustomerRegistrationController(IServices services, ISettings settings, IComponents components, IUserStore<ApplicationUser, Guid> userStore)
     : base(services, settings)
 {
     _userManager = new ApplicationUserManager(userStore, services, components);
 }
Ejemplo n.º 19
0
 // If we want to stream a music file, we can't
 public StreamProgressInfo(IComponents component)
 {
     this.component = component;
 }
 public TranscriptionController(IServices services, ISettings settings, IComponents components)
     : base(services, settings)
 {
 }
Ejemplo n.º 21
0
 public void Awake(IComponents components)
 {
     // Left blank intentionally
 }
Ejemplo n.º 22
0
 public void Add(IComponents component)
 {
     list.Add(component);
 }
Ejemplo n.º 23
0
 public void Remove(IComponents component)
 {
     list.Remove(component);
 }
Ejemplo n.º 24
0
        public RandomNumberGeneratorTests()
        {
            var collection = new[] { new RandomNumberGenerator() };

            components = new ComponentCollection(collection);
        }
Ejemplo n.º 25
0
        //private double[] conversion = new double[4];

        private void getConversionParameters(IComponent component, out double intD, out double tauD)
        {
            //0 "int
            //1 tauD
            //2 kappaD
            //   wyrzucone taufree z modelu dwustanowego
            //3 intD
            //4 tau

            double lambdaA;
            //double lambdaBulk;
            double kappa;

            //tauD
            tauD = Math.Abs(component["tauD"].Value);
            if (Math.Abs(tauD) > 1e-30)
            {
                lambdaA = 1 / tauD;
            }
            else
            {
                lambdaA = 0;
            }

            ////tauEff
            //tauEff = Math.Abs(component[3].Value);
            //if (tauEff > 1e-30)
            //    lambdaBulk = 1 / tauEff;
            //else
            //    lambdaBulk = 0;

            if (Math.Abs(component[2].Value) > 1e+10)
            {
                kappa = 1e+10;
            }
            else
            {
                kappa = Math.Abs(component[2].Value);
            }
            //lamdaEf = lambdaBulk + kappaD
            //double lambdaEf = lambdaBulk + kappa;

            double      sum        = 0;
            IComponents components = component.Parent as IComponents;

            for (int i = 0; i < components.Size; i++)
            {
                sum += components[i]["kappaD"].Value;
            }

            if (Math.Abs(kappa + 100) > 1e-30)
            {
                intD = kappa / sum;
            }
            else
            {
                intD = 1;
            }

            //if (lambdaEf > 1e-30)
            //    tauEff = 1 / lambdaEf;
            //else
            //    tauEff = 0;
        }