/// <summary> /// 获取预约时的答题项 /// </summary> /// <returns></returns> public ActionResult GetOptions() { return(Json(_appointmentContract.GetOptions(), JsonRequestBehavior.AllowGet)); }
public ActionResult GetBoxInfo(string appointmentNumber) { var entity = _appointmentContract.Entities.FirstOrDefault(a => a.Number == appointmentNumber); if (entity == null) { return(Json(OperationResult.Error("未找到预约信息"))); } var memberData = new { entity.MemberId, entity.Member.RealName, entity.Member.MobilePhone, entity.Store.StoreName }; var figure = entity.Member.MemberFigures.Select(f => new { f.Birthday, f.Height, f.Weight, f.Shoulder, f.PreferenceColor, f.Waistline, f.Hips, f.Gender, f.FigureType, f.FigureDes, f.Bust, f.ApparelSize }).FirstOrDefault(); var figureData = new { Birthday = figure.Birthday.HasValue ? figure.Birthday.Value.ToUnixTime() : 0, Height = figure.Height, Weight = figure.Weight, Shoulder = figure.Shoulder, PreferenceColor = figure.PreferenceColor, Waistline = figure.Waistline, Hips = figure.Hips, Gender = figure.Gender, FigureType = figure.FigureType, FigureDesc = figure.FigureDes, Bust = figure.Bust, ApparelSize = figure.ApparelSize }; var options = _appointmentContract.GetOptions().Data as AppointmentOption; var appointmentData = new { entity.Quantity, entity.Season, entity.Situation, entity.Top, entity.Bottom, entity.Jumpsuit, entity.Notes, entity.Style, entity.Color, entity.Fabric, entity.Budget }; return(Json(new OperationResult(OperationResultType.Success, string.Empty, new { memberData, figureData, appointmentData }), JsonRequestBehavior.AllowGet)); }