public static bool ultMov(CL_Est objEst, string con) { DB_Funcoes.DesmontaConexao(con); CONEXAO = montaDAO(CONEXAO); Conn = new NpgsqlConnection(CONEXAO); DateTime data; try { string sql = "SELECT mov_data FROM movest WHERE est_cod='" + objEst.est_cod + "' ORDER BY mov_data DESC"; NpgsqlCommand comand = new NpgsqlCommand(sql, Conn); NpgsqlDataReader dr; Conn.Open(); dr = comand.ExecuteReader(); if (dr.HasRows) { if (dr.Read()) { data = Convert.ToDateTime(dr["mov_data"]); if (data.AddYears(5) > DateTime.Now) { return(true); } else { return(false); } } else { return(true); } } else { return(true); } } catch (Exception ex) { ex.ToString(); return(false); } finally { if (Conn.State == ConnectionState.Open) { Conn.Close(); } } }
public static bool ultMov(CL_Est objEst, string con) { return(DB_Movest.ultMov(objEst, con)); }
public static bool cadEstDGA(CL_Est objEst, string con) { return(DB_Est.cadEstDGA(objEst, con)); }
public static bool alteraEstDGA(CL_Est objEst, string con) { return(DB_Est.alteraEstDGA(objEst, con)); }
public static bool excluiEst(CL_Est objEst, string con) { return(DB_Est.excluiEst(objEst, con)); }