Beispiel #1
0
        public ActionResult MemberWebPage()
        {
            var           userDetails      = (CustomerLoginDetail)Session["UserSession"];
            MemberWebPage objMemberWebPage = new MemberWebPage();

            objMemberWebPage = KR.GetMemberWebPageData(userDetails.GroupId, userDetails.connectionString);

            List <long> memberbasedataList = new List <long>();

            memberbasedataList.Add(objMemberWebPage.TotalMember);
            memberbasedataList.Add(objMemberWebPage.ReferringBase);
            var lstMemberBaseData = string.Join(",", memberbasedataList);

            List <long> memberbaseProfileList = new List <long>();

            memberbaseProfileList.Add(objMemberWebPage.TotalMember);
            memberbaseProfileList.Add(objMemberWebPage.NoofProfileUpdate);
            var lstMemberBaseProfileData = string.Join(",", memberbaseProfileList);

            List <long> memberbaseGiftList = new List <long>();

            memberbaseGiftList.Add(objMemberWebPage.TotalMember);
            memberbaseGiftList.Add(objMemberWebPage.GiftPointsCount);
            var lstMemberBaseGiftData = string.Join(",", memberbaseGiftList);

            List <long> memberbaseGiftOptOutList = new List <long>();

            memberbaseGiftOptOutList.Add(objMemberWebPage.ProgramOtpOut);
            memberbaseGiftOptOutList.Add(objMemberWebPage.PromoSMSOtpOut);
            var lstMemberBaseOptOutData = string.Join(",", memberbaseGiftOptOutList);

            List <string> referralnameList = new List <string>();

            referralnameList.Add("'Issued'");
            referralnameList.Add("'Redeemed'");
            referralnameList.Add("'Expired'");
            referralnameList.Add("'Unused'");
            var lstreferralNames = string.Join(",", referralnameList);

            List <long> referraldataList = new List <long>();

            referraldataList.Add(objMemberWebPage.ReferralPointsIssued);
            referraldataList.Add(objMemberWebPage.ReferralPointsRedeem);
            referraldataList.Add(objMemberWebPage.ReferralPointsExpired);
            referraldataList.Add(objMemberWebPage.ReferralPointsUnused);
            var lstreferraldata = string.Join(",", referraldataList);

            ViewBag.ReferralNames         = lstreferralNames.Trim();
            ViewBag.ReferralData          = lstreferraldata.Trim();
            ViewBag.MemberbaseProfileData = lstMemberBaseProfileData.Trim();
            ViewBag.MemberbaseData        = lstMemberBaseData.Trim();
            ViewBag.MemberbaseGiftData    = lstMemberBaseGiftData.Trim();
            ViewBag.MemberbaseOptOutData  = lstMemberBaseOptOutData.Trim();

            return(View(objMemberWebPage));
        }
        public MemberWebPage GetMemberWebPageData(string GroupId, string connstr)
        {
            MemberWebPage objMemberWebPage = new MemberWebPage();

            try
            {
                using (var context = new BOTSDBContext(connstr))
                {
                    objMemberWebPage = context.Database.SqlQuery <MemberWebPage>("sp_BOTS_MemberWebPage @pi_GroupId, @pi_Date, @pi_LoginId",
                                                                                 new SqlParameter("@pi_GroupId", GroupId), new SqlParameter("@pi_Date", DateTime.Now.ToShortDateString()), new SqlParameter("@pi_LoginId", "")).FirstOrDefault <MemberWebPage>();
                }
            }
            catch (Exception ex)
            {
                newexception.AddException(ex, GroupId);
            }

            return(objMemberWebPage);
        }