Пример #1
0
        public ActionResult CheckBill(int ChannelID)
        {
            ApkDataBLL bll = new ApkDataBLL();
            ChannelBLL channelBll = new ChannelBLL();
            List<ApkDataDto> list = (List<ApkDataDto>)channelBll.GetApkDataDtoList(ChannelID, "");
            double sumMoney = list.Sum<ApkDataDto>(t => Convert.ToDouble(t.Money));
            
            string taskids = string.Empty;
            list.ForEach(t => taskids += t.TaskID + ",");

            AdminUser user = CheckLogin.Instance.GetUser();
            //明天做
            AdvertBill bill = new AdvertBill();
            bill.AdvertID = ChannelID;
            bill.LinkManID = user.ID;
            bill.AdMoney = sumMoney.ToString();
            bill.ApplyTime = DateTime.Now;
            bill.PayMoney = "0";
            bill.Status = 0;//0:未付款
            bill.BillType = 1;//1:渠道账单
            bill.TaskIds = taskids;
            AdvertBillBLL advertBillBll = new AdvertBillBLL();

            if (advertBillBll.Add(bill))
            {
                TaskBLL taskBll = new TaskBLL();
                bll.UpdateApkDataStatusByChannelID(ChannelID);
            }

            return MyContent("生成一条新的渠道账单!", "/Channel/ChannelBillList");
        }
Пример #2
0
        public ActionResult CheckBill(int AdvertID,int LinkManID)
        {
            ApkDataBLL bll = new ApkDataBLL();
            List<ApkDataDto> list = (List<ApkDataDto>)bll.GetApkDataDtoList(AdvertID,"");
            double sumMoney = list.Sum<ApkDataDto>(t => Convert.ToDouble(t.Money));

            string taskids = string.Empty;
            list.ForEach(t => taskids += t.TaskID + ",");

            AdvertBill bill = new AdvertBill();
            bill.AdvertID = AdvertID;
            bill.LinkManID = LinkManID;
            bill.AdMoney = sumMoney.ToString();
            bill.ApplyTime = DateTime.Now;
            bill.PayMoney = "0";
            bill.Status = 0;//0:未付款
            bill.BillType = 0;//0:广告主
            bill.TaskIds = taskids;
            AdvertBillBLL advertBillBll = new AdvertBillBLL();

            if (advertBillBll.Add(bill))
            {
                TaskBLL taskBll = new TaskBLL();
                bll.UpdateApkDataStatus(AdvertID);
            }
            return MyContent("确认账单成功!请尽快支付款项!","/AdvertBill/AdvertBillList");
        }
Пример #3
0
        public ActionResult ApkDataList(string AppName = "", string CPID="", DateTime? begin = null, DateTime? end = null, int AdvertID = 0, int AppID = 0, int Status = -1, string Gb_DataTime = null,string Gb_Advert = null,string Gb_App = null, int PageIndex = 0)
        {
            #region 保存参数
            ViewBag.begin = begin;
            ViewBag.end = end;
            ViewBag.AdvertID = AdvertID;
            ViewBag.AppID = AppID;
            ViewBag.Status = Status;
            ViewBag.AppName = AppName;
            ViewBag.CPID = CPID;
            ViewBag.AmIn = "apk";

            if (Request["AdvertID"] == null)//表示是第一次请求页面,默认让复选框选中
            {
                ViewBag.Gb_DataTime = Gb_DataTime = "DataDate";
                ViewBag.Gb_Advert = Gb_Advert = "Advert";
                ViewBag.Gb_App = Gb_App = "App";
            }
            else
            {
                ViewBag.Gb_DataTime = Request["Gb_DataTime"];
                ViewBag.Gb_Advert = Request["Gb_Advert"];
                ViewBag.Gb_App = Request["Gb_App"];
            }
            ViewBag.PageIndex = PageIndex;
            #endregion

            AdvertBLL advertBLL = new AdvertBLL();
            ViewBag.AdvertList = advertBLL.GetAll();

            AppBLL appBLL = new AppBLL();
            ViewBag.AppNameIDList = appBLL.GetAll();

            string groupBy = GetGroupByStr(Gb_DataTime != null, Gb_Advert != null, Gb_App != null);
            ViewBag.GroupBy = groupBy;

            ApkDataBLL bll = new ApkDataBLL();

            int count;
            int pageSize = 10;

            AdminUser user = CheckLogin.Instance.GetUser();
            ViewBag.ApkDataList = bll.GetList(begin != null ? (DateTime)begin : DateTime.Now.AddYears(-20), end != null ? (DateTime)end : DateTime.Now.AddYears(20), AdvertID, AppID, Status, groupBy, user.ID, (int)user.RoleType, PageIndex, pageSize, out count, AppName, CPID);
            ViewBag.PageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
            ViewBag.Record = count;
            ViewBag.CurrentPage = PageIndex;
            if ((RoleType)user.RoleType == RoleType.渠道)
            {
                return View("ChannelApkDataList");
            }
            return View();
        }
Пример #4
0
        public ActionResult BillList(int AdvertID = 0, int LinkManID = 0, string TaskIds = "", string opt = "check")
        {
            ApkDataBLL bll = new ApkDataBLL();
            IList<ApkDataDto> list = bll.GetApkDataDtoList(AdvertID, TaskIds);

            double sumMoney = list.Sum<ApkDataDto>(t=>Convert.ToDouble(t.Money));
            ViewBag.SumMoney = sumMoney;
            ViewBag.AdvertID = AdvertID;
            ViewBag.LinkManID = LinkManID;
            ViewBag.Opt = opt;

            AdvertBLL advertBll = new AdvertBLL();
            Advert advert = advertBll.Get(AdvertID);
            ViewBag.AdvertName = advert.AdName;

            ViewBag.BillList = list;
            return View();
        }
Пример #5
0
 public ActionResult SaveActivationNum(int id, int num)
 {
     ViewBag.AmIn = "apk";
     if (id < 1)
     {
         return RedirectToAction("ApkDataList", "ApkData");
     }
     ApkDataBLL bll = new ApkDataBLL();
     ApkData data = bll.Get(id);
     data.ActivationNum = num;
     data.ChannelMoney = Convert.ToString(num * Convert.ToDouble(data.ChannelPrice));
     data.Money = Convert.ToString(num * Convert.ToDouble(data.Price));
     data.Status = 1;
     if(bll.Update(data))
         return MyContent("录入激活量成功!", "/ApkData/ApkDataList");
     else
         return MyContent("录入激活量失败!", "/ApkData/ApkDataList");
 }
Пример #6
0
 public ActionResult ApkDataAdd(int TaskID = 0, int AppID =0, int ActivationNum = 0, DateTime? dataTime = null, string opt = "add")
 {
     #region
     ViewBag.ActivationNum = ActivationNum;
     ViewBag.dataTime = dataTime;
     ViewBag.AmIn = "apk";
     #endregion
     TaskBLL taskBll = new TaskBLL();
     Task task = taskBll.Get(TaskID);
     ViewBag.Task = task;
     if (opt == "add")
     {
         if (TaskID > 0 && AppID > 0 && dataTime != null)
         {
             ViewBag.Task = task;
             ApkDataBLL bll = new ApkDataBLL();
             if (bll.ApkDataIsExists(AppID, (DateTime)dataTime))
             {
                 ViewBag.Message = "广告数据已存在,不能再添加!";
                 return View();
             }
             else if (bll.Add(TaskID, ActivationNum, (DateTime)dataTime))
             {
                 ViewBag.Message = "添加成功!";
                 return View();
             }
             else
             {
                 ViewBag.Message = "添加失败!";
                 return View();
             }
         }
         else
         {
             ViewBag.Message = "输入数据不正确,请重新输入!";
             return View();
         }
     }
     else
     {
         return View();
     }
 }
Пример #7
0
 public ActionResult Down(int id)
 {
     ViewBag.AmIn = "apk";
     ApkDataBLL bll = new ApkDataBLL();
     ApkData data = bll.Get(id);
     TaskBLL taskBll = new TaskBLL();
     Task task = taskBll.Get(data.TaskID);
     if (task.SpreadEndTime == null)
     {
         return MyContent("该广告正在推广中,不能下发!", "/ApkData/ApkDataList");
     }
     data.Status = 2;
     if(bll.Update(data))
         return MyContent("下发广告数据成功!","/ApkData/ApkDataList");
     else
         return MyContent("下发广告数据失败!", "/ApkData/ApkDataList");
 }