예제 #1
0
        public EntityObject[] GetLookupData(int pageIndex, int pageSize, string sort, string filterString, IList <object> paras, ref int pageCount, string userID)
        {
            AttendanceSolutionDAL dalAttendanceSolution = new AttendanceSolutionDAL();
            List <object>         queryParas            = new List <object>();

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

            SetOrganizationFilter(ref filterString, ref queryParas, userID, "T_HR_ATTENDANCESOLUTION");

            string strOrderBy = string.Empty;

            strOrderBy = " ATTENDANCESOLUTIONID ";

            IQueryable <T_HR_ATTENDANCESOLUTION> ents = dalAttendanceSolution.GetAttendanceSolutionRdListByMultSearch(strOrderBy, filterString, queryParas.ToArray());

            return(ents.Count() > 0 ? ents.ToArray() : null);
        }
예제 #2
0
        /// <summary>
        /// 根据条件,获取考勤方案信息
        /// </summary>
        /// <param name="strOwnerID">权限控制所有人的员工序号</param>
        /// <param name="strCheckState">审核状态</param>
        /// <param name="strAttendanceSolutionName">考勤方案名称</param>
        /// <param name="strAttendanceType">考勤方式</param>
        /// <param name="strSortKey">排序字段</param>
        /// <returns>返回考勤方案信息</returns>
        public IQueryable <T_HR_ATTENDANCESOLUTION> GetAllAttendanceSolutionRdListByMultSearch(string strOwnerID, string strCheckState, string strAttendanceSolutionName, string strAttendanceType, string strSortKey)
        {
            AttendanceSolutionDAL dalAttendanceSolution = new AttendanceSolutionDAL();

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

            if (!string.IsNullOrEmpty(strAttendanceSolutionName))
            {
                strfilter.Append(" @0.Contains(ATTENDANCESOLUTIONNAME)");
                objArgs.Add(strAttendanceSolutionName);
            }

            if (!string.IsNullOrEmpty(strAttendanceType))
            {
                if (!string.IsNullOrEmpty(strfilter.ToString()))
                {
                    strfilter.Append(" AND");
                }

                if (objArgs.Count() > 0)
                {
                    iIndex = objArgs.Count();
                }

                strfilter.Append(" ATTENDANCETYPE == @" + iIndex.ToString());
                objArgs.Add(strAttendanceType);
            }

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

            string filterString = strfilter.ToString();

            if (strCheckState != Convert.ToInt32(CheckStates.WaittingApproval).ToString())
            {
                if (strCheckState == Convert.ToInt32(CheckStates.All).ToString())
                {
                    strCheckState = string.Empty;
                }
                SetOrganizationFilter(ref filterString, ref objArgs, strOwnerID, "T_HR_ATTENDANCESOLUTION");
            }
            else
            {
                string strCheckfilter = string.Copy(filterString);
                SetFilterWithflow("ATTENDANCESOLUTIONID", "T_HR_ATTENDANCESOLUTION", strOwnerID, ref strCheckState, ref filterString, ref objArgs);
                if (string.Compare(strCheckfilter, filterString) == 0)
                {
                    return(null);
                }
            }

            if (!string.IsNullOrEmpty(strCheckState))
            {
                if (!string.IsNullOrEmpty(filterString))
                {
                    filterString += " AND";
                }

                if (objArgs.Count() > 0)
                {
                    iIndex = objArgs.Count();
                }

                filterString += " CHECKSTATE == @" + iIndex.ToString();
                objArgs.Add(strCheckState);
            }

            var q = dalAttendanceSolution.GetAttendanceSolutionRdListByMultSearch(strOrderBy, filterString, objArgs.ToArray());

            return(q);
        }