public void Retrieve(params string[] arguments) { IFreeForm dw = (IFreeForm)Assembly.Load("BaseData").CreateInstance("Redsoft." + dataObject); IList <NameValue> args = dw.GetArguments(); string sql = ""; //参数替换 int i = 0; foreach (string s in arguments) { if (args[i].Value == "number") { sql = dw.Sql.Replace(":" + args[i].Name, s); } else { sql = dw.Sql.Replace(":" + args[i].Name, "'" + s + "'"); } i++; } MAction action = new MAction(sql, global.g5_sys.connStr); DataTable dt = action.Select().ToDataTable(); this.Controls.Add(dw.GetPanel); Common.SetUIValue(dt, this.Controls[0]); foreach (Control c in this.Controls[0].Controls) { c.TextChanged += new EventHandler(c_TextChanged); } this.rowState = RowStatus.Edit; }
public void InsertRow() { IFreeForm dw = (IFreeForm)Assembly.Load("BaseData").CreateInstance("Redsoft." + dataObject); if (this.Controls.Count == 0) { this.Controls.Add(dw.GetPanel); foreach (Control c in this.Controls[0].Controls) { c.TextChanged += new EventHandler(c_TextChanged); } } for (int i = 0; i < this.Controls[0].Controls.Count; i++) { string controlName = this.Controls[0].Controls[i].Name; IMyControl mycontrol = this.Controls[0].Controls[i] as IMyControl; if (mycontrol != null) { mycontrol.OldText = ""; mycontrol.SetText(""); //设置一些默认字段 if (controlName == "collrsj") { mycontrol.SetText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); } } } rowState = RowStatus.Add; }
public void Retrieve(MDataTable dt) { IFreeForm dw = (IFreeForm)Assembly.Load("BaseData").CreateInstance("Redsoft." + dataObject); this.Controls.Add(dw.GetPanel); Common.SetUIValue(dt, this.Controls[0]); foreach (Control c in this.Controls[0].Controls) { c.TextChanged += new EventHandler(c_TextChanged); } this.rowState = RowStatus.Edit; }