Exemple #1
0
        protected List <EventProfileEntityView> GetListPrivate(ref Expression <Func <EventProfileEntity, bool> > predicate,
                                                               PageCondition ConPage)
        {
            int    EventId  = Convert.ToInt32(Request["EventId"]);
            string TypeCode = Request["TypeCode"];

            predicate = predicate.AndAlso(x => x.EventId == EventId && x.TypeCode.Equals(TypeCode) && x.IsDeleted != true);

            ConPage.SortConditions.Add(new SortCondition("OperatedDateTime", System.ComponentModel.ListSortDirection.Descending));

            //var q = _BaseService.GetList<EventProfileEntityView>(predicate, ConPage);

            var q = _objService1.GetList <EventProfileEntityView>(predicate, ConPage);


            _objService1.GetUserList(q);
            //TODO:考虑真实情况一个人签到多次的情况不多见,暂时在内存做disstinct,如需要在移到数据库中
            return(q);
        }
        /// <summary>
        /// Annual SignIn-Intial
        /// </summary>
        public ActionResult GetInitializedEmployeeList()
        {
            string eventId    = Request["eventId"];
            string screenType = Request["ScreenType"];

            Expression <Func <EventProfileEntity, bool> > predicate = x => x.IsDeleted == false && x.TypeCode == EventType.Checkin.ToString();

            if (!string.IsNullOrEmpty(eventId))
            {
                var eventid = int.Parse(eventId);
                predicate = predicate.AndAlso(x => x.EventId == eventid);
            }

            switch (screenType)
            {
            case "L":
                predicate = predicate.AndAlso(x => x.IsDisplay1 == true);
                break;

            case "M":
                predicate = predicate.AndAlso(x => x.IsDisplay2 == true);
                break;

            case "S":
                predicate = predicate.AndAlso(x => x.IsDisplay3 == true);
                break;

            default:
                predicate = predicate.AndAlso(x => x.IsDisplay1 == true);
                break;
            }

            var eventProfiles =
                _objService.GetList <EventProfileEntityView>(predicate).OrderBy(x => x.OperatedDateTime).ToList();

            return(Json(new { EmployeeList = eventProfiles }, JsonRequestBehavior.AllowGet));
        }