예제 #1
0
        public WCFAddUpdateResult AddOrUpdate(Sys_FormRightResult param)
        {
            this.CheckSession();
            int affect             = 0;
            WCFAddUpdateResult ret = new WCFAddUpdateResult();

            try
            {
                #region 判断
                if (param.FormEngName.ToStringHasNull().Trim() == "")
                {
                    throw new WarnException("请指定窗体英文名!");
                }
                //if (param.UserControlEngName.ToStringHasNull().Trim() == "") throw new WarnException("请指定用户控件英文名!");
                if (param.OprControlEngName.ToStringHasNull().Trim() == "")
                {
                    throw new WarnException("请指定操作控件英文名!");
                }
                if (param.ActionCode.ToStringHasNull().Trim() == "")
                {
                    throw new WarnException("请指定对应权限!");
                }
                if (param.FormRightID > 0)
                {
                    WhereClip where = Sys_FormRightResult._.FormRightID == param.FormRightID;
                    affect          = this.Update <Sys_FormRightResult>(param, where);
                    ret.Key         = param.FormRightID;
                }
                else
                {
                    Sys_FormRightBLL formrightbll = new Sys_FormRightBLL();
                    formrightbll.SessionInfo = this.SessionInfo;
                    param.IsDeleted          = false;
                    affect  = this.Insert <Sys_FormRightResult>(param);
                    ret.Key = this.Select <Sys_FormRightResult>(Sys_FormRight._.NameSpace == param.NameSpace && Sys_FormRight._.OprControlEngName == param.OprControlEngName && Sys_FormRight._.IsDeleted == false).FormRightID;
                }
                #endregion
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
            }

            return(ret);
        }
예제 #2
0
        public FormLoadResult GetFormLoadResult(FormLoadParam param)
        {
            FormLoadResult   ret     = new FormLoadResult();
            Sys_FormRightBLL formBll = new Sys_FormRightBLL();

            formBll.SessionInfo = this.SessionInfo;
            List <Sys_FormRightResult> formRightList = new List <Sys_FormRightResult>();

            formRightList = formBll.GetEmpWindowRight(new Sys_FormRightParam()
            {
                NameSpace = param.NameSpace, FormEngName = param.FormName
            });
            ret.FormRightList = formRightList;
            return(ret);
        }