コード例 #1
0
 public JsonResult AddImageList(HtmlElement htmlElement)
 {
     htmlElement.Admin   = Session["AdminInfo"] as Admin;
     htmlElement.AddDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
     info = bll.AddImageList(htmlElement);
     return(Json(info));
 }
        public JsonResult AddMessage(Message message)
        {
            message.IsAdmin   = false;
            message.UpperLeve = 0;
            info.ResultType   = ResultInfo.BaseResultType.Error;
            if (Com.isTelephone(message.Mobile))
            {
                info.Msg = "电话号码格式不正确!";
            }
            if (string.IsNullOrEmpty(message.Nick))
            {
                info.Msg = "请填写昵称";
            }
            if (string.IsNullOrEmpty(message.MessageContent))
            {
                info.Msg = "请填写内容";
            }
            if (Session["VerifyCodeUsersLogin"] == null)
            {
                info.Msg = "服务器程序出错,请刷新页面重试!";
            }
            else
            {
                if (Session["VerifyCodeUsersLogin"].ToString().ToLower() != message.IdentifyingCode.ToLower())
                {
                    info.Msg = "验证码输入错误!";
                }
                else
                {
                    info = bll.AddMessage(message);
                }
            }

            return(Json(info));
        }
コード例 #3
0
        public JsonResult AddInfo(EnterpriseInfo enterpriseInfo)
        {
            Admin adminId = Session["AdminInfo"] as Admin;

            enterpriseInfo.Admin = adminId;
            info = bll.AddInfo(enterpriseInfo);
            return(Json(info));
        }
 public JsonResult GetMessageByIdList(int Id)
 {
     if (Id != 0)
     {
         info = bll.GetMessageByIdList(Id);
     }
     else
     {
         info.Msg        = "该留言已被删除!";
         info.ResultType = ResultInfo.BaseResultType.Error;
     }
     return(Json(info));
 }
コード例 #5
0
        public JsonResult AddAdmin(Admin admin)
        {
            Admin admi = Session["AdminInfo"] as Admin;

            admin.CreateAdminId = admi.Id;
            if (admin.Id == 0)
            {
                info = adminBLL.AddAdmin(admin);
            }
            else
            {
                info = adminBLL.UpdateAdmin(admin);
            }
            return(Json(info));
        }
コード例 #6
0
 public JsonResult Login(Admin admin)
 {
     info.ResultType = ResultInfo.BaseResultType.Error;
     if (Session["AdminInfo"] != null)
     {
         //跳转
         info.ResultType = ResultInfo.BaseResultType.Exists;
         info.DataObj    = "";
         info.Msg        = "已登录,请刷新页面!";
     }
     else
     {
         if (string.IsNullOrWhiteSpace(admin.Account))
         {
             info.Msg = "请输入用户名!";
         }
         else if (string.IsNullOrWhiteSpace(admin.PassWord))
         {
             info.Msg = "请输入密码!";
         }
         else if (string.IsNullOrWhiteSpace(admin.VerifyCode))
         {
             info.Msg = "请输入验证码!";
         }
         if (Session["VerifyCodeUsersLogin"] == null)
         {
             info.Msg = "服务器程序出错,请刷新页面重新登录!";
         }
         else
         {
             if (Session["VerifyCodeUsersLogin"].ToString().ToLower() != admin.VerifyCode.ToLower())
             {
                 info.Msg = "验证码输入错误!";
             }
             else
             {
                 info = bll.Login(admin);
                 if (info.ResultType == ResultInfo.BaseResultType.Success)
                 {
                     Session["AdminInfo"] = info.DataObj as Admin;
                 }
             }
         }
     }
     return(Json(info));
 }
コード例 #7
0
        public JsonResult DelImage(int[] ids, int id)
        {
            info.ResultType = ResultInfo.BaseResultType.Error;
            //查询出图片所在的数据
            var data = db.Image.Where(p => ids.Contains(p.Id)).ToList();

            if (data.Count() > 0)
            {
                //取出图片的路径,删除这些图片
                foreach (Image imageModel in data)
                {
                    string file = Path.Combine(Server.MapPath(imageModel.Url));

                    if (System.IO.File.Exists(file.Replace("\\", @"\")))
                    {
                        System.IO.File.Delete(file.Replace("\\", @"\"));
                    }
                    System.IO.File.Delete(file);
                }
                info = bll.DelImage(ids, id, data);
            }

            return(Json(info));
        }
コード例 #8
0
 public JsonResult GetImageListShow(int Id)
 {
     info = bll.GetImageListShow(Id);
     return(Json(info));
 }
 public JsonResult QueryMessage(string startDate, string endDate, string keyWord, string htmlPageId, bool?isAdmin)
 {
     info = bll.QueryMessage(startDate, endDate, keyWord, htmlPageId, isAdmin);
     return(Json(info));
 }
コード例 #10
0
 public JsonResult UpdateAdminState(int id, int state)
 {
     info = adminBLL.UpdateAdminState(id, state);
     return(Json(info));
 }
 public JsonResult GetMessageById(int id)
 {
     info = bll.GetMessageById(id);
     return(Json(info));
 }
コード例 #12
0
 public JsonResult GetInfoByName(string Name)
 {
     info = EnterpriseBll.GetInfoByName(Name);
     return(Json(info));
 }
コード例 #13
0
 public JsonResult GetImageListShow(string title)
 {
     info = bll.GetImageList(title);
     return(Json(info));
 }
コード例 #14
0
 public JsonResult DelAdmin(int[] ids)
 {
     info = adminBLL.UpdateAdminStateByIds(ids);
     return(Json(info));
 }
コード例 #15
0
 public JsonResult QueryAdminById(int id)
 {
     info = adminBLL.QueryAdminById(id);
     return(Json(info));
 }
コード例 #16
0
 public JsonResult GetInfoList(string startDate, string endDate, string title)
 {
     info = bll.QueryInfo(startDate, endDate, title);
     return(Json(info));
 }
コード例 #17
0
 public JsonResult DelAdminImage(int[] ids)
 {
     info.ResultType = ResultInfo.BaseResultType.Error;
     info            = bll.DelAdminImage(ids);
     return(Json(info));
 }
コード例 #18
0
 public JsonResult QueryImagesList(string startDate, string endDate, string title, int?id)
 {
     info = bll.QueryImagesList(startDate, endDate, title, id);
     return(Json(info));
 }
コード例 #19
0
 public JsonResult GetInfoById(int id)
 {
     info = bll.GetInfoById(id);
     return(Json(info, JsonRequestBehavior.AllowGet));
 }
コード例 #20
0
 public JsonResult AddImage(HtmlElement htmlElement)
 {
     info = bll.AddImage(htmlElement);
     return(Json(info));
 }
コード例 #21
0
 public JsonResult DelInfo(int[] ids)
 {
     info = bll.DelInfo(ids);
     return(Json(info));
 }
コード例 #22
0
 public JsonResult GetAdminList(string startDate, string endDate, string name)
 {
     info = adminBLL.QueryAdmin(startDate, endDate, name);
     return(Json(info));
 }