Esempio n. 1
0
        //保存数据
        /// <summary>
        /// 保存数据
        /// </summary>
        /// <returns></returns>
        internal override bool Save()
        {
            if (!ValidateEditForm())
            {
                return(false);
            }

            string msg;

            BuildEntity();

            var result = CurrentOperationStatus == OperationStatus.New
                             ? RightUserGroupBll.InsertRightUserGroup(EditEntity, out msg)
                             : RightUserGroupBll.UpdateRightUserGroup(EditEntity, out msg);

            UI.ShowInfo(msg);

            if (result)
            {
                UI.ReadOnlyUi(pageEditData, true);
                SetSelectedEntity();
            }

            return(result);
        }
Esempio n. 2
0
        private void BindingUserGroup()
        {
            List <RightUserGroup> list;

            if (ReferenceDropDownList != null)
            {
                list = Mapper.Map <List <RightUserGroup>, List <RightUserGroup> >
                           ((List <RightUserGroup>)ReferenceDropDownList.DataSource);
            }
            else
            {
                list = RightUserGroupBll.QueryAll();
            }

            if (ContainEmptyItem)
            {
                if (ReferenceDropDownList == null ||
                    (ReferenceDropDownList != null && !ReferenceDropDownList.ContainEmptyItem))
                {
                    list.Insert(0, new RightUserGroup {
                        GroupName = "", Sysid = ""
                    });
                }
            }

            UI.BindingDropDownList(this, list, "GroupName", "Sysid");
        }
Esempio n. 3
0
        //加载查询数据
        /// <summary>
        /// 加载查询数据
        /// </summary
        private void QueryData()
        {
            var condition = new QueryCondition
            {
                GroupName = UI.GetValue(txtViewGroupName)
            };
            var lstData = RightUserGroupBll.QueryRightUserGroup(condition);

            grdQueryResult.DataSource = lstData;
        }
Esempio n. 4
0
 //删除数据
 /// <summary>
 /// 删除数据
 /// </summary>
 /// <returns></returns>
 internal override bool Delete()
 {
     if (EditEntity == null)
     {
         UI.ShowWarn("请选择待删除数据");
         return(false);
     }
     if (!UI.Confirm("确定要删除吗?"))
     {
         return(false);
     }
     if (!RightUserGroupBll.DeleteRightUserGroup(EditEntity))
     {
         UI.ShowError("删除失败");
         return(false);
     }
     EditEntity = null;
     UI.ClearUi(pageEditData);
     return(true);
 }