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"); }
// // GET: /App/ public ActionResult XiaJia(int id) { AppBLL bll = new AppBLL(); App app = bll.Get(id); app.Status = (int)AppStatus.下架; if (bll.Update(app)) { return MyContent("成功下架广告!","/Home/App"); } return RedirectToAction("App", "Home"); }
public ActionResult AppEdit(int AppID = 0, App app = null) { ViewBag.AmIn = "apk"; AdvertBLL advertBll = new AdvertBLL(); AppBLL appBLL = new AppBLL(); IList<AdvertNameIDDto> list = advertBll.GetAll(); ViewBag.AdvertList = list; if (Request["id"] == null) { if (AppID == 0) { ViewBag.STitle = "添加"; ViewBag.App = new App(); return View(); } else { ViewBag.STitle = "编辑"; ViewBag.App = appBLL.Get(AppID); return View(); } } else { if (appBLL.CPIDIsExists(app.Cpid, app.ID)) { ViewBag.Message = "CPID已存在"; if (AppID == 0) { ViewBag.STitle = "添加"; ViewBag.App = app; } else { ViewBag.STitle = "编辑"; ViewBag.App = appBLL.Get(AppID); } return View(); } Advert ad = advertBll.Get(app.AdvertID); if (app.ID == 0) { app.CreateTime = DateTime.Now; app.LinkManID = ad.LinkManID; app.LinkManName = ad.LinkManName; if (!appBLL.Add(app)) { ViewBag.Message = "添加失败"; if (AppID == 0) { ViewBag.STitle = "添加"; ViewBag.App = app; } else { ViewBag.STitle = "编辑"; ViewBag.App = appBLL.Get(AppID); } return View(); } } else { app.LinkManID = ad.LinkManID; app.LinkManName = ad.LinkManName; if (!appBLL.Update(app)) { ViewBag.Message = "更新失败"; if (AppID == 0) { ViewBag.STitle = "添加"; ViewBag.App = app; } else { ViewBag.STitle = "编辑"; ViewBag.App = appBLL.Get(AppID); } return View(); } } return RedirectToAction("App", "Home"); } }