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"); }
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 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"); }