Esempio n. 1
0
        public ActionResult Index()
        {
            DateTime BeginTime = DateTime.Now.AddDays(-30);
            DateTime EndTime = DateTime.Now;
            ChannelBLL bll = new ChannelBLL();

            //获取相关金额
            Dictionary<string, string> dict = bll.GetChannelMoney(CheckLogin.Instance.GetUser().ID);
            ViewBag.AllMoney = dict["AllMoney"];
            ViewBag.NoApplyMoney = dict["NoApplyMoney"];
            ViewBag.PaiedMoney = dict["PaiedMoney"];
            ViewBag.RefusedToMoney = dict["RefusedToPayMoney"];

            AdminUser user = CheckLogin.Instance.GetUser();
            List<PerDayMoney> list = bll.GetPerDayMoneyList(user.ID, BeginTime, EndTime);
            StringBuilder sbDate = new StringBuilder();
            StringBuilder sbMoney = new StringBuilder();
            int days = (EndTime - BeginTime).Days;
            for (int i = 0; i <= days; i++)
            { 
                var perday = list.Where<PerDayMoney>(t=>(Convert.ToDateTime(t.CreateTime) - BeginTime.AddDays(i)).Days == 0);
                if (perday == null || perday.Count<PerDayMoney>() == 0)
                {
                    sbDate.Append("'");
                    sbDate.Append(BeginTime.AddDays(0).ToString("yyyy-MM-dd"));
                    sbDate.Append("'");
                    sbDate.Append(",");
                    sbMoney.Append(0);
                    sbMoney.Append(",");
                }
                else
                {
                    sbDate.Append("'");
                    sbDate.Append(perday.First<PerDayMoney>().CreateTime);
                    sbDate.Append("'");
                    sbDate.Append(",");
                    sbMoney.Append(perday.First<PerDayMoney>().Money);
                    sbMoney.Append(",");
                }
            }
            ViewBag.CreateDates = sbDate.ToString().TrimEnd(',');
            ViewBag.Money = sbMoney.ToString().TrimEnd(',');
            return View();
        }
Esempio n. 2
0
 public ActionResult ChannelBillList(int Status = -1, int PageIndex = 0)
 {
     ViewBag.AmIn = "bill";
     ViewBag.Status = Status;
     AdminUser user = CheckLogin.Instance.GetUser();
     if (user.RoleType == (int?)RoleType.渠道)
     { 
         //如果当前登录用户是渠道,则查询相关金额
         ChannelBLL channelBll = new ChannelBLL();
         Dictionary<string,string> dict = channelBll.GetChannelMoney(CheckLogin.Instance.GetUser().ID);
         ViewBag.AllMoney = dict["AllMoney"];
         ViewBag.NoApplyMoney = dict["NoApplyMoney"];
         ViewBag.PaiedMoney = dict["PaiedMoney"];
         ViewBag.RefusedToMoney = dict["RefusedToPayMoney"];
     }
     int count;
     int pageSize = 10;
     AdvertBillBLL bll = new AdvertBillBLL();
     ViewBag.BillList = bll.GetChannelBillList(user.RoleType == (int?)RoleType.渠道 ? user.ID : 0, user.ID, (int)user.RoleType, 1, Status, PageIndex, pageSize, out count);
     ViewBag.PageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
     ViewBag.Record = count;
     ViewBag.CurrentPage = PageIndex;
     return View();
 }