public void Delete(ChronopicRegisterPort crp) { //Delete from SQL SqliteChronopicRegister.Delete(false, crp); //Delete from list L.Remove(crp); }
public void Add(ChronopicRegisterPort crp) { //Add to SQL SqliteChronopicRegister.Insert(false, crp); //Add to list L.Add(crp); }
public void UpdateType(ChronopicRegisterPort crp, ChronopicRegisterPort.Types newType) { //Update SQL SqliteChronopicRegister.Update(false, crp, newType); //Update list foreach (ChronopicRegisterPort c in L) { if (c.SerialNumber == crp.SerialNumber) { c.Type = newType; break; } } }
private void encoderToggled(object sender, Gtk.ToggledArgs args) { Gtk.TreeIter iter; listStoreAll.GetIter(out iter, new Gtk.TreePath(args.Path)); ChronopicRegisterWindowTypes crwt = (ChronopicRegisterWindowTypes)listStoreAll.GetValue(iter, 0); if (!crwt.Encoder) { crwt.Unknown = false; crwt.Contacts = false; crwt.Encoder = true; } //store on SQL SqliteChronopicRegister.Update(false, new ChronopicRegisterPort(crwt.SerialNumber, ChronopicRegisterPort.Types.ENCODER), ChronopicRegisterPort.Types.ENCODER); }
private void updateSQL(string serialNumber, ChronopicRegisterPort.Types type) { //store on SQL SqliteChronopicRegister.Update(false, new ChronopicRegisterPort(serialNumber, type), type); }
//constructor public ChronopicRegisterPortList() { this.L = SqliteChronopicRegister.SelectAll(false); }