Пример #1
0
        /// <summary>
        /// 根据条件,获取请假类型设置信息
        /// </summary>
        /// <param name="strOwnerID">登录人的员工ID</param>
        /// <param name="strLeaveTypeValue">假期类别</param>
        /// <param name="strSortKey">排序字段</param>
        /// <returns></returns>
        public IQueryable <T_HR_LEAVETYPESET> GetAllLeaveTypeSetRdListByMultSearch(string strOwnerID, string strLeaveTypeValue, string strSortKey)
        {
            LeaveTypeSetDAL dalLeaveTypeSet = new LeaveTypeSetDAL();

            StringBuilder strfilter  = new StringBuilder();
            List <object> objArgs    = new List <object>();
            string        strOrderBy = string.Empty;
            int           iIndex     = 0;

            if (!string.IsNullOrEmpty(strLeaveTypeValue))
            {
                strfilter.Append(" LEAVETYPEVALUE == @0 ");
                objArgs.Add(strLeaveTypeValue);
            }

            if (!string.IsNullOrEmpty(strSortKey))
            {
                strOrderBy = strSortKey;
            }
            else
            {
                strOrderBy = " LEAVETYPESETID ";
            }

            string filterString = strfilter.ToString();

            SetOrganizationFilter(ref filterString, ref objArgs, strOwnerID, "T_HR_LEAVETYPESET");

            var q = dalLeaveTypeSet.GetLeaveTypeSetRdListByMultSearch(strOrderBy, filterString, objArgs.ToArray());

            return(q);
        }
Пример #2
0
        public EntityObject[] GetLookupData(int pageIndex, int pageSize, string sort, string filterString, IList <object> paras, ref int pageCount, string userID)
        {
            LeaveTypeSetDAL dalLeaveTypeSet = new LeaveTypeSetDAL();

            List <object> queryParas = new List <object>();
            string        strOrderBy = string.Empty;

            if (paras.Count() > 0)
            {
                for (int i = 0; i < paras.Count(); i++)
                {
                    queryParas.Add(paras[i]);
                }
            }

            strOrderBy = " LEAVETYPESETID ";

            //受权限限制,假如权限不够则查询条件filterString可能为空,则要判断
            if (string.IsNullOrWhiteSpace(filterString))
            {
                filterString = string.Empty;
            }
            SetOrganizationFilter(ref filterString, ref queryParas, userID, "T_HR_LEAVETYPESET");

            IQueryable <T_HR_LEAVETYPESET> ents = dalLeaveTypeSet.GetLeaveTypeSetRdListByMultSearch(strOrderBy, filterString, queryParas.ToArray());

            return(ents.Count() > 0 ? ents.ToArray() : null);
        }
Пример #3
0
        public EntityObject[] GetLookupData(int pageIndex, int pageSize, string sort, string filterString, IList <object> paras, ref int pageCount, string userID)
        {
            LeaveTypeSetDAL dalLeaveTypeSet = new LeaveTypeSetDAL();

            List <object> queryParas    = new List <object>();
            string        strOrderBy    = string.Empty;
            string        strEmployeeID = string.Empty;

            #region 是否是从请假处传来数据
            //只有从请假申请中才传来leaverecordemployeeid
            if (filterString != null)
            {
                if (filterString.IndexOf("leaverecordemployeeid") > 0)
                {
                    strEmployeeID = paras[0].ToString();
                    filterString  = string.Empty;
                    //清空记录
                    //paras.RemoveAt(0);
                }
                else
                {
                    if (paras.Count() > 0)
                    {
                        for (int i = 0; i < paras.Count(); i++)
                        {
                            queryParas.Add(paras[i]);
                        }
                    }
                }
            }
            else
            {
                if (paras.Count() > 0)
                {
                    for (int i = 0; i < paras.Count(); i++)
                    {
                        queryParas.Add(paras[i]);
                    }
                }
            }
            #endregion



            strOrderBy = " LEAVETYPESETID ";

            //受权限限制,假如权限不够则查询条件filterString可能为空,则要判断
            if (string.IsNullOrWhiteSpace(filterString))
            {
                filterString = string.Empty;
            }
            SetOrganizationFilter(ref filterString, ref queryParas, userID, "T_HR_LEAVETYPESET");
            IQueryable <T_HR_LEAVETYPESET> ents = null;
            if (string.IsNullOrEmpty(strEmployeeID))
            {
                ents = dalLeaveTypeSet.GetLeaveTypeSetRdListByMultSearch(strOrderBy, filterString, queryParas.ToArray());
            }
            else
            {
                ents = GetLeaveTypeSetRdListByEmployeeID(strOrderBy, filterString, strEmployeeID, queryParas.ToArray());
            }
            if (ents == null)
            {
                return(null);
            }
            return(ents.Count() > 0 ? ents.ToArray() : null);
        }