public bool ElimarDocumento(int Id)
        {
            try
            {
                SqlCommand command = new SqlCommand
                {
                    CommandText = ConstStoredProcedures.SpDeleteImagenClienteFlex
                };

                command.Parameters.Add("@Id", SqlDbType.Int).Value = Id;


                SqlDataReader datosStored = iGenericDataAccess.StoredProcedure(command);

                iGenericDataAccess.CloseConnection();
            }
            catch (Exception e)
            {
                iGenericDataAccess.CloseConnection();
                throw new DalException(Codes.ERR_00_01, e);
            }


            return(true);
        }
        public IList <CategoriaModel> ConsultarCategoria()
        {
            List <CategoriaModel> listDatos = new List <CategoriaModel>();

            try
            {
                SqlCommand command = new SqlCommand
                {
                    CommandText = ConstStoredProcedures.SpObtieneDatosCategoriaFlex
                };



                SqlDataReader datosStored = iGenericDataAccess.StoredProcedure(command);
                if (datosStored.HasRows)
                {
                    while (datosStored.Read())
                    {
                        listDatos.Add(new CategoriaModel
                        {
                            Id = Convert.ToInt32(datosStored["Id"]),
                            NombreCategoria = Convert.ToString(datosStored["Categoria"])
                        });
                    }
                    iGenericDataAccess.CloseConnection();
                }
            }
            catch (Exception e)
            {
                iGenericDataAccess.CloseConnection();
                throw new DalException(Codes.ERR_00_01, e);
            }


            return(listDatos);
        }
Exemple #3
0
        /* INDRA FJQP Implementacion de config Emisión Multiple */
        public FiltroConfigMultiple FiltrosConfigMultiple(string IdUsuario)
        {
            //
            var Datos = new FiltroConfigMultiple();

            List <Commons.Modelos.ConfigMultiple.ClientesConfig>  listClientes  = new List <Commons.Modelos.ConfigMultiple.ClientesConfig>();
            List <Commons.Modelos.ConfigMultiple.ProductosConfig> listProdcutos = new List <Commons.Modelos.ConfigMultiple.ProductosConfig>();

            try
            {
                SqlCommand command = new SqlCommand
                {
                    CommandText = ConstStoredProcedures.SpSelAseguradorasConfigMultiple
                };
                command.Parameters.Add("@UsuarioId", SqlDbType.VarChar).Value = IdUsuario;

                SqlDataReader datosStored = iGenericDataAccess.StoredProcedure(command);
                if (datosStored.HasRows)
                {
                    while (datosStored.Read())
                    {
                        listClientes.Add(new Commons.Modelos.ConfigMultiple.ClientesConfig
                        {
                            Clave  = Convert.ToString(datosStored["Clave"]),
                            Nombre = Convert.ToString(datosStored["Nombre"]),
                        });
                    }
                    iGenericDataAccess.CloseConnection();
                }


                SqlCommand command2 = new SqlCommand
                {
                    CommandText = ConstStoredProcedures.SpSelProductosPorUsuarioFlex
                };
                command2.Parameters.Add("@UsuarioId", SqlDbType.VarChar).Value = IdUsuario;

                SqlDataReader datosStored2 = iGenericDataAccess.StoredProcedure(command2);
                if (datosStored2.HasRows)
                {
                    while (datosStored2.Read())
                    {
                        listProdcutos.Add(new Commons.Modelos.ConfigMultiple.ProductosConfig
                        {
                            Clave  = Convert.ToString(datosStored2["Clave"]),
                            Nombre = Convert.ToString(datosStored2["Nombre"]),
                        });
                    }
                    iGenericDataAccess.CloseConnection();
                }

                Datos.ClientesList  = listClientes;
                Datos.ProductosList = listProdcutos;
            }
            catch (Exception e)
            {
                iGenericDataAccess.CloseConnection();
                throw new DalException(Codes.ERR_00_01, e);
            }

            return(Datos);
        }