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")); }
// // 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>(); }
public GameObject(int id, string name, IComponent[] components = null) { Id = id; Name = name; Transform = new Transform(); Components = new ComponentCollection(UnionCommonComponents(components)); }
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() }); }
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); }
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; } }
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); }
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; } } }
private void Config() { Components c = new Components(); m_comps = (IComponents)c; }
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(); }
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); }
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; }
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); }
// 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) { }
public void Awake(IComponents components) { // Left blank intentionally }
public void Add(IComponents component) { list.Add(component); }
public void Remove(IComponents component) { list.Remove(component); }
public RandomNumberGeneratorTests() { var collection = new[] { new RandomNumberGenerator() }; components = new ComponentCollection(collection); }
//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; }