public void Delete(Model.Tables tables) { // // todo:add other logic here // accessor.Delete(tables.TablesID); }
public bool Checkwfbytablescode(string tablecode) { Model.Tables tables = GetTablesbycode(tablecode); if (tables == null) { return(false); } return(workflowm.getWfbytable(tables.TablesID) != null ? true : false); }
public void MyClick(ref ChooseItem item) { ChooseTablesForm f = new ChooseTablesForm(); if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Model.Tables tables = f.SelectedItem as Model.Tables; item = new ChooseItem(tables, tables.Tablename, null); } }
/// <summary> /// 根据tablecode查寻 wflow /// </summary> /// <param name="tablecode"></param> /// <returns></returns> public Model.Workflow GetWorkflowbytablecode(string tablecode) { Model.Workflow wf = null; Model.Tables tables = GetTablesbycode(tablecode); if (tables != null) { wf = workflowm.getWfbytable(tables.TablesID); } return(wf); }
/// <summary> /// Update a Tables. /// </summary> public void Update(Model.Tables tables) { // // todo: add other logic here. // if (string.IsNullOrEmpty(tables.Tablename)) { throw new Helper.RequireValueException(Model.Tables.PRO_Tablename); } tables.UpdateTime = DateTime.Now; accessor.Update(tables); }
/// <summary> /// Insert a Tables. /// </summary> public void Insert(Model.Tables tables) { // // todo:add other logic here // if (string.IsNullOrEmpty(tables.Tablename)) { throw new Helper.RequireValueException(Model.Tables.PRO_Tablename); } tables.TablesID = Guid.NewGuid().ToString(); tables.InsertTime = DateTime.Now; accessor.Insert(tables); }
public override void Refresh() { #region MyRegion if (this.tablem == null) { this.tablem = new Book.Model.Tables(); this.action = "insert"; } this.textEditTableid.Text = this.tablem.TablesID; this.textEditTablename.Text = this.tablem.Tablename; this.comboBoxEdittable.SelectedText = this.tablem.TableCode; // this.memoEditTablebewrite.Text = this.tablem.Tabledescription; switch (this.action) { case "insert": this.textEditTableid.Properties.ReadOnly = false; this.textEditTablename.Properties.ReadOnly = false; this.comboBoxEdittable.Properties.ReadOnly = false; // this.memoEditTablebewrite.Properties.ReadOnly = false; break; case "update": this.textEditTableid.Properties.ReadOnly = false; this.textEditTablename.Properties.ReadOnly = false; this.comboBoxEdittable.Properties.ReadOnly = false; // this.memoEditTablebewrite.Properties.ReadOnly = false; break; case "view": this.textEditTableid.Properties.ReadOnly = true; this.textEditTablename.Properties.ReadOnly = true; this.comboBoxEdittable.Properties.ReadOnly = true; // this.memoEditTablebewrite.Properties.ReadOnly = true; break; default: break; // default: // break; } #endregion base.Refresh(); }
public void MyLeave(ref ChooseItem item) { BL.TablesManager manager = new Book.BL.TablesManager(); Model.Tables tables = manager.Get(obj.TablesID); if (tables != null) { item.EditValue = tables; item.LabelText = null; } else { item.ErrorMessage = "表單出錯"; } }
/// <summary> /// 根据名称获取表单 /// </summary> /// <param name="name"></param> /// <returns></returns> public Model.Tables getTablebyname(string name) { Model.Tables tables = null; foreach (Model.Tables tab in tablelist) { if (tab.Tablename == name) { tables = tab; } } return(tables); }
///// <summary> ///// 判断该表单是否可以被使用 ///// </summary> ///// <returns></returns> //private bool Checktableuser() //{ // bool checkresult = false; // Model.Workflow wflow = null; // try // { // wflow = workflowm.getWfbytable(workflow.TablesID); // } // catch { wflow = null; } // if (wflow != null) { checkresult = true; } // return checkresult; //} /// <summary> /// 判讀該表單是否存在 /// </summary> /// <param name="name"></param> /// <returns></returns> private bool checektable(string name) { Model.Tables tables = null; bool checkresult = true; try { tables = this.getTablebyname(name); if (tables == null) { checkresult = false; } } catch { checkresult = false; } return(checkresult); }
public EditForm(Book.Model.Tables tm, string action) : this() { this.tablem = tm; this.action = action; }
public bool HasRowsBefore(Model.Tables e) { return(accessor.HasRowsBefore(e)); }
public bool HasRowsAfter(Model.Tables e) { return(accessor.HasRowsAfter(e)); }
protected override void AddNew() { this.tablem = new Book.Model.Tables(); }
public Model.Tables GetPrev(Model.Tables e) { return(accessor.GetPrev(e)); }
public EditForm(Book.Model.Tables tm) : this() { this.tablem = tm; this.action = "update"; }
public Model.Tables GetNext(Model.Tables e) { return(accessor.GetNext(e)); }