Beispiel #1
0
 /// <summary>
 /// 使用自定义的方法处理控件集合中每一个智能窗体数据控件,使用户不必额外遍历控件集合。
 /// </summary>
 /// <param name="controls">窗体容器控件的控件集合</param>
 /// <param name="useMethod">自定义的方法</param>
 public static void DoDataControls(System.Windows.Forms.Form.ControlCollection controls, UseDataControl useMethod)
 {
     foreach (IDataControl item in GetIBControls(controls))
     {
         useMethod(item);
     }
 }
Beispiel #2
0
        /// <summary>
        /// 获取选择和删除查询的SQL语句
        /// </summary>
        /// <param name="Controls">要收集的控件集合</param>
        /// <returns> ArrayList 中的成员为 IBCommand 对象,包含具体的CRUD SQL</returns>
        public static List <IBCommand> GetSelectAndDeleteCommand(System.Windows.Forms.Form.ControlCollection Controls)
        {
            List <IDataControl> IBControls = new List <IDataControl>();

            findIBControls(IBControls, Controls);
            return(GetSelectAndDeleteCommand(IBControls));
        }
Beispiel #3
0
        /// <summary>
        /// 自动删除智能窗体控件的持久化数据
        /// </summary>
        /// <param name="Controls">要处理的窗体控件集和</param>
        /// <returns>操作受影响的记录行数</returns>
        public int AutoDeleteIBForm(System.Windows.Forms.Form.ControlCollection Controls)
        {
            List <IDataControl> IBControls = new List <IDataControl>();

            findIBControls(IBControls, Controls);

            return(AutoDeleteIBFormInner(IBControls));
        }
Beispiel #4
0
        /// <summary>
        /// 从实体类填充数据到页面控件
        /// </summary>
        /// <param name="Controls"></param>
        /// <param name="entity"></param>
        public void AutoSelectIBForm(System.Windows.Forms.Form.ControlCollection Controls, IEntity entity)
        {
            List <IDataControl> IBControls = new List <IDataControl>();

            findIBControls(IBControls, Controls);

            AutoSelectIBFormInner(IBControls, entity);
        }
Beispiel #5
0
        /// <summary>
        /// 从数据集DataSet填充数据到数据控件上面,DataSet中的表名称必须和数据控件的LinkObject匹配(不区分大小写)
        /// </summary>
        /// <param name="Controls">要填充的窗体控件集和</param>
        /// <param name="dsSource">提供属于源的数据集</param>
        public void AutoSelectIBForm(System.Windows.Forms.Form.ControlCollection Controls, DataSet dsSource)
        {
            List <IDataControl> IBControls = new List <IDataControl>();

            findIBControls(IBControls, Controls);

            AutoSelectIBFormInner(IBControls, dsSource);
        }
Beispiel #6
0
        /// <summary>
        /// 清除窗体上的智能控件的值
        /// </summary>
        /// <param name="Controls">窗体控件集和</param>
        public static void ClearIBData(System.Windows.Forms.Form.ControlCollection Controls)
        {
            //使用匿名委托
            UseDataControl clearData = delegate(IDataControl dataControl)
            {
                dataControl.SetValue("");
            };

            DoDataControls(Controls, clearData);
        }