Exemple #1
0
 public ActionResult Audit(int ApplyID, string opt, DateTime SpreadBeginTime)
 {
     ViewBag.AmIn = "task";
     TaskBLL bll = new TaskBLL();
     Task task = bll.Get(ApplyID);
     task.AuditTime = DateTime.Now;
     if(opt == "pass")
     {
         DateTime dt = DateTime.Now;
         SpreadBeginTime.AddHours(dt.Hour);
         SpreadBeginTime.AddMinutes(dt.Minute);
         SpreadBeginTime.AddSeconds(dt.Second);
         SpreadBeginTime.AddMilliseconds(dt.Millisecond);
         task.SpreadBeginTime = SpreadBeginTime;
         task.Status = 1;
     }
     else if (opt == "deny")
     {
         task.Status = 2;
     }
     else
     { 
         //参数不正确
     }
     if(bll.Audit(task))
         return MyContent("审核任务成功,该任务被"+(opt == "deny" ? "拒绝" : "通过")+"!", "/Task/TaskList");
     return MyContent("审核失败!", "/Task/TaskList");
 }
Exemple #2
0
 public ActionResult Apply(int AppID,int UserID)
 {
     ViewBag.AmIn = "task";
     AdminUser user = CheckLogin.Instance.GetUser();
     TaskBLL bll = new TaskBLL();
     AppBLL appBll = new AppBLL();
     App app = appBll.Get(AppID);
     Task task = new Task();
     task.AppID = app.ID;
     task.ApplyTime = DateTime.Now;
     task.AppName = app.AppName;
     task.ChannelPrice = app.ChannelPrice;
     task.CPID = app.Cpid;
     task.CustomServiceID = user.ID;
     task.CustomServiceName = user.RealName;
     task.LinkManID = app.LinkManID;
     task.LinkManName = app.LinkManName;
     task.Price = app.Price;
     task.Remain = app.Remain;
     task.Result = 0;
     task.Status = 0;
     task.ChannelID = UserID;
     bll.Apply(task);
     app.Status = 1;
     appBll.Update(app);
     return MyContent("申请任务成功,等待商务审核!", "/Task/TaskCanApplyList");
 }
 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();
     }
 }
 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");
 }
        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");
        }
Exemple #6
0
        public ActionResult TaskList(int AdvertID =0,int AppID =0,string CPID ="",int MeiJieID =0,int PageIndex =0)
        {
            #region 保存查询条件
            ViewBag.AdvertID = AdvertID;
            ViewBag.AppID = AppID;
            ViewBag.CPID = CPID;
            ViewBag.MeiJieID = MeiJieID;
            ViewBag.AmIn = "task";
            #endregion

            AppBLL appBll = new AppBLL();
            AdvertBLL advertBLL = new AdvertBLL();
            AdminUserBLL userBll = new AdminUserBLL();
            ViewBag.MeiJieList = userBll.GetAdminUserNameIDsByRoleType(NetworkLeagueModel.Enum.RoleType.媒介);
            ViewBag.AdvertList = advertBLL.GetAll();
            ViewBag.AppNameIDList = appBll.GetAll();

            TaskBLL taskBll = new TaskBLL();
            int count;
            int pageSize=10;
            AdminUser user = CheckLogin.Instance.GetUser();
            ViewBag.TaskList = taskBll.GetTaskListByUserID("",AdvertID, AppID, CPID, user.ID, (int)user.RoleType, 0, 0, PageIndex, pageSize, out count);
            ViewBag.PageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
            ViewBag.Record = count;
            ViewBag.CurrentPage = PageIndex;
            return View();
        }
Exemple #7
0
 public ActionResult StopTask(int TaskID, string opt, DateTime SpreadEndTime)
 {
     TaskBLL bll = new TaskBLL();
     Task task = bll.Get(TaskID);
     task.AuditTime = DateTime.Now;
     if (opt == "stop")
     {
         DateTime dt = DateTime.Now;
         SpreadEndTime = SpreadEndTime.AddHours(dt.Hour).AddMinutes(dt.Minute).AddSeconds(dt.Second).AddMilliseconds(dt.Millisecond);
         task.SpreadEndTime = SpreadEndTime;
         task.Status = 3;
     }
     else
     {
         //参数不正确
     }
     if(bll.Audit(task))
         return MyContent("操作成功!", "/Task/TaskManage");
     return MyContent("操作失败!", "/Task/TaskManage");
 }
        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");
        }