public async Task <IActionResult> PutCatalogoCliente(int id, CatalogoCliente catalogoCliente)
        {
            if (id != catalogoCliente.IdCatalogoCliente)
            {
                return(BadRequest());
            }

            _context.Entry(catalogoCliente).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CatalogoClienteExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemplo n.º 2
0
        private void popupWindowShowActionSnd_Execute(object sender, PopupWindowShowActionExecuteEventArgs e)
        {
            AnuncioFiltro fil = (AnuncioFiltro)e.PopupWindowViewCurrentObject;


            if (fil != null)
            {
                IObjectSpace    objectSpace = Application.CreateObjectSpace();
                IList <Cliente> clientes;


                GroupOperator gfil = new GroupOperator();

                gfil.Operands.Add(new BinaryOperator("Compania.Direccion.Email", string.Empty, BinaryOperatorType.NotEqual));
                if (!string.IsNullOrEmpty(fil.Clv))
                {
                    gfil.Operands.Add(new BinaryOperator("Clave", fil.Clv));
                }
                else
                {
                    if (fil.ClntPrspct != null)
                    {
                        CatalogoCliente cp = objectSpace.FindObject <CatalogoCliente>
                                                 (new BinaryOperator("Oid", fil.ClntPrspct.Oid));
                        gfil.Operands.Add(new BinaryOperator("ClntPrspct", cp));
                    }

                    if (fil.Clsfccn != null)
                    {
                        Clasificacion cl = objectSpace.FindObject <Clasificacion>
                                               (new BinaryOperator("Oid", fil.Clsfccn.Oid));
                        gfil.Operands.Add(new BinaryOperator("Clasifica", cl));
                    }

                    if (fil.Stts != null)
                    {
                        gfil.Operands.Add(new BinaryOperator("Status", fil.Stts));
                    }
                }
                clientes = objectSpace.GetObjects <Cliente>(gfil);

                EnviaC2(clientes, fil.Idntfcdr, fil.Asnt);
            }
        }
        public async Task <ActionResult <CatalogoCliente> > PostCatalogoCliente(CatalogoCliente catalogoCliente)
        {
            _context.CatalogoCliente.Add(catalogoCliente);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (CatalogoClienteExists(catalogoCliente.IdCatalogoCliente))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetCatalogoCliente", new { id = catalogoCliente.IdCatalogoCliente }, catalogoCliente));
        }