Ejemplo n.º 1
0
        /// <summary>
        /// 获取条件的公共方法
        /// </summary>
        /// <param name="param">条件实体</param>
        /// <returns></returns>
        WhereClip GetWhereClip(CRM_JobMastParam param)
        {
            this.CheckSession();
            WhereClip where = CRM_JobMast._.IsDeleted == 0;
            if (param.EmpJobGuid != null)
            {
                where = where && CRM_JobMast._.EmpJobGuid == param.EmpJobGuid;
            }
            if (!string.IsNullOrEmpty(param.JobName))
            {
                where = where && CRM_JobMast._.JobName.Like("%" + param.JobName + "%");
            }
            if (!string.IsNullOrEmpty(param.JobType))
            {
                where = where && CRM_JobMast._.JobType == param.JobType;
            }
            if (param.JobDateS != null)
            {
                where = where && CRM_JobMast._.JobDate >= param.JobDateS;
            }
            if (param.JobDateE != null)
            {
                where = where && CRM_JobMast._.JobDate < param.JobDateE.Value.AddDays(1);
            }

            where = Sys_EmpDataRightBLL.GetEmpIDInWhere(where, CRM_JobMast._.JobDate, CRM_JobMast._.BeLongEmpID, CRM_JobMast._.OrgID, CRM_JobMast._.DeptID, this.SessionInfo);
            return(where);
        }
Ejemplo n.º 2
0
        public PageList <CRM_JobMastResult> GetPageList(CRM_JobMastParam param)
        {
            ExeResult rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.HR.CRM_JobMastBLL", "GetPageList", param);
            PageList <CRM_JobMastResult> pageList = new PageList <CRM_JobMastResult>();

            pageList = (rst == null ? new PageList <CRM_JobMastResult>() : rst.Result as PageList <CRM_JobMastResult>);
            return(pageList);
        }
Ejemplo n.º 3
0
        void BindData(int pageIndex)
        {
            CRM_JobMastLogic logic = new CRM_JobMastLogic(this);
            CRM_JobMastParam param = new CRM_JobMastParam();

            param           = this.ConvertControlToEntity <CRM_JobMastParam>(this.panTop.Controls, param, null);
            param.PageIndex = pageIndex;
            param.PageSize  = this.pagMain.PageSize;
            param.IsPage    = true;
            PageList <CRM_JobMastResult> pageList = this.AsyncExecute <PageList <CRM_JobMastResult>, CRM_JobMastParam>(param, logic.GetPageList, BindDataComplete);
        }
Ejemplo n.º 4
0
        public CRM_JobMastResult GetInfo(CRM_JobMastParam param)
        {
            CRM_JobMastResult ret = new CRM_JobMastResult();
            ExeResult         rst = new ExeResult();

            if (param.EmpJobGuid == null)
            {
                this.ShowMessage("请指定要修改的记录!");
                return(ret);
            }
            rst = this.Execute("ZNLCRM.BLL.HR.CRM_JobMastBLL", "GetInfo", param);
            ret = rst == null ? new CRM_JobMastResult() : rst.Result as CRM_JobMastResult;
            return(ret);
        }
Ejemplo n.º 5
0
        public WCFAddUpdateResult DelInfo(CRM_JobMastParam param)
        {
            WCFAddUpdateResult ret = new WCFAddUpdateResult();

            if (param.EmpJobGuid == null)
            {
                this.ShowMessage("请指定要修改的记录!");
                return(ret);
            }
            ExeResult rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.HR.CRM_JobMastBLL", "DelInfo", param);
            ret = (rst == null?new WCFAddUpdateResult():rst.Result as WCFAddUpdateResult);
            return(ret);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 查询记录,并返回分页列表
        /// </summary>
        /// <param name="param">查询条件实体</param>
        /// <returns></returns>
        public PageList <CRM_JobMastResult> GetPageList(CRM_JobMastParam param)
        {
            this.CheckSession();
            PageList <CRM_JobMastResult> rst = new PageList <CRM_JobMastResult>();

            WhereClip where = GetWhereClip(param);
            List <Field> lstField = new List <Field>()
            {
                CRM_JobMast._.EmpJobGuid, CRM_JobMast._.JobName, CRM_JobMast._.JobDate
                , CRM_JobMast._.BillNo, CRM_JobMast._.BelongEmpName, CRM_JobMast._.ApproveStatus
                , CRM_JobMast._.JobType, CRM_JobMast._.BeLongEmpID, CRM_JobMast._.OrgID
                , CRM_JobMast._.Summary, CRM_JobMast._.CreatedEmpName, CRM_JobMast._.CreatedTime
            };

            rst            = this.SelectList <CRM_JobMastResult>(param.PageIndex.GetValueOrDefault(1), param.PageSize.GetValueOrDefault(20), lstField, where, CRM_JobMast._.CreatedTime.Desc);
            rst.ResultList = Sys_EmpDataRightBLL.SetRecIsEdit <CRM_JobMastResult>(rst.ResultList, "BeLongEmpID", "", "OrgID", this.SessionInfo);
            return(rst);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 获取上一条或下一条记录
        /// </summary>
        /// <param name="param">条件实体</param>
        /// <returns></returns>
        public CRM_JobMastResult GetNextOrPreInfo(CRM_JobMastParam param)
        {
            this.CheckSession();
            CRM_JobMastResult rst = new CRM_JobMastResult();

            #region 判断
            if (param.EmpJobGuid == null)
            {
                throw new WarnException("请指定关键字GUID!");
            }
            #endregion
            #region 保存实体
            WhereClip where = CRM_JobMast._.EmpJobGuid == param.EmpJobGuid;
            where           = Sys_EmpDataRightBLL.GetEmpIDInWhere(where, CRM_JobMast._.JobDate, CRM_JobMast._.BeLongEmpID, CRM_JobMast._.OrgID, CRM_JobMast._.DeptID, this.SessionInfo);
            rst             = this.Select <CRM_JobMastResult>(where);
            #endregion
            return(rst);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 删除实体
        /// </summary>
        /// <param name="param">删除条件实体</param>
        /// <returns></returns>
        public WCFAddUpdateResult DelInfo(CRM_JobMastParam param)
        {
            this.CheckSession();
            WCFAddUpdateResult ret = new WCFAddUpdateResult();
            int affect             = 0;

            try
            {
                #region 判断
                if (param.EmpJobGuid == null)
                {
                    throw new WarnException("请指定要删除的记录!");
                }
                #endregion
                WhereClip where = GetWhereClip(param);
                CRM_JobMastResult oldInfo = this.GetInfo(param);
                oldInfo = Sys_EmpDataRightBLL.SetRecIsEdit <CRM_JobMastResult>(oldInfo, "BeLongEmpID", "", "OrgID", this.SessionInfo);
                if (oldInfo.RecStatu != 2)
                {
                    throw new WarnException("您无权删除当前记录!");
                }
                CRM_JobMastResult info = new CRM_JobMastResult();
                info.IsDeleted    = true;
                info.UpdatedTime  = DateTime.Now;
                info.UpdatedEmpID = this.SessionInfo.UserID;
                affect            = this.Update <CRM_JobMastResult>(info, where);
                #region 设置返回值
                ret.Key = affect;
                #endregion
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }