Esempio n. 1
0
 public void Delete(Model.Tables tables)
 {
     //
     // todo:add other logic here
     //
     accessor.Delete(tables.TablesID);
 }
Esempio n. 2
0
 public bool Checkwfbytablescode(string tablecode)
 {
     Model.Tables tables = GetTablesbycode(tablecode);
     if (tables == null)
     {
         return(false);
     }
     return(workflowm.getWfbytable(tables.TablesID) != null ? true : false);
 }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
        /// <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);
        }
Esempio n. 5
0
 /// <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);
 }
Esempio n. 6
0
 /// <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);
 }
Esempio n. 7
0
        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();
        }
Esempio n. 8
0
 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 = "表單出錯";
     }
 }
Esempio n. 9
0
        /// <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);
        }
Esempio n. 10
0
        ///// <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);
        }
Esempio n. 11
0
 public EditForm(Book.Model.Tables tm, string action)
     : this()
 {
     this.tablem = tm;
     this.action = action;
 }
Esempio n. 12
0
 public bool HasRowsBefore(Model.Tables e)
 {
     return(accessor.HasRowsBefore(e));
 }
Esempio n. 13
0
 public bool HasRowsAfter(Model.Tables e)
 {
     return(accessor.HasRowsAfter(e));
 }
Esempio n. 14
0
 protected override void AddNew()
 {
     this.tablem = new Book.Model.Tables();
 }
Esempio n. 15
0
 public Model.Tables GetPrev(Model.Tables e)
 {
     return(accessor.GetPrev(e));
 }
Esempio n. 16
0
 public EditForm(Book.Model.Tables tm)
     : this()
 {
     this.tablem = tm;
     this.action = "update";
 }
Esempio n. 17
0
 public Model.Tables GetNext(Model.Tables e)
 {
     return(accessor.GetNext(e));
 }