コード例 #1
0
        public PartialViewResult PopInfoList(string bid, string shopCode)
        {
            TaskMemberApp                app     = new TaskMemberApp();
            marketShopApp                shopApp = new marketShopApp();
            var                          items   = app.getData(bid, shopCode);
            List <MemberListModel>       list    = new List <MemberListModel>();
            V_CRM_MEMBER_APPTableAdapter ad      = new V_CRM_MEMBER_APPTableAdapter();

            foreach (var item in items)
            {
                var temp = new MemberListModel()
                {
                    memberNo    = item.memberId,
                    mf_memberNo = item.mfMemberId,
                    shop        = shopApp.getShopName(item.shopCode),
                    pic_Url     = item.picUrl == null ? "" : item.picUrl.Replace("/data/upload", "https://iretailerapp.flnet.com/MessagesQC"),
                    time        = item.InTime.Value.ToString("yyyy-MM-dd HH:mm"),
                    name        = ""
                };
                var table = ad.GetDataByNo(item.mfMemberId);
                if (table.Count > 0)
                {
                    temp.name = table[0].IsMEMBER_NAMENull() ? "" : table[0].MEMBER_NAME;
                }
                list.Add(temp);
            }
            return(PartialView("_POPListSubView", list));
        }
コード例 #2
0
        public ActionResult PopInfo(string bid, string shopCode, string userId)
        {
            // if (billNo.Equals("MBSTT201802061701585396"))
            //{
            TaskMemberApp                app     = new TaskMemberApp();
            marketShopApp                shopApp = new marketShopApp();
            var                          items   = app.getData(bid, shopCode);
            List <MemberListModel>       list    = new List <MemberListModel>();
            V_CRM_MEMBER_APPTableAdapter ad      = new V_CRM_MEMBER_APPTableAdapter();

            foreach (var item in items)
            {
                var temp = new MemberListModel()
                {
                    memberNo    = item.memberId,
                    mf_memberNo = item.mfMemberId,
                    shop        = shopApp.getShopName(item.shopCode),
                    pic_Url     = item.picUrl == null ? "" : item.picUrl.Replace("/data/upload", "https://iretailerapp.flnet.com/MessagesQC"),
                    time        = item.InTime.Value.ToString("yyyy-MM-dd HH:mm"), name = ""
                };
                var table = ad.GetDataByNo(item.mfMemberId);
                if (table.Count > 0)
                {
                    temp.name = table[0].IsMEMBER_NAMENull() ? "" : table[0].MEMBER_NAME;
                }
                list.Add(temp);
            }
            ViewData["vModel"]   = list;
            ViewData["bid"]      = bid;
            ViewData["userId"]   = userId;
            ViewData["shopCode"] = shopCode;
            return(View("POPListView"));
            //}
            //else
            //{
            //  return View("POPView2");
            //}
        }
コード例 #3
0
        public List <MemberMessageOutModel> sendMember(List <MemberMessageInModel> model)
        {
            try
            {
                TaskMemberApp app = new TaskMemberApp();

                var returnModel = new List <MemberMessageOutModel>();
                List <TaskMemberDataEntity>       ents     = new List <TaskMemberDataEntity>();
                V_CRM_MEMBER_LIST_APPTableAdapter memberAd = new V_CRM_MEMBER_LIST_APPTableAdapter();
                string bid = System.Guid.NewGuid().ToString();
                foreach (var item in model)
                {
                    var member = memberAd.GetDataByNo(item.mfMemberId);
                    //if (member.Rows.Count > 0  && member.First().VISIT_COUNT>1)
                    //{
                    ents.Add(new TaskMemberDataEntity()
                    {
                        id             = Guid.NewGuid().ToString(),
                        beachId        = bid,
                        InTime         = item.InTime,
                        memberId       = item.memberId,
                        MemberTypeCode = item.MemberTypeCode,
                        MemberTypeName = item.MemberTypeName,
                        mfMemberId     = item.mfMemberId,
                        picUrl         = item.picUrl,
                        shopCode       = item.shopCode,
                        IsRead         = 0
                    });
                    returnModel.Add(new MemberMessageOutModel()
                    {
                        hasError = false, mfMemberId = item.mfMemberId, message = "", shopCode = item.shopCode
                    });
                    //}
                    //else
                    //{
                    //  returnModel.Add(new MemberMessageOutModel() { hasError = false, mfMemberId = item.mfMemberId, message = "访问次数未达到2次,无需推送", shopCode = item.shopCode });
                    //}
                }
                try
                {
                    app.insertTaskMember(ents, bid);
                }
                catch (Exception ex)
                {
                    for (int i = 0; i < returnModel.Count; i++)
                    {
                        returnModel[i].hasError = true;
                        returnModel[i].message  = ex.Message;
                    }
                }
                return(returnModel);
            }
            catch (Exception ex)
            {
                var resp = new HttpResponseMessage(HttpStatusCode.InternalServerError)
                {
                    Content      = new StringContent(ex.ToString()),
                    ReasonPhrase = "error"
                };
                throw new HttpResponseException(resp);
            }
        }