Exemplo n.º 1
0
    /*
     * Fetch
     */

    private void OnPerformQuerySuccess(string data)
    {
        string[] DataArray = data.Split(new string[] { SA.Common.Data.Converter.DATA_SPLITTER2 }, StringSplitOptions.None);

        int         dbId = System.Convert.ToInt32(DataArray[0]);
        CK_Database db   = CK_Database.GetDatabaseByInternalId(dbId);

        List <CK_Record> records = new List <CK_Record>();

        for (int i = 1; i < DataArray.Length; i += 2)
        {
            if (DataArray[i] == SA.Common.Data.Converter.DATA_EOF)
            {
                break;
            }

            string name       = DataArray[i];
            string recordData = DataArray[i + 1];

            CK_Record record = new CK_Record(name, recordData);
            records.Add(record);
        }

        CK_QueryResult result = new CK_QueryResult(records);

        db.FireQueryCompleteResult(result);
    }
Exemplo n.º 2
0
    /*
     * Delete
     */

    private void OnDeleteRecordSuccess(string data)
    {
        string[] values   = SA.Common.Data.Converter.ParseArray(data);
        int      dbId     = System.Convert.ToInt32(values[0]);
        int      recordId = System.Convert.ToInt32(values[1]);

        CK_Database db = CK_Database.GetDatabaseByInternalId(dbId);

        CK_RecordDeleteResult result = new CK_RecordDeleteResult(recordId);

        db.FireDeleteRecordResult(result);
    }
Exemplo n.º 3
0
    //--------------------------------------
    // Internal Events
    //--------------------------------------



    /*
     * Save
     */

    private void OnSaveRecordSuccess(string data)
    {
        string[] values   = IOSNative.ParseArray(data);
        int      dbId     = System.Convert.ToInt32(values[0]);
        int      recordId = System.Convert.ToInt32(values[1]);

        CK_Database db = CK_Database.GetDatabaseByInternalId(dbId);

        CK_RecordResult result = new CK_RecordResult(recordId);

        db.FireSaveRecordResult(result);
    }
Exemplo n.º 4
0
    private void OnFetchRecordSuccess(string data)
    {
        string[] DataArray  = data.Split(new string[] { SA.Common.Data.Converter.DATA_SPLITTER2 }, StringSplitOptions.None);
        int      dbId       = System.Convert.ToInt32(DataArray[0]);
        string   name       = DataArray[1];
        string   recordData = DataArray[2];

        CK_Database     db     = CK_Database.GetDatabaseByInternalId(dbId);
        CK_Record       record = new CK_Record(name, recordData);
        CK_RecordResult result = new CK_RecordResult(record.Internal_Id);

        db.FireFetchRecordResult(result);
    }
Exemplo n.º 5
0
    private void OnFetchRecordFailed(string data)
    {
        string[] DataArray = data.Split(new string[] { SA.Common.Data.Converter.DATA_SPLITTER2 }, StringSplitOptions.None);


        int         dbId = System.Convert.ToInt32(DataArray[0]);
        CK_Database db   = CK_Database.GetDatabaseByInternalId(dbId);


        string          errorData = DataArray[1];
        CK_RecordResult result    = new CK_RecordResult(errorData);

        db.FireFetchRecordResult(result);
    }