From b89a78652c4da1e5287ede66c795be7e90026fbb Mon Sep 17 00:00:00 2001 From: "DESKTOP-CLI22EN\\HogenWang" Date: Sun, 22 Apr 2018 00:25:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=87=B3=E5=A4=A7=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- COMCMS.Core/Models/JsonTip.cs | 22 +- .../AdminCP/Controllers/OtherController.cs | 472 +++++++++++------- .../Areas/AdminCP/Views/Other/AddAds.cshtml | 274 ++++++++++ .../Areas/AdminCP/Views/Other/AddLink.cshtml | 86 ++++ .../Views/Other/AdsCategoryList.cshtml | 95 ++++ .../Areas/AdminCP/Views/Other/AdsList.cshtml | 157 ++++++ .../Areas/AdminCP/Views/Other/EditAds.cshtml | 334 +++++++++++++ .../Areas/AdminCP/Views/Other/EditLink.cshtml | 89 ++++ .../Views/Other/LinkCategoryList.cshtml | 95 ++++ .../Areas/AdminCP/Views/Other/LinkList.cshtml | 145 ++++++ COMCMS.Web/Controllers/HomeController.cs | 17 + 11 files changed, 1591 insertions(+), 195 deletions(-) create mode 100644 COMCMS.Web/Areas/AdminCP/Views/Other/AddAds.cshtml create mode 100644 COMCMS.Web/Areas/AdminCP/Views/Other/AddLink.cshtml create mode 100644 COMCMS.Web/Areas/AdminCP/Views/Other/AdsCategoryList.cshtml create mode 100644 COMCMS.Web/Areas/AdminCP/Views/Other/AdsList.cshtml create mode 100644 COMCMS.Web/Areas/AdminCP/Views/Other/EditAds.cshtml create mode 100644 COMCMS.Web/Areas/AdminCP/Views/Other/EditLink.cshtml create mode 100644 COMCMS.Web/Areas/AdminCP/Views/Other/LinkCategoryList.cshtml create mode 100644 COMCMS.Web/Areas/AdminCP/Views/Other/LinkList.cshtml diff --git a/COMCMS.Core/Models/JsonTip.cs b/COMCMS.Core/Models/JsonTip.cs index 299c7cb..597c47a 100644 --- a/COMCMS.Core/Models/JsonTip.cs +++ b/COMCMS.Core/Models/JsonTip.cs @@ -60,16 +60,16 @@ namespace COMCMS.Core } } - public static class Extension - { - public static void EchoTip(this JsonTip json) - { - string strJson = JsonTip.GetJsonString(json); + //public static class Extension + //{ + // public static void EchoTip(this JsonTip json) + // { + // string strJson = JsonTip.GetJsonString(json); - Byte[] bytes = Encoding.UTF8.GetBytes(strJson); - Stream stream = new MemoryStream(bytes); - MyHttpContext.Current.Response.ContentType = "text/plain"; - MyHttpContext.Current.Response.Body = stream; - } - } + // Byte[] bytes = Encoding.UTF8.GetBytes(strJson); + // Stream stream = new MemoryStream(bytes); + // MyHttpContext.Current.Response.ContentType = "text/plain"; + // MyHttpContext.Current.Response.Body = stream; + // } + //} } diff --git a/COMCMS.Web/Areas/AdminCP/Controllers/OtherController.cs b/COMCMS.Web/Areas/AdminCP/Controllers/OtherController.cs index 541e806..289cf3a 100644 --- a/COMCMS.Web/Areas/AdminCP/Controllers/OtherController.cs +++ b/COMCMS.Web/Areas/AdminCP/Controllers/OtherController.cs @@ -149,7 +149,147 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers DateTime StartTime, EndTime; StartTime = Convert.ToDateTime("2000-01-01"); EndTime = Convert.ToDateTime("2999-01-01"); - GetRequestAdsString(model.TId, ref content); + #region 获取数据 + switch (model.TId) + { + case 0://代码 + ScriptAds script = new ScriptAds(); + script.content = Request.Form["txtScript"]; + if (string.IsNullOrEmpty(script.content)) + { + tip.Message = "代码不能为空!"; + return Json(tip); + } + content = JsonConvert.SerializeObject(script); + break; + case 1://文字 + TextAds text = new TextAds(); + text.txt = Request.Form["txt_Txt"]; + text.link = Request.Form["txt_Link"]; + text.style = Request.Form["txt_Style"]; + if (string.IsNullOrEmpty(text.txt)) + { + tip.Message = "文字内容不能为空!"; + return Json(tip); + } + if (string.IsNullOrEmpty(text.link)) + { + tip.Message = "文字链接不能为空!"; + return Json(tip); + } + content = JsonConvert.SerializeObject(text); + break; + case 2://图片 + ImgAds img = new ImgAds(); + img.img = Request.Form["img_Img"]; + img.link = Request.Form["img_Link"]; + img.alt = Request.Form["img_Alt"]; + string iw = Request.Form["img_Width"]; + string ih = Request.Form["img_Height"]; + if (!string.IsNullOrEmpty(iw) && Utils.IsInt(iw)) + img.width = int.Parse(iw); + if (!string.IsNullOrEmpty(ih) && Utils.IsInt(ih)) + img.height = int.Parse(ih); + if (string.IsNullOrEmpty(img.img)) + { + tip.Message = "图片地址不能为空!"; + return Json(tip); + } + if (string.IsNullOrEmpty(img.link)) + { + tip.Message = "图片链接不能为空!"; + return Json(tip); + } + content = JsonConvert.SerializeObject(img); + break; + case 3://Flash + FlashAds flash = new FlashAds(); + flash.swf = Request.Form["flash_Swf"]; + string fw = Request.Form["flash_Width"]; + string fh = Request.Form["flash_Height"]; + if (string.IsNullOrEmpty(flash.swf)) + { + tip.Message = "Flash 地址不能为空!"; + return Json(tip); + } + + if (string.IsNullOrEmpty(fw) || !Utils.IsInt(fw)) + { + tip.Message = "Flash 宽度不能为空或者不是整数!"; + return Json(tip); + } + else + { + flash.width = int.Parse(fw); + } + if (string.IsNullOrEmpty(fh) || !Utils.IsInt(fh)) + { + tip.Message = "Flash 高度不能为空或者不是整数!"; + return Json(tip); + } + else + { + flash.height = int.Parse(fh); + } + content = JsonConvert.SerializeObject(flash); + break; + case 4://幻灯片 + string sw = Request.Form["slide_Width"]; + string sh = Request.Form["slide_Height"]; + if (string.IsNullOrEmpty(sw) || !Utils.IsInt(sw)) + { + tip.Message = "幻灯片宽度不能为空或者不是整数!"; + return Json(tip); + } + if (string.IsNullOrEmpty(sh) || !Utils.IsInt(sh)) + { + tip.Message = "幻灯片高度不能为空或者不是整数!"; + return Json(tip); ; + } + string[] arrsimg = Request.Form["slide_Img"];// SImg.Split(new string[] { "," }, StringSplitOptions.None); + string[] arrslink = Request.Form["slide_Link"]; //SLink.Split(new string[] { "," }, StringSplitOptions.None); + string[] arralt = Request.Form["slide_Alt"]; //SAlt.Split(new string[] { "," }, StringSplitOptions.None); + List listimg = new List(); + for (int i = 0; i < arrsimg.Length; i++) + { + if (!string.IsNullOrEmpty(arrsimg[i]) && !string.IsNullOrEmpty(arrslink[i]))//图片跟地址都不为空 + { + ImgAds tplimgads = new ImgAds(); + tplimgads.img = arrsimg[i]; + tplimgads.link = arrslink[i]; + tplimgads.height = int.Parse(sh); + tplimgads.width = int.Parse(sw); + tplimgads.alt = arralt[i]; + listimg.Add(tplimgads); + } + } + if (listimg == null || listimg.Count <= 0) + { + tip.Message = "幻灯片请至少添加一张图片!"; + return Json(tip); ; + } + content = JsonConvert.SerializeObject(listimg); + break; + case 7://视频广告 + VideoAds video = new VideoAds(); + video.poster = Request.Form["video_Poster"]; + video.src = Request.Form["video_Src"]; + video.title = Request.Form["video_Title"]; + string vw = Request.Form["video_Width"]; + string vh = Request.Form["video_Height"]; + if (!string.IsNullOrEmpty(vw) && Utils.IsInt(vw)) + video.width = int.Parse(vw); + if (!string.IsNullOrEmpty(vh) && Utils.IsInt(vh)) + video.height = int.Parse(vh); + if (string.IsNullOrEmpty(video.src)) + { + tip.Message = "视频广告地址不能为空!"; + return Json(tip); + } + content = JsonConvert.SerializeObject(video); + break; + } + #endregion model.StartTime = StartTime; model.EndTime = EndTime; model.Content = content; @@ -207,7 +347,149 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers DateTime StartTime, EndTime; StartTime = Convert.ToDateTime("2000-01-01"); EndTime = Convert.ToDateTime("2999-01-01"); - GetRequestAdsString(model.TId, ref content); + + #region 获取数据 + switch (model.TId) + { + case 0://代码 + ScriptAds script = new ScriptAds(); + script.content = Request.Form["txtScript"]; + if (string.IsNullOrEmpty(script.content)) + { + tip.Message = "代码不能为空!"; + return Json(tip); + } + content = JsonConvert.SerializeObject(script); + break; + case 1://文字 + TextAds text = new TextAds(); + text.txt = Request.Form["txt_Txt"]; + text.link = Request.Form["txt_Link"]; + text.style = Request.Form["txt_Style"]; + if (string.IsNullOrEmpty(text.txt)) + { + tip.Message = "文字内容不能为空!"; + return Json(tip); + } + if (string.IsNullOrEmpty(text.link)) + { + tip.Message = "文字链接不能为空!"; + return Json(tip); + } + content = JsonConvert.SerializeObject(text); + break; + case 2://图片 + ImgAds img = new ImgAds(); + img.img = Request.Form["img_Img"]; + img.link = Request.Form["img_Link"]; + img.alt = Request.Form["img_Alt"]; + string iw = Request.Form["img_Width"]; + string ih = Request.Form["img_Height"]; + if (!string.IsNullOrEmpty(iw) && Utils.IsInt(iw)) + img.width = int.Parse(iw); + if (!string.IsNullOrEmpty(ih) && Utils.IsInt(ih)) + img.height = int.Parse(ih); + if (string.IsNullOrEmpty(img.img)) + { + tip.Message = "图片地址不能为空!"; + return Json(tip); + } + if (string.IsNullOrEmpty(img.link)) + { + tip.Message = "图片链接不能为空!"; + return Json(tip); + } + content = JsonConvert.SerializeObject(img); + break; + case 3://Flash + FlashAds flash = new FlashAds(); + flash.swf = Request.Form["flash_Swf"]; + string fw = Request.Form["flash_Width"]; + string fh = Request.Form["flash_Height"]; + if (string.IsNullOrEmpty(flash.swf)) + { + tip.Message = "Flash 地址不能为空!"; + return Json(tip); + } + + if (string.IsNullOrEmpty(fw) || !Utils.IsInt(fw)) + { + tip.Message = "Flash 宽度不能为空或者不是整数!"; + return Json(tip); + } + else + { + flash.width = int.Parse(fw); + } + if (string.IsNullOrEmpty(fh) || !Utils.IsInt(fh)) + { + tip.Message = "Flash 高度不能为空或者不是整数!"; + return Json(tip); + } + else + { + flash.height = int.Parse(fh); + } + content = JsonConvert.SerializeObject(flash); + break; + case 4://幻灯片 + string sw = Request.Form["slide_Width"]; + string sh = Request.Form["slide_Height"]; + if (string.IsNullOrEmpty(sw) || !Utils.IsInt(sw)) + { + tip.Message = "幻灯片宽度不能为空或者不是整数!"; + return Json(tip); + } + if (string.IsNullOrEmpty(sh) || !Utils.IsInt(sh)) + { + tip.Message = "幻灯片高度不能为空或者不是整数!"; + return Json(tip); ; + } + string[] arrsimg = Request.Form["slide_Img"];// SImg.Split(new string[] { "," }, StringSplitOptions.None); + string[] arrslink = Request.Form["slide_Link"]; //SLink.Split(new string[] { "," }, StringSplitOptions.None); + string[] arralt = Request.Form["slide_Alt"]; //SAlt.Split(new string[] { "," }, StringSplitOptions.None); + List listimg = new List(); + for (int i = 0; i < arrsimg.Length; i++) + { + if (!string.IsNullOrEmpty(arrsimg[i]) && !string.IsNullOrEmpty(arrslink[i]))//图片跟地址都不为空 + { + ImgAds tplimgads = new ImgAds(); + tplimgads.img = arrsimg[i]; + tplimgads.link = arrslink[i]; + tplimgads.height = int.Parse(sh); + tplimgads.width = int.Parse(sw); + tplimgads.alt = arralt[i]; + listimg.Add(tplimgads); + } + } + if (listimg == null || listimg.Count <= 0) + { + tip.Message = "幻灯片请至少添加一张图片!"; + return Json(tip); ; + } + content = JsonConvert.SerializeObject(listimg); + break; + case 7://视频广告 + VideoAds video = new VideoAds(); + video.poster = Request.Form["video_Poster"]; + video.src = Request.Form["video_Src"]; + video.title = Request.Form["video_Title"]; + string vw = Request.Form["video_Width"]; + string vh = Request.Form["video_Height"]; + if (!string.IsNullOrEmpty(vw) && Utils.IsInt(vw)) + video.width = int.Parse(vw); + if (!string.IsNullOrEmpty(vh) && Utils.IsInt(vh)) + video.height = int.Parse(vh); + if (string.IsNullOrEmpty(video.src)) + { + tip.Message = "视频广告地址不能为空!"; + return Json(tip); + } + content = JsonConvert.SerializeObject(video); + break; + } + #endregion + model.StartTime = StartTime; model.EndTime = EndTime; model.Content = content; @@ -239,186 +521,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers return Json(tip); } - #region 获取广告代码 - /// - /// 获取 - /// - /// ID - /// - private void GetRequestAdsString(int tid, ref string adsString) - { - JsonTip mytip = new JsonTip(); - mytip.Status = JsonTip.ERROR; - - string str = ""; - switch (tid) - { - case 0://代码 - ScriptAds script = new ScriptAds(); - script.content = Request.Form["txtScript"]; - if (string.IsNullOrEmpty(script.content)) - { - mytip.Message = "代码不能为空!"; - mytip.EchoTip(); - return; - } - else - { - str = JsonConvert.SerializeObject(script); - } - break; - case 1://文字类 - TextAds text = new TextAds(); - text.txt = Request.Form["txt_Txt"]; - text.link = Request.Form["txt_Link"]; - text.style = Request.Form["txt_Style"]; - if (string.IsNullOrEmpty(text.txt)) - { - mytip.Message = "文字内容不能为空!"; - mytip.EchoTip(); - return; - } - if (string.IsNullOrEmpty(text.link)) - { - mytip.Message = "文字链接不能为空!"; - mytip.EchoTip(); - return; - } - str = JsonConvert.SerializeObject(text); - break; - case 2://图片类 - ImgAds img = new ImgAds(); - img.img = Request.Form["img_Img"]; - img.link = Request.Form["img_Link"]; - img.alt = Request.Form["img_Alt"]; - string iw = Request.Form["img_Width"]; - string ih = Request.Form["img_Height"]; - if (!string.IsNullOrEmpty(iw) && Utils.IsInt(iw)) - img.width = int.Parse(iw); - if (!string.IsNullOrEmpty(ih) && Utils.IsInt(ih)) - img.height = int.Parse(ih); - if (string.IsNullOrEmpty(img.img)) - { - mytip.Message = "图片地址不能为空!"; - mytip.EchoTip(); - return; - } - if (string.IsNullOrEmpty(img.link)) - { - mytip.Message = "图片链接不能为空!"; - mytip.EchoTip(); - return; - } - str = JsonConvert.SerializeObject(img); - break; - case 3://Flash类 - FlashAds flash = new FlashAds(); - flash.swf = Request.Form["flash_Swf"]; - string fw = Request.Form["flash_Width"]; - string fh = Request.Form["flash_Height"]; - if (string.IsNullOrEmpty(flash.swf)) - { - mytip.Message = "Flash 地址不能为空!"; - mytip.EchoTip(); - return; - } - - if (string.IsNullOrEmpty(fw) || !Utils.IsInt(fw)) - { - mytip.Message = "Flash 宽度不能为空或者不是整数!"; - mytip.EchoTip(); - return; - } - else - { - flash.width = int.Parse(fw); - } - - if (string.IsNullOrEmpty(fh) || !Utils.IsInt(fh)) - { - mytip.Message = "Flash 高度不能为空或者不是整数!"; - mytip.EchoTip(); - return; - } - else - { - flash.height = int.Parse(fh); - } - str = JsonConvert.SerializeObject(flash); - break; - case 4://幻灯片 - string sw = Request.Form["slide_Width"]; - string sh = Request.Form["slide_Height"]; - if (string.IsNullOrEmpty(sw) || !Utils.IsInt(sw)) - { - mytip.Message = "幻灯片宽度不能为空或者不是整数!"; - mytip.EchoTip(); - return; - } - if (string.IsNullOrEmpty(sh) || !Utils.IsInt(sh)) - { - mytip.Message = "幻灯片高度不能为空或者不是整数!"; - mytip.EchoTip(); - return; - } - string SImg = Request.Form["slide_Img"]; - string SLink = Request.Form["slide_Link"]; - string SAlt = Request.Form["slide_Alt"]; - if (string.IsNullOrEmpty(SImg)) - { - mytip.Message = "幻灯片图片不能为空!"; - mytip.EchoTip(); - return; - } - if (string.IsNullOrEmpty(SLink)) - { - mytip.Message = "幻灯片图片链接不能为空!"; - mytip.EchoTip(); - return; - } - string[] arrsimg = SImg.Split(new string[] { "," }, StringSplitOptions.None); - string[] arrslink = SLink.Split(new string[] { "," }, StringSplitOptions.None); - string[] arralt = SAlt.Split(new string[] { "," }, StringSplitOptions.None); - List listimg = new List(); - for (int i = 0; i < arrsimg.Length; i++) - { - if (!string.IsNullOrEmpty(arrsimg[i]) && !string.IsNullOrEmpty(arrslink[i]))//图片跟地址都不为空 - { - ImgAds tplimgads = new ImgAds(); - tplimgads.img = arrsimg[i]; - tplimgads.link = arrslink[i]; - tplimgads.height = int.Parse(sh); - tplimgads.width = int.Parse(sw); - tplimgads.alt = arralt[i]; - //listimg.Add(new ImgAds { img = arrsimg[i], link = arrslink[i], height = int.Parse(sh), width = int.Parse(sw), alt = arralt[i] }); - listimg.Add(tplimgads); - } - } - str = JsonConvert.SerializeObject(listimg); - break; - case 7://视频广告 - VideoAds video = new VideoAds(); - video.poster = Request.Form["video_Poster"]; - video.src = Request.Form["video_Src"]; - video.title = Request.Form["video_Title"]; - string vw = Request.Form["video_Width"]; - string vh = Request.Form["video_Height"]; - if (!string.IsNullOrEmpty(vw) && Utils.IsInt(vw)) - video.width = int.Parse(vw); - if (!string.IsNullOrEmpty(vh) && Utils.IsInt(vh)) - video.height = int.Parse(vh); - if (string.IsNullOrEmpty(video.src)) - { - mytip.Message = "视频广告地址不能为空!"; - mytip.EchoTip(); - return; - } - str = JsonConvert.SerializeObject(video); - break; - } - adsString = str; - } - #endregion + #endregion @@ -442,6 +545,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers tip.Message = "广告分类名称不能为空!"; return Json(tip); } + model.Insert(); tip.Status = JsonTip.SUCCESS; tip.Message = "添加友情链接分类成功"; @@ -557,7 +661,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers tip.Message = "网站链接不能为空!"; return Json(tip); } - + model.IsHide = Request.Form["IsHide"] == "1"; model.Insert(); tip.Status = JsonTip.SUCCESS; @@ -608,7 +712,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers tip.Message = "系统找不到本记录!"; return Json(tip); } - + model.IsHide = Request.Form["IsHide"] == "1"; model.Update(); tip.Status = JsonTip.SUCCESS; diff --git a/COMCMS.Web/Areas/AdminCP/Views/Other/AddAds.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Other/AddAds.cshtml new file mode 100644 index 0000000..a6d361c --- /dev/null +++ b/COMCMS.Web/Areas/AdminCP/Views/Other/AddAds.cshtml @@ -0,0 +1,274 @@ + +@{ + ViewBag.title = "添加广告"; +} +
+
+
+
@ViewBag.title
+
+
+
+
+ @using (Html.BeginForm(null, null, FormMethod.Post, new { id = "addAdsForm", @class = "form-horizontal m-t" })) + { +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + + + + + + + + + + + + + + + + +
图片(必填)链接地址(必填)图片标题操作
+
+
+
+ +
+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ + +
+
+
+ + +
+
+ } +
+
+ + +
+ + \ No newline at end of file diff --git a/COMCMS.Web/Areas/AdminCP/Views/Other/AddLink.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Other/AddLink.cshtml new file mode 100644 index 0000000..027b8fd --- /dev/null +++ b/COMCMS.Web/Areas/AdminCP/Views/Other/AddLink.cshtml @@ -0,0 +1,86 @@ + +@{ + ViewBag.title = "添加友情链接"; +} +
+
+
+
@ViewBag.title
+
+
+
+
+ @using (Html.BeginForm(null, null, FormMethod.Post, new { id = "addLinkForm", @class = "form-horizontal m-t" })) + { +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+ + +
+
+ } +
+
+ + +
+ diff --git a/COMCMS.Web/Areas/AdminCP/Views/Other/AdsCategoryList.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Other/AdsCategoryList.cshtml new file mode 100644 index 0000000..0831d48 --- /dev/null +++ b/COMCMS.Web/Areas/AdminCP/Views/Other/AdsCategoryList.cshtml @@ -0,0 +1,95 @@ +@model IList +@{ + ViewBag.title = "广告分类管理"; +} +
+
+
+
@ViewBag.title
+
+
+
+ +
+ +
+ +
+
+ + + + + + + + + + + @if (Model.Count == 0) + { + + } + @foreach (var m in Model) + { + + + + + + + + } + + + + + + + +
ID类别名称排序简单说明操作
暂无记录
+
@m.Id
+ +
+
@m.KindName
+ +
+
@m.Rank
+ +
+
@m.KindInfo
+ +
+ + +
+
+
+
+ + +
+ diff --git a/COMCMS.Web/Areas/AdminCP/Views/Other/AdsList.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Other/AdsList.cshtml new file mode 100644 index 0000000..1011655 --- /dev/null +++ b/COMCMS.Web/Areas/AdminCP/Views/Other/AdsList.cshtml @@ -0,0 +1,157 @@ + +@{ + ViewBag.title = "广告管理"; +} +
+
+
+
@ViewBag.title
+
+
+
+
+
+
筛选条件
+
+
+
+ + + + + + +
+
+
+
+
+ +
+
+ + +
+
+ + +
+ diff --git a/COMCMS.Web/Areas/AdminCP/Views/Other/EditAds.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Other/EditAds.cshtml new file mode 100644 index 0000000..3604509 --- /dev/null +++ b/COMCMS.Web/Areas/AdminCP/Views/Other/EditAds.cshtml @@ -0,0 +1,334 @@ +@model COMCMS.Core.Ads +@{ + ViewBag.Title = "添加广告"; + if (string.IsNullOrEmpty(Model.Content)) + { + Model.Content = "[]"; + } +} +
+
+
+
@ViewBag.Title
+
+
+
+
+ @using (Html.BeginForm(null, null, FormMethod.Post, new { id = "editAdsForm", @class = "form-horizontal m-t" })) + { +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + + + + + + + + + + + + + + + + +
图片(必填)链接地址(必填)图片标题操作
+
+
+
+ +
+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ + +
+
+
+ + + +
+
+ } +
+
+ + +
+ + \ No newline at end of file diff --git a/COMCMS.Web/Areas/AdminCP/Views/Other/EditLink.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Other/EditLink.cshtml new file mode 100644 index 0000000..f45f23f --- /dev/null +++ b/COMCMS.Web/Areas/AdminCP/Views/Other/EditLink.cshtml @@ -0,0 +1,89 @@ +@model COMCMS.Core.Link +@{ + ViewBag.title = "编辑友情链接"; +} +
+
+
+
@ViewBag.title
+
+
+
+
+ @using (Html.BeginForm(null, null, FormMethod.Post, new { id = "editLinkForm", @class = "form-horizontal m-t" })) + { +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+ + + +
+
+ } +
+
+ + +
+ diff --git a/COMCMS.Web/Areas/AdminCP/Views/Other/LinkCategoryList.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Other/LinkCategoryList.cshtml new file mode 100644 index 0000000..46d109d --- /dev/null +++ b/COMCMS.Web/Areas/AdminCP/Views/Other/LinkCategoryList.cshtml @@ -0,0 +1,95 @@ +@model IList +@{ + + ViewBag.title = "友情链接分类管理"; +} +
+
+
+
@ViewBag.title
+
+
+
+ +
+ +
+ +
+
+ + + + + + + + + + + @if (Model.Count == 0) + { + + } + @foreach (var m in Model) + { + + + + + + + + } + + + + + + + +
ID类别名称排序简单说明操作
暂无记录
+
@m.Id
+ +
+
@m.KindName
+ +
+
@m.Rank
+ +
+
@m.KindInfo
+ +
+ + +
+
+
+
+ + +
\ No newline at end of file diff --git a/COMCMS.Web/Areas/AdminCP/Views/Other/LinkList.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Other/LinkList.cshtml new file mode 100644 index 0000000..5329162 --- /dev/null +++ b/COMCMS.Web/Areas/AdminCP/Views/Other/LinkList.cshtml @@ -0,0 +1,145 @@ + +@{ + ViewBag.title = "友情链接管理"; +} +
+
+
+
@ViewBag.title
+
+
+
+
+
+
筛选条件
+
+
+
+ + + + + + +
+
+
+
+
+ +
+
+ + +
+
+ + +
diff --git a/COMCMS.Web/Controllers/HomeController.cs b/COMCMS.Web/Controllers/HomeController.cs index 74b98ef..b051394 100644 --- a/COMCMS.Web/Controllers/HomeController.cs +++ b/COMCMS.Web/Controllers/HomeController.cs @@ -8,6 +8,8 @@ using COMCMS.Web.Models; using COMCMS.Common; using COMCMS.Core; using XCode; +using System.Text; +using System.IO; namespace COMCMS.Web.Controllers { @@ -43,5 +45,20 @@ namespace COMCMS.Web.Controllers { return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); } + + #region 测试 + public IActionResult Test() + { + JsonTip json = new JsonTip(); + string strJson = JsonTip.GetJsonString(json); + + //Byte[] bytes = Encoding.UTF8.GetBytes(strJson); + //Stream stream = new MemoryStream(bytes); + //MyHttpContext.Current.Response.ContentType = "text/plain"; + //MyHttpContext.Current.Response.Body = stream; + + return Content("ok"); + } + #endregion } }