Example #1
0
        public ActionResult Index()
        {
            try
            {
                var customerId = CustomerId();
                if (customerId == 0)
                {
                    return(Redirect("/Me/JoinUs/Index"));
                }
                ViewData["CustomerName"] = CustomerName();
                ViewData["WeixinUser"]   = WeiXinUser();
                LogManager.GetLogger().Info("customerId:" + customerId);

                ViewData["CustoemrBase"] = CustomerBase.FindById(customerId);

                var customerCards = CustomerCard.FindByList(customerId: customerId);
                ViewData["CustomerCards"] = customerCards;

                var orderBases = OrderBaseInfo.FindByList(customerId: customerId);
                ViewData["OrderBases"] = orderBases;

                ViewData["CustomerBases"] = CustomerBase.FindByList(parentId: customerId);
            }
            catch (Exception ex)
            {
                LogManager.GetLogger().Error(ex);
            }
            return(View());
        }
Example #2
0
        /// <summary>
        /// 我的提成
        /// </summary>
        /// <returns></returns>
        public ActionResult SalesCommissions()
        {
            try
            {
                var customerId = CustomerId();
                ViewData["CustomerName"] = CustomerName();
                ViewData["WeixinUser"]   = WeiXinUser();

                ViewData["CustomerBase"] = CustomerBase.FindById(customerId);

                var customerBases = CustomerBase.FindByList(parentId: customerId);

                var orderBases = OrderBaseInfo.FindByList();
                orderBases = orderBases.Where(p => customerBases.Any(c => c.Id == p.CustomerId)).ToList();

                ViewData["OrderBases"] = orderBases;

                ViewData["CustomerOrderCommissions"] = CustomerOrderCommission.FindByList(customerId: customerId);

                ViewData["CustomerWithdrawalRecords"] = CustomerWithdrawalRecord.FindByList(customerId: customerId);
            }
            catch (Exception ex)
            {
                LogManager.GetLogger().Error(ex);
            }
            return(View());
        }
Example #3
0
        /// <summary>
        /// 我的粉丝
        /// </summary>
        /// <returns></returns>
        public ActionResult Fans()
        {
            try
            {
                var customerId = CustomerId();
                LogManager.GetLogger().Info("customerId:" + customerId);

                ViewData["CustomerId"]   = customerId;
                ViewData["CustomerName"] = CustomerName();
                ViewData["WeixinUser"]   = WeiXinUser();

                ViewData["WeiXinUsers"] = WeixinUser.FindByList();
                var customerBases = CustomerBase.FindByList();
                var fanCount      = customerBases.Count(p => p.ParentId == customerId);
                ViewData["FanCount"] = fanCount;

                ViewData["CustomerBases"] = customerBases;
                var customerFanDic = new Dictionary <int, int>();
                if (null != customerBases && customerBases.Any())
                {
                    foreach (var customerBase in customerBases)
                    {
                        customerFanDic[customerBase.Id] = customerBases.Count(p => p.ParentId == customerBase.Id);
                    }
                }
                var dicSort = from objDic in customerFanDic orderby objDic.Value descending select objDic;
                ViewData["CustomerFanDic"] = dicSort;

                var index = 1;
                foreach (KeyValuePair <int, int> kvp in dicSort)
                {
                    if (kvp.Key == customerId)
                    {
                        break;
                    }
                    index++;
                }
                ViewData["Ranking"] = index;
            }
            catch (Exception ex)
            {
                LogManager.GetLogger().Error(ex);
            }
            return(View());
        }