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... "); } }
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 )); }
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... "); } }
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(); }
public CtrlMain() { KsManager.self().setPath("C:/Users/jose.rod/dev/demo.ms.net/desktop.crud.sqlite/resource/data/storage.db"); }