public ActionResult Add() { int id = CECRequest.GetQueryInt("id", 0); var articleInfo = ArticleService.GetById(id); //初始化栏目类别 var allColumnList = ColumnService.List().ToList(); var dropdownList = new List <ColumnInfo>(); ColumnService.BuildListForTree(dropdownList, allColumnList, 0); ViewBag.ColumnDropDownList = dropdownList; //输出技术分类 ViewBag.TechList = TechService.List().Where(m => m.IsDeleted == false); //输出行业分类 ViewBag.IndustryList = IndustryService.List().Where(m => m.IsDeleted == false); //已选择的技术分类和行业分类 ViewBag.SelectTechList = ArticleService.Article2CategoryListByArticleIdAndType(articleInfo.Id, CatType.Tech); ViewBag.SelectIndustryList = ArticleService.Article2CategoryListByArticleIdAndType(articleInfo.Id, CatType.Industry); string companyName = string.Empty; if (articleInfo.CompanyId > 0) { //对CompanyName进行赋值 //数据库中只保存CompanyId,没有保存CompanyName,只能在这里处理一下 companyName = MemberService.GetBaseCompanyInfo(articleInfo.CompanyId).CompanyName; } ViewBag.CompanyName = companyName; return(View(articleInfo)); }
public ActionResult ChannelList(string alias) { //根据别名获得技术分类详细信息 var techModel = TechService.GetTechInfoByAlias(alias); if (techModel.Id == 0 || techModel.IsDeleted) { return(Content("Argument error.")); } //获得栏目ID int catId = CECRequest.GetQueryInt("catid", 0); var catInfo = ColumnService.GetById(catId); int pageIndex = CECRequest.GetQueryInt("page", 1); var articleList = ArticleService.List(new Models.ArticleSearchSetting() { PageIndex = pageIndex, ColumnIds = new int[] { catId }, TechIds = new int[] { techModel.Id }, IsDeleted = false }); ViewBag.TechInfo = techModel; ViewBag.ColumnInfo = catInfo; ViewBag.ArticleList = articleList; return(View()); }
protected void InitInfo() { categoryId = CECRequest.GetQueryInt("categoryid", 0); Action = CECRequest.GetQueryString("action"); if (Action == "del") { bool isDelete = ArticleCategoryManage.DeleteCategory(categoryId); if (!isDelete) { Page.ClientScript.RegisterStartupScript(this.GetType(), "DelError", "alert('该分类可能有字分类,请先删掉子分类!');window.location.href='categorylist.aspx';", true); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "DeleSuccess", "alert('删除成功!');window.location.href='categorylist.aspx';", true); } return; } this.ddlcategoryList.BuildTree(ArticleCategoryManage.GetArticleCategoryTable(), "CategoryName", "CategoryId"); this.ddlcategoryList.SelectedValue = categoryId.ToString(); if (Action.ToLower() == "edit") { categoryInfo = ArticleCategoryManage.GetArticleCategoryInfo(categoryId); this.ddlcategoryList.SelectedValue = categoryInfo.ParentId.ToString(); } }
/// <summary> /// 新闻中心首页 /// </summary> /// <returns></returns> public ActionResult Index() { /* * 设置_CommmonLayout.cshtml中的变量 */ ViewBag.RootCategoryInfo = ViewBag.CurrentCategoryInfo = CategoryService.Get(GeneralConfig.NewsRootId); //焦点图片 var focus = ArticleService.ListWithoutPage(GeneralConfig.NewsRootId, 4); ViewBag.Focus = focus; int pageIndex = CECRequest.GetQueryInt("page", 1); var allNewsList = ArticleService.List(new ArticleSearchSetting() { PageIndex = pageIndex, CategoryId = GeneralConfig.NewsRootId, IsOnlyShowPublished = true, Title = CECRequest.GetQueryString("key") }); ViewBag.ArticleList = allNewsList; return(View()); }
void InitInfo() { this.ddlcategoryList.BuildTree(ArticleCategoryManage.GetArticleCategoryTable(), "CategoryName", "CategoryId"); categoryId = CECRequest.GetQueryInt("CategoryId", 0); this.ddlcategoryList.SelectedValue = this.SqlDataSource_rptList.SelectParameters[0].DefaultValue = categoryId.ToString(); }
/// <summary> /// 添加或编辑 /// </summary> /// <returns></returns> public ActionResult Create() { int id = CECRequest.GetQueryInt("id", 0); var model = AttachmentService.Get(id); return(View(model)); }
public ActionResult Modify() { int id = CECRequest.GetQueryInt("id", 0); var model = AdPositionService.Get(id); return(View(model)); }
public ActionResult Edit() { int postId = CECRequest.GetQueryInt("id", 0); var model = BlogPostService.Get(postId, PlantEngContext.Current.UserId); return(View(model)); }
public ActionResult ProductCategoryList() { var companyInfo = MemberService.GetCompanyInfoByUserId(PlantEngContext.Current.UserId); if (CECRequest.GetQueryString("action") == "delete") { //删除 int _id = CECRequest.GetQueryInt("Id", 0); bool flag = CompanyProductCategoryService.Delete(_id, companyInfo.CompanyId); if (!flag) { //暂时没有实现 //return JavaScript("<script type=\"text/javascript\">alert('删除失败');</script>"); } Response.Redirect("/accounts/company/productcategorylist"); Response.End(); } int id = CECRequest.GetQueryInt("Id", 0); var model = CompanyProductCategoryService.Get(id, companyInfo.CompanyId); //产品分类 ViewBag.CategoryList = CompanyProductCategoryService.GetCategoryList(companyInfo.CompanyId); return(View(model)); }
public ActionResult SetPublishStatus() { int id = CECRequest.GetFormInt("id", 0); bool status = ArticleService.SetPublishStatus(id, true); //设置为发布 return(Json(new { Status = status })); }
// // GET: /Job/ public ActionResult Index() { /* * 设置_CommmonLayout.cshtml中的变量 */ var root = CategoryService.Get(GeneralConfig.JobRootId); var first = root; if (root.IsShowFirstChildNode) { var _first = CategoryService.ListByParentId(root.Id).Where(p => (p.IsDeleted == false && p.IsEnabled == true)).FirstOrDefault(); if (_first != null) { first = _first; } } ViewBag.RootCategoryInfo = root; ViewBag.CurrentCategoryInfo = first; var list = JobService.List(new JobSearchSetting() { PageIndex = CECRequest.GetQueryInt("page", 1), IsOnlyShowPublished = true }); ViewBag.List = list; return(View()); }
public ActionResult Modify() { int adId = CECRequest.GetQueryInt("Id", 0); var model = AdService.Get(adId); return(View("Create", model)); }
protected void Page_Load(object sender, EventArgs e) { this.btnSearch.Click += new EventHandler(btnSearch_Click); strKeywords = CECRequest.GetQueryString("keywords"); strType = CECRequest.GetQueryString("type"); if (!Page.IsPostBack) { this.txtKey.Text = strKeywords; if (!string.IsNullOrEmpty(strType)) { switch (strType) { case "n": this.rblType.SelectedValue = "n"; break; case "p": this.rblType.SelectedValue = "p"; break; } } Search(this.txtKey.Text, this.rblType.SelectedValue); } this.Page.Title = string.Format("{1} - 搜索 - {0}", System.Configuration.ConfigurationManager.AppSettings["WebSiteTitlePostfix"], strKeywords); }
/// <summary> /// 上传图片 /// </summary> /// <param name="fc"></param> /// <returns></returns> private string _UploadImage(FormCollection fc) { HttpFileCollectionBase files = Request.Files; HttpPostedFileBase postedFile = files[0]; int errorCode = 0; int width = 0; int height = 0; if (CECRequest.GetQueryString("isresize").ToLower() == "true") { //是否裁剪图片 width = CECRequest.GetQueryInt("width", 0); height = CECRequest.GetQueryInt("height", 0); } string fileName = FileUpload.UploadImage(postedFile, width, height, out errorCode); switch (errorCode) { case 1: fileName = "0"; break; case 2: fileName = "1"; break; case 3: fileName = "2"; break; } return(fileName); }
public ActionResult List() { if (Request.HttpMethod.ToUpper() == "POST") { if (CECRequest.GetFormString("action").ToLower() == "del") { //删除 int id = CECRequest.GetFormInt("id", 0); JobService.Delete(id); } if (CECRequest.GetFormString("action").ToLower() == "pub") { //发布 int id = CECRequest.GetFormInt("id", 0); JobService.SetPublish(id, true); } } var list = JobService.List(new JobSearchSetting() { PageSize = 15, PageIndex = CECRequest.GetQueryInt("page", 1), IsOnlyShowPublished = false //false 全部显示 }); ViewBag.List = list; return(View()); }
// // GET: /PagesAdmin/Attach/ /// <summary> /// 列表 /// </summary> /// <returns></returns> public ActionResult List() { if (Request.HttpMethod.ToUpper() == "POST") { if (CECRequest.GetFormString("action").ToLower() == "del") { //删除 int id = CECRequest.GetFormInt("id", 0); AttachmentService.Delete(id); } } int catId = CECRequest.GetQueryInt("catId", 0); if (catId == 0) { catId = Elco.Config.GeneralConfig.DownloadRootId_DE; } var list = AttachmentService.List(new AttachmentSearchSetting() { PageIndex = CECRequest.GetQueryInt("page", 1), PageSize = 15, CategoryId = catId }); ViewBag.List = list; return(View()); }
// // GET: /Adm/Ajax/ public ActionResult AdPositionList() { int pageIndex = CECRequest.GetQueryInt("page", 1); var list = AdPositionService.List(new AdSearchSetting() { PageIndex = pageIndex }); StringBuilder sb = new StringBuilder(); sb.Append("{"); sb.AppendFormat("\"pageIndex\":{0},", pageIndex); sb.AppendFormat("\"totalItemCount\":{0},", list.TotalItemCount); sb.AppendFormat("\"totalPageCount\":{0},", list.TotalPageCount); sb.Append("\"result\":["); int i = 0; foreach (var item in list) { sb.Append("{"); sb.AppendFormat("\"adPositionId\":{0},", item.Id); sb.AppendFormat("\"name\":\"{0}\",", item.Name); sb.AppendFormat("\"size\":\"{0}*{1}\"", item.Width, item.Height); sb.Append("}"); if (i != list.Count - 1) { sb.Append(","); } i++; } sb.Append("]"); sb.Append("}"); return(Content(sb.ToString(), "application/json")); }
/// <summary> /// 追踪 /// </summary> /// <returns></returns> public ActionResult Track() { if (!ElcoHttpContext.Current.IsLogin) { return(Content("<script>alert('请先登录!');window.location.href = '/passport/login';</script>")); //return Content("请先登录!"); } var userInfo = ElcoHttpContext.Current.LoginUserInfo; var guid = CECRequest.GetQueryString("guid"); var info = AttachmentService.GetByGUID(guid); if (info.Id > 0) { //更新Attachment下载次数 AttachmentService.UpdateDownloadCount(info.Id); //记录AttachmentDownloadLog信息 AttachmentService.InsertLog(new AttachmentDownloadLogInfo() { AttachId = info.Id, UserId = userInfo.Id, UserName = userInfo.UserName }); //调转到下载地址 return(Redirect(info.DownloadUrl.TrimEnd())); } return(Content(string.Empty)); }
public ActionResult Rest() { string method = CECRequest.GetQueryString("method").ToLower(); #region == 获得Cookie名称 == if (method == "getkeynameincookies") { ILoginAdapter la = new LoginAdapter(); return(Content(la.CookieName)); } #endregion #region == 获得Cookie值 明文 == if (method == "getvalueincookies") { string encryptCookieValue = CECRequest.GetQueryString("Password"); ILoginAdapter la = new LoginAdapter(); string[] value = la.GetCookieValue(encryptCookieValue).Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); if (value.Length > 5) { return(Content(value[1])); //用户名 } } #endregion return(Content(string.Empty)); }
public ActionResult Add() { int catId = CECRequest.GetQueryInt("id", 0); var model = CategoryService.Get(catId); return(View(model)); }
public ActionResult ApplicationEdit() { int id = CECRequest.GetQueryInt("id", 0); var companyInfo = MemberService.GetCompanyInfoByUserId(PlantEngContext.Current.UserId); var model = CompanyNewsService.Get(id, companyInfo.CompanyId); return(View(model)); }
public void Delete() { int postId = CECRequest.GetQueryInt("id", 0); int userId = PlantEngContext.Current.UserId; BlogPostService.Delete(postId, userId); Response.Redirect("/accounts/blog/", true); }
public ActionResult NewsDetail() { int newsId = CECRequest.GetQueryInt("id", 0); var companyInfo = ViewBag.CompanyInfo; var newsInfo = CompanyNewsService.Get(newsId, companyInfo.CompanyId); return(View(newsInfo)); }
protected void Page_Load(object sender, EventArgs e) { if (CECRequest.GetQueryString("action").ToLower() == "del") { FeedbackMange.Delete(CECRequest.GetQueryInt("id", 0)); Response.Redirect("list.aspx"); } }
public ActionResult Feedback() { var companyInfo = ViewBag.CompanyInfo; int pageIndex = CECRequest.GetQueryInt("page", 1); var frontFeedbackList = CompanyFeedbackService.FrontList(companyInfo.CompanyId, pageIndex, 10); ViewBag.FrontFeedbackList = frontFeedbackList; return(View()); }
public ActionResult Create() { int slotId = CECRequest.GetQueryInt("slotId", 0); var adPositionModel = AdPositionService.Get(slotId); ViewBag.AdPositionModel = adPositionModel; return(View(new AdDeliveryInfo())); }
public ActionResult ProductEdit() { int id = CECRequest.GetQueryInt("id", 0); var companyInfo = MemberService.GetCompanyInfoByUserId(PlantEngContext.Current.UserId); var model = CompanyProductService.Get(id, companyInfo.CompanyId); //产品分类 ViewBag.CategoryList = CompanyProductCategoryService.GetCategoryList(companyInfo.CompanyId); return(View(model)); }
// // GET: /Member/Home/ /// <summary> /// 基本用户列表 /// </summary> /// <returns></returns> public ActionResult List() { var list = MemberService.BaseInfoList(new MemberSearchSetting() { PageIndex = CECRequest.GetQueryInt("page", 1), UserName = CECRequest.GetQueryString("username") }); ViewBag.MemberList = list; return(View()); }
public ActionResult ShowThread(int?id) { int topicId = id.HasValue ? Convert.ToInt32(id.Value) : 0; var topicInfo = ForumTopicService.Get(topicId); int pageIndex = CECRequest.GetQueryInt("page", 1); ///是否显示主题,除了第一页显示主题页外,其它页不显示主题 bool showTopic = false; if (topicInfo.Id == 0 || topicInfo.IsDeleted) { return(new TipView() { Msg = ErrorMsg.THREADNOTEXISTS }); } ///板块信息,用于导航 var forumInfo = ForumService.Get(topicInfo.ForumId); //检查用户是否查看的权限 //获取通过审核的用户,只有审核通过的用户才能查看论坛 var userInfo = UserService.Get(User.Identity.Name); if (!CheckApplyUserAuth(userInfo.Id, forumInfo.GroupId)) { return(new TipView() { Msg = ErrorMsg.APPLYNOTPASS }); } //更新查看数 if (pageIndex <= 1) { //只有在第一页的时候,才更新浏览数 ForumTopicService.UpdateTopicViewCount(topicInfo.Id); showTopic = true; } ViewBag.ShowTopic = showTopic; ViewBag.ForumInfo = forumInfo; ViewBag.LoginUserInfo = userInfo; ///回帖列表 var replyList = ForumTopicService.ReplyList(new ForumSearchSetting() { ForumId = topicInfo.ForumId, TopicId = topicInfo.Id, PageIndex = pageIndex }); ViewBag.ReplyList = replyList; //是否是版主 ViewBag.IsModerator = ForumService.IsModerator(userInfo.Id, forumInfo.Id); return(View(topicInfo)); }
/// <summary> /// 日志列表 /// </summary> /// <returns></returns> public ActionResult LogList() { var list = AttachmentService.ListLog(CECRequest.GetQueryInt("attachId", 0), new SearchSetting() { PageIndex = CECRequest.GetQueryInt("page", 1), PageSize = 15 }); ViewBag.List = list; return(View()); }