public async Task <IActionResult> Put(Guid ServicioId, [FromBody] TServicio servicio)
        {
            servicio.ServId = ServicioId;
            await repositorio.Save(servicio);

            return(Ok(true));
        }
示例#2
0
        public void Delete(Guid ServicioID)
        {
            TServicio dbEntry = context.TServicio
                                .FirstOrDefault(p => p.ServId == ServicioID);

            if (dbEntry != null)
            {
                context.TServicio.Remove(dbEntry);
                context.SaveChangesAsync();
            }
        }
示例#3
0
        public async Task Save(TServicio servicio)
        {
            if (servicio.ServId == Guid.Empty)
            {
                servicio.ServId = Guid.NewGuid();
                context.TServicio.Add(servicio);
            }
            else
            {
                TServicio dbEntry = context.TServicio
                                    .FirstOrDefault(p => p.ServId == servicio.ServId);
                if (dbEntry != null)
                {
                    dbEntry.ServNombre = servicio.ServNombre;
                }
            }

            await context.SaveChangesAsync();
        }
        public async Task <IActionResult> Post([FromBody] TServicio servicio)
        {
            await repositorio.Save(servicio);

            return(Ok(true));
        }
示例#5
0
        public MAN009SView(TServicio Opcion, Int16 x_EntidadPadre)
        {
            InitializeComponent();
            try
            {
                this.StartPosition = FormStartPosition.CenterScreen;
                //this.aydSERV_Codigo
                btnGuardar.Click += btnGuardar_Click;
                btnSalir.Click   += btnSalir_Click;
                TRegistro         = Opcion;
                m_TipoEntidad     = x_EntidadPadre;
                switch (x_EntidadPadre)
                {
                case EntidadClear.TIPE_Cliente:
                    pcTitleServicios.Caption = "Servicios del Cliente";
                    break;

                case EntidadClear.TIPE_Proveedor:
                    pcTitleServicios.Caption = "Servicios del Proveedor";
                    break;

                case EntidadClear.TIPE_Ejecutivo:
                    pcTitleServicios.Caption = "Servicios del Ejecutivo";
                    break;

                case EntidadClear.TIPE_CustomerService:
                    pcTitleServicios.Caption = "Servicios del Customer Service";
                    break;

                case EntidadClear.TIPE_Transportista:
                    pcTitleServicios.Caption = "Servicios del Transportista";
                    break;

                case EntidadClear.TIPE_Broker:
                    pcTitleServicios.Caption = "Servicios del Broker";
                    break;

                case EntidadClear.TIPE_Contacto:
                    pcTitleServicios.Caption = "Servicios del Contacto";
                    break;

                case EntidadClear.TIPE_Shipper:
                    pcTitleServicios.Caption = "Servicios del Shipper";
                    break;

                case EntidadClear.TIPE_DepositoTemporal:
                    pcTitleServicios.Caption = "Servicios del Deposito Temporal";
                    break;

                case EntidadClear.TIPE_DepositoVacio:
                    pcTitleServicios.Caption = "Servicios del Desposito de Vacios";
                    break;

                case EntidadClear.TIPE_Agente:
                case EntidadClear.TIPE_AgentePortuario:
                case EntidadClear.TIPE_AgenciaAduanera:
                case EntidadClear.TIPE_AgenciaMaritima:
                case EntidadClear.TIPE_AgenteCarga:
                    pcTitleServicios.Caption = "Servicios del Agente";
                    break;
                }
            }
            catch (Exception ex)
            { Dialogos.MostrarMensajeError(Presenter.Title, "Ha ocurrido un error inicializando.", ex); }
        }