Пример #1
0
 private void listOfTablesDoubleClick(object sender, EventArgs e)
 {
     ListItem item = listOfTables.SelectedItem as ListItem;
       if (item == null) return;
       pcTable = pcTables[item.Index];
       tableNameStripLabel.Text = item.Values[0];
       tableDescrStripLabel.Text = item.Descr[0];
       showTableGrid();
 }
Пример #2
0
 private bool validateAuditPython(TPCTable table, EHow how, List<EntryItem> edits, string oldUsId, string newUsId, string oldTmStamp, string newTmStamp)
 {
     string oldValues = "[";
       string newValues = "[";
       string fieldNames = "[";
       string comma = "";
       foreach (EntryItem plus in edits)
       {
     fieldNames += string.Format("{0}'{1}'", comma, plus.label.Text);
     if (how != EHow.ADD)
       oldValues += string.Format("{0}'{1}'", comma, plus.oldValue);
     if (how != EHow.DELETE)
       newValues += string.Format("{0}'{1}'", comma, plus.Value);
     comma = ", ";
       }
       fieldNames += ", 'UsId', 'TmStamp']";
       if (how != EHow.ADD)
     oldValues += string.Format(", '{0}', '{1}'", oldUsId, oldTmStamp);
       oldValues += "]";
       if (how != EHow.DELETE)
     newValues += string.Format(", '{0}', '{1}'", newUsId, newTmStamp);
       newValues += "]";
       string validate = string.Format("result = validate('{0}', {1}, {2}, {3}, {4})", table.name, (int)how, fieldNames, oldValues, newValues);
       if (runValidate(pcApplication.validateAll, validate) == false)
     return false;
       return true;
 }
Пример #3
0
 private bool isKey(TPCTable pcTable, int field)
 {
     int o = pcTable.offsetKeyFields;
       for (int i = 0; i < pcTable.noKeyFields; i++)
     if (pcKeyFields[o + i].index == field)
       return true;
       return false;
 }
Пример #4
0
 private bool setupLink(TPCTable pcTable, int fieldNo, out int rlink, out int rpair)
 {
     rlink = -1;
       rpair = -1;
       if (pcTable.noLinks == 0)
     return false;
       int offsetLink = pcTable.offsetLinks;
       for (int link = 0; link < pcTable.noLinks; link++)
       {
     int offsetPair = pcLinks[offsetLink + link].offsetLinkPairs;
     for (int pair = 0; pair < pcLinks[offsetLink + link].noLinkPairs; pair++)
     {
       if (pcLinkPairs[offsetPair + pair].fromNo == fieldNo)
       {
     rlink = offsetLink + link;
     rpair = pair;
     return true;
       }
     }
       }
       return false;
 }