private void objToList(DbObj obj) { long linx = ((ListView)(lstCtl)).Items.Count; if (((ListView)(lstCtl)).SelectedIndices.Count > 0) { linx = ((ListView)(lstCtl)).SelectedIndices[0]; } else { ((ListView)(lstCtl)).Items.Add(""); } ListViewItem item = ((ListView)(lstCtl)).Items[(int)linx]; item.SubItems[0].Text = "" + obj["nm"]; if (item.SubItems.Count > 1) { item.SubItems[1].Text = "" + obj["seq"]; } else { item.SubItems.Add("" + obj["seq"]); } if (item.SubItems.Count > 2) { item.SubItems[2].Text = "" + obj["rpt"]; } else { item.SubItems.Add("" + obj["rpt"]); } }
//private Pile<DbObject> rows = new Pile<DbObject>(); private DbObj clone(Pile <Reach> row) { DbObj ret = Clone(); ret.isInDb = true; ret.initializing = true; for (int i = 1; i <= row.Len; i++) { Type typ = ret[i].GetType(); if (typ == typeof(Reach)) { ret[i] = row[i]; continue; } if (typ == typeof(string)) { ret[i] = row[i].text; continue; } if (typ == typeof(long)) { ret[i] = long.Parse(row[i]); continue; } if (typ == typeof(double)) { ret[i] = double.Parse(row[i]); continue; } throw new Exception("Unknown Data Type in DbObj.clone()"); } ret.initializing = false; return(ret); }
public DatEdit(Control lstCtl, KeyPile <string, Control> dtlCtl, DbObj tplRec) { this.tplRec = tplRec; this.lstCtl = lstCtl; this.dtlCtl = dtlCtl; foreach (Control ctl in dtlCtl) { ((TextBox)(ctl)).TextChanged += dtlCtl_TextChanged; } ((ListView)(lstCtl)).SelectedIndexChanged += new System.EventHandler(lstCtl_SelectedIndexChanged); reloadList(); }
public DbObj delete(params DbCnd[] cnd) { initializing = true; DbObj ret = Clone(); DbDel d = bscTbl.sR(cnd).DEL; db.exec(d); ret.reload(); initializing = false; isDirty = false; return(ret); }
public DbObj readVrb(long top, bool distinct, string order, params DbCnd[] cnd) { initializing = true; DbObj ret = Clone(); DbSlc s = vrbTbl.sR(cnd).SLC; if (top > -1) { s = s.TOP(top); } if (distinct) { s = s.DST; } if (order.Trim().Length > 0) { s = s.ORD(order); } ret.loadRecsSlc = s; ret.reload(); initializing = false; isDirty = false; return(ret); }