Exemplo n.º 1
0
        // GET: LocalController/Delete/5
        public ActionResult Delete(int id)
        {
            Local      local      = _localService.Obter(id);
            LocalModel localModel = _mapper.Map <LocalModel>(local);

            return(View(localModel));
        }
Exemplo n.º 2
0
        public async Task <ActionResult <LocalModel> > PostLocal(LocalModel item)
        {
            _context.Local.Add(item);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(GetLocal), new { id = item.Id }, item));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("ID_Local,ID,Sigla,Nome,Descricao,Inativo")] LocalModel localModel)
        {
            if (id != localModel.ID_Local)
            {
                //return NotFound();
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(localModel);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LocalModelExists(localModel.ID_Local))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ID"] = new SelectList(_context.SetorModel, "ID", "Nome", localModel.ID_Local);
            return(View(localModel));
        }
        public IHttpActionResult Put(int Id, LocalDTO local)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                LocalModel lc = new LocalModel();

                if (Id == 0)
                {
                    lc.Inserir(local);
                }
                else
                {
                    lc.Editar(local);
                }

                return(Ok("Executado com sucesso!"));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
Exemplo n.º 5
0
        public Vector2?ProjectTangent(Vector3 spacePoint, Vector3 tangent)
        {
            var localPoint   = LocalToGlobal.ApplyInv(spacePoint);
            var localTangent = LocalToGlobal.Rotation.ApplyInv(tangent);

            return(LocalModel.ProjectTangent(localPoint, localTangent));
        }
Exemplo n.º 6
0
        public async Task DeleteLocal(LocalModel localModel)
        {
            await Initialize();

            await _localModel.DeleteAsync(localModel);

            await SyncLocais();
        }
Exemplo n.º 7
0
        /// <summary>
        /// All the information that you need to recreate or use the model on your own.
        /// It includes a very intuitive description of the tree-like structure that made
        /// the model up and the field's dictionary describing the fields and their summaries.
        /// </summary>

        public LocalModel ModelStructure(Dictionary <string, DataSet.Field> fields = null)
        {
            if (_modelStruture == null)
            {
                _modelStruture = new LocalModel(Object.model, fields);
            }
            return(_modelStruture);
        }
        public LambdaFunction()
        {
            AWSSDKHandler.RegisterXRayForAllServices();

            var sender = LambdaConfig.CreateSender();

            _handler = LambdaPluginConfig.CreateHandler(sender);
        }
Exemplo n.º 9
0
 public ActionResult Edit(int id, LocalModel localModel)
 {
     if (ModelState.IsValid)
     {
         var local = _mapper.Map <Local>(localModel);
         _localService.Editar(local);
     }
     return(RedirectToAction(nameof(Index)));
 }
Exemplo n.º 10
0
        private void DataGridModels_LoadingRow(object sender, DataGridRowEventArgs e)
        {
            LocalModel localModel = (LocalModel)e.Row.Item;

            if (localModel.Page != ViewModel.LocalModels.CurrentPage)
            {
                e.Row.Visibility = Visibility.Collapsed;
            }
        }
Exemplo n.º 11
0
 public ActionResult Create(LocalModel localModel)
 {
     if (ModelState.IsValid)
     {
         var local = _mapper.Map <Local>(localModel);
         _localService.Inserir(local);
     }
     return(RedirectToAction(nameof(Index)));
 }
Exemplo n.º 12
0
 public Guid Salvar(LocalModel local)
 {
     using (var db = new MainContextFactory().CreateDbContext(null))
     {
         db.Locais.Add(local);
         db.SaveChanges();
         return(local.Id);
     }
 }
        public void ModelDetails(LocalModel model, bool changePage = true)
        {
            MainWindow.ViewModel.ModelSaberLocalDetailsUserControl.ViewModel.Model = model;
            if (changePage)
            {
                MainWindow.userControlMain.Content = MainWindow.ViewModel.ModelSaberLocalDetailsUserControl;
            }

            userControl.dataGridModels.UnselectAll();
        }
Exemplo n.º 14
0
        public ActionResult Create()
        {
            var result = ApiClientFactory.Instance.GetUnidadeInfraEstruturaAll();

            var local = new LocalModel
            {
                ListUnidadeInfraestrutura = new SelectList(result, "CodUnidadeInfraestrutura", "NomUnidadeÌnfraestrutura"),
            };

            return(View(local));
        }
Exemplo n.º 15
0
        public static LocalModel CreateHandler(IRoutingSender sender)
        {
            var plugins = DiscoverPlugins();
            var handler = new LocalModel();

            foreach (var plugin in plugins.Where(x => x.ServiceType == ServiceType.MessageHandler))
            {
                Bootstrapper.RegisterPluginAsync(sender, handler, plugin).Wait();
            }

            return(handler);
        }
Exemplo n.º 16
0
        public async Task <IActionResult> Create([Bind("ID_Local,ID,Sigla,Nome,Descricao,Inativo")] LocalModel localModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(localModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ID"] = new SelectList(_context.SetorModel, "ID", "Nome", localModel.ID);
            return(View(localModel));
        }
Exemplo n.º 17
0
        public async Task <IActionResult> PutLocal(long id, LocalModel item)
        {
            if (id != item.Id)
            {
                return(BadRequest());
            }

            _context.Entry(item).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(NoContent());
        }
Exemplo n.º 18
0
 public void Select_Test_정상적인_과정을_거쳐서_검색하는지()
 {
     using (mocks.Record())
     {
         string strSQLQuery = sqlQueryHouse.selectSettingInfo();
         dbModel.GetData(strSQLQuery);
         string strLocalQuery = LocalQueryHouse.selectSettingInfo();
         LocalModel.GetData(strLocalQuery);
     }
     objectForTest.Select();
     mocks.VerifyAll();
 }
Exemplo n.º 19
0
        public ActionResult Edit(int id)
        {
            var obj           = ApiClientFactory.Instance.GetLocalById(id);
            var resultUnidade = ApiClientFactory.Instance.GetUnidadeInfraEstruturaAll();

            var model = new LocalModel()
            {
                Local = obj,
                ListUnidadeInfraestrutura = new SelectList(resultUnidade, "CodUnidadeInfraestrutura", "NomUnidadeÌnfraestrutura", obj.UnidadeInfraestrutura.CodUnidadeInfraestrutura)
            };

            return(View(model));
        }
        public void DeleteModel(OnlineModel model)
        {
            ModelSaberLocalUserControl localUserControl = PropertyHelper.GetPropValue <ModelSaberLocalUserControl>(MainWindow.ViewModel, $"{ModelType}LocalUserControl");
            LocalModel localModel = localUserControl.ViewModel.LocalModels?.Models.FirstOrDefault(x => x.Id == model.Id || x.Name == model.Name && x.Id == -1);

            if (localModel != null)
            {
                localUserControl.ViewModel.DeleteModel(localModel);
            }

            App.ModelSaberApi.DeleteModel(model);
            ModelChanged = true;
        }
Exemplo n.º 21
0
        public void Insert_Test_CommonSettinginfo_From_DB만_Null로_입력시에_CommonSettinginfo_From_LocalFile만_입력_하는지()
        {
            CommonSettinginfo si = mocks.Stub <CommonSettinginfo>();

            si.CommonSettinginfo_DB        = null;
            si.CommonSettinginfo_LocalFile = new CommonSettinginfo_From_LocalFile();
            using (mocks.Record())
            {
                string LocalQuery = LocalQueryHouse.insertSettingInfo(si);
                LocalModel.SetData(LocalQuery);
            }
            objectForTest.Insert(si);
            mocks.VerifyAll();
        }
Exemplo n.º 22
0
        // GET: LocalController/Edit/5
        public ActionResult Edit(int id)
        {
            ViewBag.title_page = "Local";
            ViewBag.path       = "Início / Local / Editar";

            Local      local      = _localService.Obter(id);
            LocalModel localModel = _mapper.Map <LocalModel>(local);

            IEnumerable <Organizacao> listaorganizacao = _organizacaoService.ObterTodos();

            ViewBag.idOrganizacao = new SelectList(listaorganizacao, "IdOrganizacao", "NomeFantasia", null);

            return(View(localModel));
        }
Exemplo n.º 23
0
        public Segment3?CropVisible(Segment3 segment)
        {
            var localSegment = LocalToGlobal.ApplyInv(segment);

            var localCrop = LocalModel.CropVisible(localSegment);

            if (localCrop == null)
            {
                return(null);
            }
            else
            {
                return(LocalToGlobal.Apply(localCrop.Value));
            }
        }
Exemplo n.º 24
0
        public async Task SaveLocal(LocalModel localModel)
        {
            await Initialize();

            if (string.IsNullOrEmpty(localModel.Id))
            {
                await _localModel.InsertAsync(localModel);
            }
            else
            {
                await _localModel.UpdateAsync(localModel);
            }

            await SyncLocais();
        }
Exemplo n.º 25
0
        public void Update_Test_정상적인_값_입력하고_정상적인_과정_거치는지()
        {
            CommonSettinginfo si = mocks.Stub <CommonSettinginfo>();

            si.CommonSettinginfo_DB        = new CommonSettinginfo_From_DB();
            si.CommonSettinginfo_LocalFile = new CommonSettinginfo_From_LocalFile();
            using (mocks.Record())
            {
                string strSQLQuery = sqlQueryHouse.updateSettingInfo(si);
                dbModel.SetData(strSQLQuery);
                string strLocalQuery = LocalQueryHouse.updateSettingInfo(si);
                LocalModel.SetData(strLocalQuery);
            }
            objectForTest.Update(si, null);
            mocks.VerifyAll();
        }
        public ActionResult Investigation()
        {
            var suspeitos = new SuspeitoModel().GetAll();
            var locais    = new LocalModel().GetAll();
            var armas     = new ArmaModel().GetAll();

            ViewBag.Suspeitos = suspeitos;
            ViewBag.Locais    = locais;
            ViewBag.Armas     = armas;

            new InvestigacaoModel().InicialNovoJogo(
                suspeitos.Count(),
                locais.Count(),
                armas.Count());

            return(View());
        }
        public void DeleteModel(LocalModel model)
        {
            ModelSaberOnlineUserControl onlineUserControl = PropertyHelper.GetPropValue <ModelSaberOnlineUserControl>(MainWindow.ViewModel, $"{ModelType}OnlineUserControl");
            OnlineModel onlineModel = onlineUserControl.ViewModel.OnlineModels?.Models.FirstOrDefault(x => x.Id == model.Id || x.Name == model.Name && model.Id == -1);

            App.ModelSaberApi.DeleteModel(model);
            LocalModels.Models.Remove(model);
            if (onlineModel is null)
            {
                ModelChanged = true;
            }
            else
            {
                onlineModel.IsDownloaded = false;
            }

            LocalModels = App.ModelSaberApi.RefreshLocalPages(LocalModels);
        }
Exemplo n.º 28
0
        public void Insert_Test_올바른_값_입력시에_올바르게_작동하는지()
        {
            CommonSettinginfo_From_DB        si_db    = new CommonSettinginfo_From_DB();
            CommonSettinginfo_From_LocalFile si_local = new CommonSettinginfo_From_LocalFile();
            CommonSettinginfo si = mocks.Stub <CommonSettinginfo>();

            si.CommonSettinginfo_DB        = si_db;
            si.CommonSettinginfo_LocalFile = si_local;
            using (mocks.Record())
            {
                string SQLQuery = sqlQueryHouse.insertSettingInfo(si);
                dbModel.SetData(SQLQuery);
                string LocalQuery = LocalQueryHouse.insertSettingInfo(si);
                LocalModel.SetData(LocalQuery);
            }
            objectForTest.Insert(si);
            mocks.VerifyAll();
        }
Exemplo n.º 29
0
 public ActionResult Edit(string local)
 {
     if (local != null)
     {
         int id = int.Parse(local);
         ViewBag.id          = id;
         TempData["codigol"] = id;
         Local      lo  = db.Local.Find(id);
         LocalModel lo1 = new LocalModel();
         Session["local"] = lo;
         int idl = (int)lo.idRegion;
         lo1.idRegion = (int)lo.idRegion;
         lo1.idProv   = (int)lo.idProvincia;
         List <Region> listaDep = db.Region.Where(c => c.idRegPadre == null).ToList();
         List <Region> listProv = db.Region.Where(c => c.idRegPadre == idl).ToList();
         ViewBag.DepID  = new SelectList(listaDep, "idRegion", "nombre", lo1.idRegion);
         ViewBag.ProvID = new SelectList(listProv, "idRegion", "nombre", lo1.idProv);
     }
     return(View("Edit"));
 }
Exemplo n.º 30
0
        /// <summary>
        /// Merge this state with another one.
        /// </summary>
        /// <param name="state">
        /// A <see cref="IGraphicsState"/> having the same <see cref="StateIdentifier"/> of this state.
        /// </param>
        /// <remarks>
        public override void Merge(IGraphicsState state)
        {
            if (state == null)
            {
                throw new ArgumentNullException("state");
            }

            try {
                TransformStateBase otherState = (TransformStateBase)state;

                // Override projection matrix, if defined
                if (otherState.LocalProjection != null)
                {
                    LocalProjection = otherState.LocalProjection;
                }
                // Affine local model
                LocalModel.Set(LocalModel.Multiply(otherState.LocalModel));
            } catch (InvalidCastException) {
                throw new ArgumentException("not a TransformStateBase", "state");
            }
        }
Exemplo n.º 31
0
 /// <summary>
 /// All the information that you need to recreate or use the model on your own.
 /// It includes a very intuitive description of the tree-like structure that made
 /// the model up and the field's dictionary describing the fields and their summaries.
 /// </summary>
 public LocalModel ModelStructure(Dictionary<string, DataSet.Field> fields=null)
 {
     if (_modelStruture == null)
     {
         _modelStruture = new LocalModel(Object.model, fields);
     }
     return _modelStruture;
 }