Esempio n. 1
0
 public frmExeGerenciar()
 {
     InitializeComponent();
     exe = new Exercicio();
     lblTotExe.Text = exe.getTotal();
     exe.Desc = "";
     atualizaDtgv();
 }
Esempio n. 2
0
 public frmExeNovo(String exeId)
 {
     InitializeComponent();
     exe = new Exercicio();
     exe.Id = exeId;
     if (exe.Id != "")
     {
         exe = exe.getById();
         adptaInterface();
     }
 }
Esempio n. 3
0
 public bool altera(Exercicio exe)
 {
     sql = "UPDATE exercicio SET exe_desc='@2', exe_area='@3'"+
     " WHERE exe_id = '@1'";
     sql = sql.Replace("@1", exe.Id);
     sql = sql.Replace("@2", exe.Desc);
     sql = sql.Replace("@3", exe.Area);
     bco.conecta();
     result = bco.executeNonQuery(sql);
     bco.desconecta();
     return result;
 }
Esempio n. 4
0
 public Exercicio getById(String id)
 {
     Exercicio exe = new Exercicio();
     sql = "SELECT * FROM exercicio WHERE exe_id = @1";
     sql = sql.Replace("@1", id);
     bco.conecta();
     bco.executeQuery(sql, out dt);
     bco.desconecta();
     exe.Id = id;
     exe.Desc = dt.Rows[0]["exe_desc"].ToString();
     exe.Area = dt.Rows[0]["exe_area"].ToString();
     return exe;
 }
Esempio n. 5
0
 public bool novo(Exercicio exe)
 {
     sql = "INSERT INTO exercicio(exe_desc, exe_area) "+
     "VALUES ('@1', '@2')";
     sql = sql.Replace("@1", exe.Desc);
     sql = sql.Replace("@2", exe.Area);
     bco.conecta();
     result = bco.executeNonQuery(sql);
     bco.desconecta();
     return result;
 }