Exemplo n.º 1
0
 private void onLoad()
 {
     if (KsManager.self().connect())
     {
         this.viewmain.dgvmain.DataSource = KsManager.self().getAt("person");
         this.viewmain.dgvmain.Update();
         this.viewmain.dgvmain.Refresh();
     }
     else
     {
         Console.Write("SQLite connections error... ");
     }
 }
Exemplo n.º 2
0
        private void onSave()
        {
            int index = this.viewmain.dgvmain.CurrentRow.Index;

            KsManager.self().exec(string.Format(
                                      "UPDATE {6}  SET dni = '{0}', firstname = '{1}', lastname = '{2}', age = '{3}', user = '******' WHERE id = '{5}';",
                                      this.getCurrentPerson().dni,
                                      this.getCurrentPerson().firstname,
                                      this.getCurrentPerson().lastname,
                                      this.getCurrentPerson().age,
                                      this.getCurrentPerson().user,
                                      this.getCurrentPerson().id,
                                      this.getCurrentPerson().table
                                      ));
        }
Exemplo n.º 3
0
 private void onDel()
 {
     if (KsManager.self().connect())
     {
         KsManager.self().exec(string.Format(
                                   "DELETE FROM {0} WHERE id = '{1}';",
                                   this.getCurrentPerson().table,
                                   this.getCurrentPerson().id
                                   ));
         this.onLoad();
         this.viewadd.Hide();
     }
     else
     {
         Console.Write("SQLite connections error... ");
     }
 }
Exemplo n.º 4
0
 private void onAddOk(object sender, EventArgs e)
 {
     if (this.viewadd.action == "add")
     {
         if (KsManager.self().connect())
         {
             KsManager.self().exec(string.Format(
                                       "INSERT INTO person (dni, firstname, lastname, age, user) VALUES ({0},'{1}','{2}',{3},'{4}');",
                                       this.viewadd.tbDni.Text,
                                       this.viewadd.tbFirstname.Text,
                                       this.viewadd.tbLastname.Text,
                                       this.viewadd.tbAge.Text,
                                       this.viewadd.tbUser.Text
                                       ));
             this.onLoad();
         }
         else
         {
             Console.Write("SQLite connections error... ");
         }
     }
     this.viewadd.Hide();
 }
Exemplo n.º 5
0
 public CtrlMain()
 {
     KsManager.self().setPath("C:/Users/jose.rod/dev/demo.ms.net/desktop.crud.sqlite/resource/data/storage.db");
 }