Exemplo n.º 1
0
        /// <summary>
        /// 获取预约信息
        /// </summary>
        /// <param name="freetimeid"></param>
        /// <returns></returns>
        public ExtTrainingEntity GetInfo(string freetimeid)
        {
            ExtTrainingEntity entity = new ExtTrainingEntity();

            try
            {
                var list = TrainingOrderDetailBLL.Instance.GetList(new TrainingOrderDetailEntity()
                {
                    TrainingFreeTimeId = freetimeid
                });
                if (list != null && list.Count > 0)
                {
                    var detail = list.FirstOrDefault();
                    if (detail != null)
                    {
                        var order = TrainingOrderBLL.Instance.GetEntity(detail.TrainingOrderId);
                        if (order != null)
                        {
                            if (order.UserType == (int)QX360.Model.Enums.TrainingUserType.学员)
                            {
                                var member = MemberBLL.Instance.GetEntity(order.MemberId);
                                entity.SubNoticeInfo = string.Format("{0},{1}", member.MemberName, member.Mobile);
                                entity.Mobile        = member.Mobile;
                            }
                            else if (order.UserType == (int)QX360.Model.Enums.TrainingUserType.教练)
                            {
                                var teacher = TeacherBLL.Instance.GetEntity(order.MemberId);
                                entity.SubNoticeInfo = string.Format("{0},{1},{2}", teacher.Name, teacher.Mobile, teacher.SchoolName);
                                entity.Mobile        = teacher.Mobile;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ex.Data["Method"] = "TrainingCarController>>GetInfo";
                new ExceptionHelper().LogException(ex);
            }
            return(entity);
        }
Exemplo n.º 2
0
        public JsonResult GetGetSubInfo(string freetimeid)
        {
            var result = new ReturnMessage(false)
            {
                Message = "操作失败!"
            };

            try
            {
                ExtTrainingEntity rs = GetInfo(freetimeid);
                result.ResultData["Info"] = rs;
                result.IsSuccess          = true;
                result.Message            = "成功";
            }
            catch (Exception ex)
            {
                ex.Data["Method"] = "TrainingCarController>>GetGetSubInfo";
                new ExceptionHelper().LogException(ex);
            }
            return(Json(result));
        }