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(); }
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"); } }
public ActionResult AdvertEdit(int AdvertID = 0, Advert model = null) { ViewBag.AmIn = "apk"; AdminUserBLL bll = new AdminUserBLL(); AdvertBLL advertBLL = new AdvertBLL(); if (AdvertID == 0) { ViewBag.STitle = "添加"; } else { ViewBag.STitle = "编辑"; } if (Request["ID"] == null) { IList<AdminUserNameIDDto> list = bll.GetAdminUserNameIDsByRoleType(RoleType.商务); ViewBag.UserList = list; if (AdvertID == 0) { ViewBag.Advert = new Advert(); return View(); } else { Advert ad = advertBLL.Get(AdvertID); ViewBag.Advert = ad; return View(); } } else { if (string.IsNullOrEmpty(model.AdName)) { IList<AdminUserNameIDDto> list = bll.GetAdminUserNameIDsByRoleType(RoleType.商务); ViewBag.UserList = list; ViewBag.Message = "广告主名称不能为空";//保存要提示的消息 if (AdvertID == 0) { ViewBag.Advert = new Advert(); } else { ViewBag.Advert = advertBLL.Get(AdvertID); } return View(); } if (advertBLL.AdvertIsExists(model.AdName, model.ID)) { IList<AdminUserNameIDDto> list = bll.GetAdminUserNameIDsByRoleType(RoleType.商务); ViewBag.UserList = list; ViewBag.Message = "广告主名称已存在";//保存要提示的消息 if (AdvertID == 0) { ViewBag.Advert = new Advert(); } else { ViewBag.Advert = advertBLL.Get(AdvertID); } return View(); } if (model.ID == 0) { model.CreateTime = DateTime.Now; advertBLL.Add(model); } else { advertBLL.Update(model); } return RedirectToAction("Advert", "Home"); } }