Beispiel #1
0
 /// <summary>
 /// Consulta todos os Estados, ou um especifico
 /// </summary>
 /// <param name="Id"></param>
 /// <returns></returns>
 public List <EstadoDTO> Consultar(int Id)
 {
     using (EstadoDAL DAL = new EstadoDAL(false))
     {
         return(DAL.Consultar(Id));
     }
 }
Beispiel #2
0
        public List <EstadoInfo> ListarPaginado()
        {
            EstadoDAL dal = new EstadoDAL(this.DbHnd);

            dal.Filters = this.Filters;
            return(dal.ListarPaginado());
        }
Beispiel #3
0
        public EstadoDTO CarregaEstadoDTO(int est_id)
        {
            EstadoDAL dalObj = new EstadoDAL(conexao);

            dalObj.CarregaEstadoDTO(est_id);

            return(dalObj.CarregaEstadoDTO(est_id));
        }
Beispiel #4
0
        public DataTable Pesquisar(String est_estado)
        {
            EstadoDAL dalObj = new EstadoDAL(conexao);

            dalObj.Pesquisar(est_estado);

            return(dalObj.Pesquisar(est_estado));
        }
 public static void EliminarEstado(Estado estado)
 {
     try
     {
         EstadoDAL.EliminarEstado(estado);
     }
     catch (Exception)
     {
         throw;
     }
 }
 public static void Modificar(Estado estado)
 {
     try
     {
         EstadoDAL.Modificar(estado);
     }
     catch (Exception)
     {
         throw;
     }
 }
 public static Estado BuscarEstado(int id)
 {
     try
     {
         return(EstadoDAL.BuscarEstado(id));
     }
     catch (Exception)
     {
         throw;
     }
 }
 public static List <Estado> ListadoEstados()
 {
     try
     {
         return(EstadoDAL.listadoEstados());
     }
     catch (Exception)
     {
         throw;
     }
 }
 public static void AgregarEstado(Estado estado)
 {
     try
     {
         EstadoDAL.AgregarEstado(estado);
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #10
0
        public void Alterar(EstadoDTO estBllCrud)
        {
            if (estBllCrud.Est_estado.Trim().Length == 0) //verifica se foi informado
            {
                throw new Exception("O nome do estado é obrigatório");
            }

            EstadoDAL dalObj = new EstadoDAL(conexao);

            dalObj.Alterar(estBllCrud);
        }
Beispiel #11
0
 public Estado[] ImportaEstado()
 {
     try
     {
         return(EstadoDAL.BuscarDados());
     }
     catch
     {
         return(null);
     }
 }
Beispiel #12
0
 public DataTable cargarEstadoPorPais(int Pais)
 {
     try
     {
         EstadoDAL oEstado = new EstadoDAL();
         return(oEstado.cargarEstadoPorPais(Pais));
     }
     catch (Exception ex)
     {
         throw new Exception("Error" + ex.Message);
     }
 }
Beispiel #13
0
 public void inserir()
 {
     try
     {
         objDAL = new EstadoDAL();
         objDAL.inserir(this.est_sigla, this.est_nome);
         objDAL = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #14
0
 public void alterar()
 {
     try
     {
         objDAL = new EstadoDAL();
         objDAL.alterar(this.est_codigo, this.est_sigla, this.est_nome);
         objDAL = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #15
0
 public void excluir()
 {
     try
     {
         objDAL = new EstadoDAL();
         objDAL.excluir(this.est_codigo);
         objDAL = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #16
0
 public void localizar()
 {
     try
     {
         objDAL          = new EstadoDAL();
         this.est_codigo = objDAL.localizar(this.est_codigo);
         objDAL          = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #17
0
 public DataTable localizarComRetorno(String descricao, String atributo)
 {
     try
     {
         DataTable tab;
         objDAL = new EstadoDAL();
         tab    = objDAL.localizar(descricao, atributo);
         objDAL = null;
         return(tab);
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #18
0
 public DataTable localizarEmTudo(String descricao)
 {
     try
     {
         DataTable tab;
         objDAL = new EstadoDAL();
         tab    = objDAL.localizarEmTudo(descricao);
         objDAL = null;
         return(tab);
     }
     catch (Exception)
     {
         throw;
     }
 }
        private void CarregaDDLEstado()
        {
            EstadoDAL     objEstado = new EstadoDAL();
            List <Estado> lstEstado = objEstado.ObterListaDeEstados();

            foreach (Estado lstSigla in lstEstado)
            {
                ListItem lst = new ListItem();

                lst.Value = lstSigla.IdEstado.ToString();
                lst.Text  = lstSigla.Sigla;

                ddlEstado.Items.Add(lst);
            }
            ddlEstado.DataBind();
        }
Beispiel #20
0
 public void localizarProxAnterior(String descricao, int codigo)
 {
     try
     {
         DataTable tab = null;
         objDAL = new EstadoDAL();
         tab    = objDAL.localizarProxAnterior(descricao, codigo);
         if (tab.Rows.Count > 0)
         {
             this.est_codigo = int.Parse(tab.Rows[0][0].ToString());
         }
         objDAL = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #21
0
 public void localizar(String descricao, String atributo)
 {
     try
     {
         DataTable tab;
         objDAL = new EstadoDAL();
         tab    = objDAL.localizar(descricao, atributo);
         if (tab.Rows.Count > 0)
         {
             this.est_codigo = int.Parse(tab.Rows[0]["est_codigo"].ToString());
             this.est_sigla  = tab.Rows[0]["est_sigla"].ToString();
             this.est_nome   = tab.Rows[0]["est_nome"].ToString();
         }
         objDAL = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #22
0
 public void localizarPrimeiroUltimo(String descricao)
 {
     try
     {
         DataTable tab    = null;
         int       codigo = 0;
         objDAL = new EstadoDAL();
         tab    = objDAL.localizarPrimeiroUltimo(descricao);
         if (tab.Rows.Count > 0)
         {
             int.TryParse(tab.Rows[0][0].ToString(), out codigo);
         }
         this.est_codigo = codigo;
         objDAL          = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
        protected void registrarEstadoBtn_Click(object sender, EventArgs e)
        {
            if (this.Page.IsValid)
            {
                // TODO: Todos los datos para ingresar un nuevo Estado a un Contenedor.
                // TODO: Traer el contenedor seleccionado y luego darle el contenedor a la lista de estado.
                String     contenedorListSelected = this.contenedoresDdl.SelectedItem.Value;
                Contenedor contenedorSelected     = contenedores.Find(c => c.NumeroDeSerie == contenedorListSelected);

                int horaTxt    = Convert.ToInt32(this.horaTxt.Text);
                int minutosTxt = Convert.ToInt32(this.minutosTxt.Text);
                var date       = new DateTime(
                    this.fechaLectura.SelectedDate.Year,
                    this.fechaLectura.SelectedDate.Month,
                    this.fechaLectura.SelectedDate.Day,
                    horaTxt,
                    minutosTxt, 0);
                DateTime fechaLectura = date;
                int      nivelLlenado = Convert.ToInt32(this.nivelLlenadoTxt.Text);
                int      tipoEstado   = Convert.ToInt32(this.tipoDdl.SelectedItem.Value);

                int idEstadoU = horaTxt + minutosTxt + contenedorSelected.GetHashCode();

                Estado estado = new Estado()
                {
                    IdEstado       = idEstadoU,
                    FechaLectura   = fechaLectura,
                    TipoEstado     = tipoEstado,
                    NivelDeLlenado = nivelLlenado,
                    Contenedor     = contenedorSelected
                };

                IEstado dal = new EstadoDAL();
                dal.Add(estado);

                Contenedor contenedor = contenedores.FindLast(c => c.NumeroDeSerie == contenedorListSelected);
                contenedor.setEstados(estados);
                // Agregar ese estado a la lista de estados del contenedor seleccionado.
                Response.Redirect("MostrarEstados.aspx");
            }
        }
Beispiel #24
0
        public Int32 Inserir(EstadoInfo pInfo)
        {
            EstadoDAL dal = new EstadoDAL(this.DbHnd);

            return(dal.Inserir(pInfo));
        }
Beispiel #25
0
        public EstadoInfo Get(Int32 pCdEstado)
        {
            EstadoDAL dal = new EstadoDAL(this.DbHnd);

            return(dal.Get(pCdEstado));
        }
Beispiel #26
0
        public void Atualizar(Int32 pCdEstado, EstadoInfo pInfo)
        {
            EstadoDAL dal = new EstadoDAL(this.DbHnd);

            dal.Atualizar(pCdEstado, pInfo);
        }
Beispiel #27
0
        public void Deletar(Int32 pCdEstado)
        {
            EstadoDAL dal = new EstadoDAL(this.DbHnd);

            dal.Deletar(pCdEstado);
        }
Beispiel #28
0
        public DataTable cargarEstados()
        {
            EstadoDAL estados = new EstadoDAL();

            return(estados.cargarEstados());
        }
Beispiel #29
0
        public Types.EstadosType select(int idPais)
        {
            EstadoDAL estado = new EstadoDAL();

            return(estado.select(idPais));
        }
Beispiel #30
0
        public Types.EstadoType selectRecord(int idEstado)
        {
            EstadoDAL estado = new EstadoDAL();

            return(estado.selectRecord(idEstado));
        }