Пример #1
0
    public void Delete(ChronopicRegisterPort crp)
    {
        //Delete from SQL
        SqliteChronopicRegister.Delete(false, crp);

        //Delete from list
        L.Remove(crp);
    }
Пример #2
0
    public void Add(ChronopicRegisterPort crp)
    {
        //Add to SQL
        SqliteChronopicRegister.Insert(false, crp);

        //Add to list
        L.Add(crp);
    }
Пример #3
0
    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;
            }
        }
    }
Пример #4
0
    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);
    }
Пример #5
0
 private void updateSQL(string serialNumber, ChronopicRegisterPort.Types type)
 {
     //store on SQL
     SqliteChronopicRegister.Update(false, new ChronopicRegisterPort(serialNumber, type), type);
 }
Пример #6
0
 //constructor
 public ChronopicRegisterPortList()
 {
     this.L = SqliteChronopicRegister.SelectAll(false);
 }