Ejemplo n.º 1
0
 public void SetNewsListPublished(int id, EnumNewsListType listType, int publishedState)
 {
     BizNewsList.Update(x => x.NewsID == id && x.ListType == (int)listType, x => new NewsList() { IsPublished = publishedState });
 }
Ejemplo n.º 2
0
 public ActionResult SetNewsList(int id, EnumNewsListType listType)
 {
     News news = BizNews.Get(id);
     NewsList nl = new NewsList()
     {
         IsPublished = (int)EnumPublishState.����,
         ListType = (int)listType,
         NewsID = id,
          AddTime=DateTime.Now
     };
     BizNewsList.Insert(nl);
     return Content(Convert.ToString((int)EnumOperateState.�ɹ�));
 }
Ejemplo n.º 3
0
 public ActionResult EditSingleNewsList(int id, EnumNewsListType listType)
 {
     News news = BizNews.Get(id);
     ViewData["News"] = news;
     return View();
 }
Ejemplo n.º 4
0
        public ActionResult EditSingleNewsList(int id, EnumNewsListType listType, string txt_width, string txt_height, string txt_top, string txt_left, string txt_DropWidth, string txt_DropHeight)
        {
            int imageWidth = Int32.Parse(txt_width);
            int imageHeight = Int32.Parse(txt_height);
            int cutTop = Int32.Parse(txt_top);
            int cutLeft = (int)double.Parse(txt_left);
            int dropWidth = Int32.Parse(txt_DropWidth);
            int dropHeight = Int32.Parse(txt_DropHeight);
            News news = BizNews.Get(id);
            string folder = "";
            switch (listType)
            {
                case EnumNewsListType.��ҳ��ͼƬ��������:
                    folder = Hotnet.Biz.Properties.Settings.Default.��ҳ��ͼƬ���������ļ���;
                    break;
                case EnumNewsListType.��ҳ��ͼƬ��������:
                    folder = "";
                    break;
                case EnumNewsListType.���ཹ������:
                    folder = Hotnet.Biz.Properties.Settings.Default.���ཹ�������ļ���;
                    break;
                default:
                    break;
            }
            NewsList nl = new NewsList();
            nl.NewsID = news.NewsID;
            nl.IsPublished = (int)EnumPublishState.����;
            nl.ListType = (int)listType;
            nl.AddTime = DateTime.Now;

            string imageName = null;
            string dir = StringUtility.GetSavePath(id, out imageName);
            string LocalPath = dir + imageName + "_o" + Path.GetExtension(news.ImagePath);

            string filename = CutPhotoHelp.SaveCutPic(Server.MapPath(news.ImagePath), Server.MapPath(folder + LocalPath), 0, 0, dropWidth,
                                    dropHeight, cutLeft, cutTop, imageWidth, imageHeight);
            nl.CoverImageSrc = LocalPath;

            BizNewsList.Delete(nl.NewsID, listType);
            BizNewsList.Insert(nl);

            return RedirectToAction("SetNewsList", new { id = news.NewsID, listType = (int)listType });
        }
Ejemplo n.º 5
0
 public void DeleteNewsList(int id, EnumNewsListType listType)
 {
     BizNewsList.Delete(id, listType);
 }