예제 #1
0
        public void Alterar(ModeloCategoria c)
        {
            if (c.CodCategoria <= 0)
            {
                throw new Exception("Selecione uma categoria.");
            }

            DALCategoria da = new DALCategoria(CONEXAO);
            da.Alterar(c);
        }
예제 #2
0
 public void Alterar(ModeloCategoria modelo)
 {
     if (modelo.CatCod <= 0)
     {
         throw new Exception("O código da categoria é obrigatório");
     }
     if (modelo.CatNome.Trim().Length == 0)
     {
         throw new Exception("O nome da categoria é obrigatório");
     }
     //modelo.CatNome = modelo.CatNome.ToUpper();
     DALCategoria DALobj = new DALCategoria(conexao);
     DALobj.Alterar(modelo);
 }
예제 #3
0
        public void Alterar(ModeloCategoria modelo)
        {
            if (modelo.CatCod <= 0)
            {
                throw new Exception("O Código é Obrigatorio");
            }
            if (modelo.CatNome.Trim().Length == 0)
            {
                throw new Exception("O Nome da Categoria é obrigatorio");
            }

            modelo.CatNome = modelo.CatNome.ToUpper();

            DALCategoria DALObj = new DALCategoria(conexao);
            DALObj.Alterar(modelo);
        }