示例#1
0
 public ActionResult Update(int id)
 {
     ViewBag.AmIn = "user";//标识左边菜单是否展开
     AdminUserBLL bll = new AdminUserBLL();
     ViewBag.UserNameIDList = bll.GetAdminUserNameIDsByRoleType(RoleType.媒介);
     ViewBag.User = bll.Get(id);
     return View();
 }
示例#2
0
        public ActionResult TaskCanApplyList(string AppName = "", string CPID = "", int PageIndex = 0)
        {
            ViewBag.AmIn = "taskapply";
            ViewBag.AppName = AppName;
            ViewBag.CPID = CPID;

            int count;
            int pageSize = 10;
            AdminUserBLL userBll = new AdminUserBLL();
            ViewBag.UserList = userBll.GetAdminUserNameIDsByRoleType(RoleType.渠道);
            AppBLL bll = new AppBLL();
            ViewBag.AppList = bll.GetAppListByNameAndCPID(AppName, CPID, PageIndex, pageSize, out count); ;
            ViewBag.PageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
            ViewBag.Record = count;
            ViewBag.CurrentPage = PageIndex;
            return View();
        }
示例#3
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();
        }
示例#4
0
 public ActionResult Register(AdminUser user =null)
 {
     AdminUserBLL userBll = new AdminUserBLL();
     ViewBag.CustomServices = userBll.GetAdminUserNameIDsByRoleType(RoleType.媒介);
     ViewBag.PwdPatton = RegexPatton.PasswordPatton;
     //以用户名有没有值来判断是请求注册页面还是提交注册数据
     if (user != null && !string.IsNullOrEmpty(user.UserName))
     {
         string msg = CheckRegistInfo(user, userBll);
         if (msg.Length > 0)
         {
             ViewBag.RegistInfo = user;
             ViewBag.Message = msg;
             return View();
         }
         user.RoleType = (int)RoleType.渠道;
         user.Password = Des.GetMD5String(user.Password);
         user.CreateTime = DateTime.Now;
         userBll.Add(user);
     }
     else
     {
         ViewBag.RegistInfo = new AdminUser();
         return View();
     }
     return RedirectToAction("Login","Home");
 }
示例#5
0
        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");
            }
        }