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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
public JsonResult GetInfoByName(string Name) { info = EnterpriseBll.GetInfoByName(Name); return(Json(info)); }
public JsonResult GetImageListShow(string title) { info = bll.GetImageList(title); return(Json(info)); }
public JsonResult DelAdmin(int[] ids) { info = adminBLL.UpdateAdminStateByIds(ids); return(Json(info)); }
public JsonResult QueryAdminById(int id) { info = adminBLL.QueryAdminById(id); return(Json(info)); }
public JsonResult GetInfoList(string startDate, string endDate, string title) { info = bll.QueryInfo(startDate, endDate, title); return(Json(info)); }
public JsonResult DelAdminImage(int[] ids) { info.ResultType = ResultInfo.BaseResultType.Error; info = bll.DelAdminImage(ids); return(Json(info)); }
public JsonResult QueryImagesList(string startDate, string endDate, string title, int?id) { info = bll.QueryImagesList(startDate, endDate, title, id); return(Json(info)); }
public JsonResult GetInfoById(int id) { info = bll.GetInfoById(id); return(Json(info, JsonRequestBehavior.AllowGet)); }
public JsonResult AddImage(HtmlElement htmlElement) { info = bll.AddImage(htmlElement); return(Json(info)); }
public JsonResult DelInfo(int[] ids) { info = bll.DelInfo(ids); return(Json(info)); }
public JsonResult GetAdminList(string startDate, string endDate, string name) { info = adminBLL.QueryAdmin(startDate, endDate, name); return(Json(info)); }