Пример #1
0
        public ContenedorPlato PlatoEliminar(ContenedorPlato entrada)
        {
            CRUDPlato x = new CRUDPlato();

            x.LlamarSPEliminar(entrada);
            return(entrada);
        }
Пример #2
0
        public ContenedorPlato LlamarSPEliminar(ContenedorPlato ePlato)
        {
            if (ValidarPerfilCUD(ePlato.Retorno.Token))
            {
                var p_OUT_CODRET = new ObjectParameter("P_OUT_CODRET", typeof(decimal));
                var p_OUT_GLSRET = new ObjectParameter("P_OUT_GLSRET", typeof(string));

                CapaDato.EntitiesBBDDHostel conex = new CapaDato.EntitiesBBDDHostel();

                conex.SP_ELIMINAR_PLATO
                    (ePlato.Item.Codigo
                    , p_OUT_CODRET
                    , p_OUT_GLSRET
                    );

                try
                {
                    ePlato.Retorno.Codigo = decimal.Parse(p_OUT_CODRET.Value.ToString());
                    ePlato.Retorno.Glosa  = p_OUT_GLSRET.Value.ToString();
                }
                catch (Exception)
                {
                    ePlato.Retorno.Codigo = 1011;
                    ePlato.Retorno.Glosa  = "Err codret ORACLE";
                }
            }
            else
            {
                ePlato.Retorno.Codigo = 100;
                ePlato.Retorno.Glosa  = "Err expiro sesion o perfil invalido";
            }

            return(ePlato);
        }
Пример #3
0
        public ContenedorPlato PlatoActualizar(ContenedorPlato entrada)
        {
            CRUDPlato x = new CRUDPlato();

            x.LlamarSPActualizar(entrada);
            return(entrada);
        }
Пример #4
0
        public ContenedorPlato LlamarSPCrear(ContenedorPlato nPlato)
        {
            if (ValidarPerfilCUD(nPlato.Retorno.Token))
            {
                var p_OUT_CODRET = new ObjectParameter("P_OUT_CODRET", typeof(decimal));
                var p_OUT_GLSRET = new ObjectParameter("P_OUT_GLSRET", typeof(string));
                var p_OUT_CODIGO = new ObjectParameter("P_OUT_CODIGO", typeof(decimal));

                CapaDato.EntitiesBBDDHostel conex = new CapaDato.EntitiesBBDDHostel();

                conex.SP_CREAR_PLATO
                    (nPlato.Item.Nombre
                    , nPlato.Item.Descripcion
                    , nPlato.Item.Disponible
                    , nPlato.Item.TipoServicio
                    , p_OUT_CODRET
                    , p_OUT_GLSRET
                    , p_OUT_CODIGO
                    );

                try
                {
                    nPlato.Item.Codigo    = decimal.Parse(p_OUT_CODIGO.Value.ToString());
                    nPlato.Retorno.Codigo = decimal.Parse(p_OUT_CODRET.Value.ToString());
                    nPlato.Retorno.Glosa  = p_OUT_GLSRET.Value.ToString();
                }
                catch (Exception)
                {
                    nPlato.Item.Codigo    = 0;
                    nPlato.Retorno.Codigo = 1011;
                    nPlato.Retorno.Glosa  = "Err codret ORACLE";
                }
            }
            else
            {
                nPlato.Retorno.Codigo = 100;
                nPlato.Retorno.Glosa  = "Err expiro sesion o perfil invalido";
            }

            return(nPlato);
        }