public List<XuyangEntity> XYCRUDRetrieve(XuyangEntity entityR, XuyangSchoolbag bag)
 {
     MessageBox.Show("查询成功。");
     entityR = entityR as HelloEntity;
     List<XuyangEntity> entities = new List<XuyangEntity>() { entityR };
     return entities;
 }
        /// <summary>
        /// 删除实体对象
        /// </summary>
        /// <param name="entityD">实体对象</param>
        /// <param name="bag">背包信息</param>
        /// <returns>实体对象</returns>
        public XuyangEntity Delete(XuyangEntity entityD, XuyangSchoolbag bag)
        {
            try
            {
                if (this.status != XuyangStatus.Normal)
                {
                    bool ignore = this.NotifyUserNotNormal(entityD, bag);
                    if (!ignore) return null;
                }

                xYCRUD.XYCRUDDelete(entityD, bag);

                this.status = XuyangStatus.Normal;
                this.SetFormLock(true);
                return entityD;
            }
            catch (Exception ex)
            {
                throw new Exception("XuyangCommand异常", ex);
            }
        }
        /// <summary>
        /// 保存新建的实体对象
        /// </summary>
        /// <param name="entityC">实体对象</param>
        /// <param name="bag">背包信息</param>
        /// <returns>实体对象</returns>
        public XuyangEntity Create(XuyangEntity entityC, XuyangSchoolbag bag)
        {
            try
            {
                if (this.status != XuyangStatus.Creating)
                {
                    bool ignore = this.NotifyUserNotCreating(entityC, bag);
                    if (!ignore) return null;
                }

                if (!this.XYRequiredFullfilled()) return null;

                XuyangEntity entityCreated = xYCRUD.XYCRUDCreate(entityC, bag);

                this.status = XuyangStatus.Normal;
                this.SetFormLock(true);
                return entityCreated;
            }
            catch (Exception ex)
            {
                throw new Exception("XuyangCommand异常", ex);
            }
        }
 /// <summary>
 /// 设置可编辑窗体控件列表选定列
 /// </summary>
 /// <param name="entity">实体对象</param>
 public virtual void XYSetCurrentRow(XuyangEntity entity)
 {
 }
 public XuyangEntity XYCRUDUpdate(XuyangEntity entityU, XuyangSchoolbag bag)
 {
     MessageBox.Show("更新成功。");
     return new HelloEntity();
 }
 public XuyangEntity XYCRUDDelete(XuyangEntity entityD, XuyangSchoolbag bag)
 {
     MessageBox.Show("删除成功。");
     return entityD;
 }
 public XuyangEntity XYCRUDCreate(XuyangEntity entityC, XuyangSchoolbag bag)
 {
     MessageBox.Show("新建成功。");
     return new HelloEntity();
 }
 private void SetFormCurrentRow(XuyangEntity entity)
 {
     try
     {
         xYForm.XYSetCurrentRow(entity);
     }
     catch (Exception ex)
     {
         throw new Exception("XuyangCommand异常", ex);
     }
 }
 /// <summary>
 /// 通知用户此窗台未处于[普通/待查询/待删除]状态
 /// </summary>
 /// <param name="entityR">查询条件</param>
 /// <param name="bag">背包信息</param>
 /// <returns>忽略</returns>
 protected abstract bool NotifyUserNotNormal(XuyangEntity entityR, XuyangSchoolbag bag);
 /// <summary>
 /// 通知用户此窗体未处于[编辑中/待更新]状态
 /// </summary>
 /// <param name="entityU">待更新的实体对象</param>
 /// <param name="bag">背包信息</param>
 /// <returns>忽略</returns>
 protected abstract bool NotifyUserNotEditing(XuyangEntity entityU, XuyangSchoolbag bag);
 /// <summary>
 /// 通知用户此窗体未处于[创建中/保存前]状态
 /// </summary>
 /// <param name="entityC">待保存的实体对象</param>
 /// <param name="bag">背包信息</param>
 /// <returns>忽略</returns>
 protected abstract bool NotifyUserNotCreating(XuyangEntity entityC, XuyangSchoolbag bag);
        /// <summary>
        /// 获取实体对象列表
        /// </summary>
        /// <param name="entityR">查询条件</param>
        /// <param name="bag">背包信息</param>
        /// <returns>实体对象列表</returns>
        public List<XuyangEntity> Retrieve(XuyangEntity entityR, XuyangSchoolbag bag)
        {
            try
            {
                if (this.status != XuyangStatus.Normal)
                {
                    bool ignore = this.NotifyUserNotNormal(entityR, bag);
                    if (!ignore) return null;
                }

                List<XuyangEntity> entities = xYCRUD.XYCRUDRetrieve(entityR, bag);

                this.status = XuyangStatus.Normal;
                this.SetFormLock(true);
                return entities;
            }
            catch (Exception ex)
            {
                throw new Exception("XuyangCommand异常", ex);
            }
        }