//用编辑框数据填充实体 /// <summary> /// 用编辑框数据填充实体 /// </summary> private void BuildEntity() { if (CurrentOperationStatus == OperationStatus.New) { EditEntity = new RightUser { Sysid = Sysid.NewId(""), UserPwd = CryptoHelper.ToMd5("123456"), CreatedBy = GloableData.Instance.UserId }; } else if (CurrentOperationStatus == OperationStatus.Edit) { if (UI.GetValue(chkIsChangePassword) == "1") { EditEntity.UserPwd = CryptoHelper.ToMd5("123456"); } } EditEntity.ModifiedBy = GloableData.Instance.UserId; EditEntity.Department = UI.GetValue(ddlDepName); EditEntity.UserId = UI.GetUpperValue(txtUserId); EditEntity.UserName = UI.GetValue(txtUserName); EditEntity.Email = UI.GetValue(txtEmail); EditEntity.RecordStatus = UI.GetValue(chkIsEnable); }
//新增数据 /// <summary> /// 新增数据 /// </summary> /// <returns></returns> internal override bool Add() { EditEntity = null; pageViewMain.SelectedPage = pageEdit; UI.ClearUi(pageEdit); UI.ReadOnlyUi(pageEdit, false); return(true); }
//删除数据 /// <summary> /// 删除数据 /// </summary> /// <returns></returns> internal override bool Delete() { if (EditEntity == null) { UI.ShowWarn("请选择待删除数据"); return(false); } if (!UI.Confirm("确定要删除吗?")) { return(false); } if (!RightUserBll.DeleteRightUser(EditEntity)) { UI.ShowError("删除失败"); return(false); } EditEntity = null; UI.ClearUi(pageEdit); return(true); }