Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dto"></param>
        /// <param name="fig"></param>

        public static void InsertQueueMember(MemberDto dto, MemberFigure fig)
        {
            Dictionary <MemberDto, MemberFigure> dic = new Dictionary <MemberDto, MemberFigure>();

            dic.Add(dto, fig);
            queueMembers.Enqueue(dic);
        }
        public ActionResult MemberDetail(int Id)
        {
            var     memberEntity = _memberContract.View(Id);
            string  shangSize    = string.Empty;
            string  xiaSize      = string.Empty;
            string  preColor     = string.Empty;
            string  figureType   = string.Empty;
            string  fgigureDes   = string.Empty;
            string  height       = string.Empty;
            string  weight       = string.Empty;
            string  shoulder     = string.Empty;
            string  bust         = string.Empty;
            string  waistline    = string.Empty;
            string  hips         = string.Empty;
            decimal quotiety     = 0;


            var memberDeposit = _memberDepositContract.MemberDeposits
                                .Where(x => !x.IsDeleted && x.IsEnabled)
                                .Where(x => x.MemberId == Id && x.MemberActivityType == MemberActivityFlag.Recharge)
                                .OrderByDescending(x => x.Id)
                                .FirstOrDefault();

            if (memberDeposit != null)
            {
                quotiety = memberDeposit.Quotiety;
            }
            if (memberEntity.MemberFigures.Count > 0)
            {
                MemberFigure memberFigures = memberEntity.MemberFigures.OrderByDescending(x => x.Id).FirstOrDefault();
                string[]     size          = memberFigures.ApparelSize.Split(',');
                shangSize  = size[0];
                xiaSize    = size[1];
                preColor   = memberFigures.PreferenceColor;
                figureType = memberFigures.FigureType;
                fgigureDes = memberFigures.FigureDes;
                height     = memberFigures.Height.ToString();
                weight     = memberFigures.Weight.ToString();
                shoulder   = memberFigures.Shoulder.ToString();
                bust       = memberFigures.Bust.ToString();
                waistline  = memberFigures.Waistline.ToString();
                hips       = memberFigures.Hips.ToString();
            }
            ViewBag.ShangSize  = shangSize;
            ViewBag.XiaSize    = xiaSize;
            ViewBag.PreColor   = preColor;
            ViewBag.FigureType = figureType;
            ViewBag.FigureDes  = fgigureDes;
            ViewBag.Height     = height;
            ViewBag.Weight     = weight;
            ViewBag.Shoulder   = shoulder;
            ViewBag.Bust       = bust;
            ViewBag.Waistline  = waistline;
            ViewBag.Hips       = hips;
            ViewBag.Quotiety   = quotiety;
            ViewBag.MemberId   = Id;

            #region 线上咨询师问卷调查回答信息
            IDictionary <string, string[]> dic = new Dictionary <string, string[]>();

            var names = _collocationQuestionnaireContract.Entities.Where(c => c.MemberId == Id).GroupBy(c => new { c.QuestionName }).Select(c => c.Key).ToArray();

            foreach (var name in names)
            {
                string[] values = _collocationQuestionnaireContract.Entities.Where(c => c.MemberId == Id && c.QuestionName == name.QuestionName && !c.IsDeleted && c.IsEnabled).Select(c => c.Content).ToArray();

                KeyValuePair <string, string[]> item = new KeyValuePair <string, string[]>(name.QuestionName, values);

                dic.Add(item);
            }

            ViewBag.CollocationQuestionnaireDic = dic;
            #endregion

            return(PartialView(memberEntity));
        }