public ActionResult GetGridJson(Pagination pagination, string keyword)
        {
            var data = new
            {
                rows    = memberApp.GetList(pagination, keyword),
                total   = pagination.total,
                page    = pagination.page,
                records = pagination.records
            };

            return(Content(data.ToJson()));
        }
Beispiel #2
0
        public ActionResult GetOrderList(GetOrderListRequest request)
        {
            ResponseBase <List <GetOrderListResponse> > response = new ResponseBase <List <GetOrderListResponse> >();

            response.IsSuccess = false;
            response.Reason    = "系统出错,请联系管理员";
            List <GetOrderListResponse> list = new List <GetOrderListResponse>();

            response.Result = list;
            #region 验证
            if (request == null)
            {
                response.IsSuccess = false;
                response.Reason    = "参数不能为空";
                return(Content(response.ToJson()));
            }

            //全名
            if (string.IsNullOrWhiteSpace(request.FullName))
            {
                response.IsSuccess = false;
                response.Reason    = "全名不正确";
                return(Content(response.ToJson()));
            }

            //护照
            if (string.IsNullOrWhiteSpace(request.FullName))
            {
                response.IsSuccess = false;
                response.Reason    = "护照不正确";
                return(Content(response.ToJson()));
            }

            #endregion

            try
            {
                // orderApp.AddOrder(orderViewModel);

                //获取用户信息
                var member = memberApp.GetList(item => item.FullName == request.FullName && item.CredentialType == (int)CredentialTypeEnum.Passport && item.CredentialInformation == request.PassportNo).FirstOrDefault();
                if (member != null)
                {
                    request.MemberId = member.MemberId;
                    var orderList = orderApp.GetOrderList(request);

                    //预约信息
                    if (orderList != null && orderList.Any())
                    {
                        foreach (var order in orderList)
                        {
                            GetOrderListResponse getOrderListResponse = new GetOrderListResponse();
                            getOrderListResponse.FullName             = member.FullName.ToString();
                            getOrderListResponse.Gender               = (GenderEnum)member.Gender;
                            getOrderListResponse.DateOfBirth          = member.DateOfBirth;
                            getOrderListResponse.IdentificationNumber = member.CredentialInformation;
                            getOrderListResponse.CellPhone            = member.ContactNumber;

                            getOrderListResponse.Description = order.SymptomDescription;
                            getOrderListResponse.Appointment = order.OrderDate.ToString();
                            getOrderListResponse.Operating   = order.AddDate;

                            list.Add(getOrderListResponse);
                        }
                    }
                    response.IsSuccess = true;
                    response.Result    = list;
                }
                else
                {
                    //没有找到信息
                    response.IsSuccess = true;
                }
            }
            catch (Exception ex)
            {
            }
            return(Content(response.ToJson()));
        }