|
|
@@ -12,7 +12,7 @@ using Microsoft.AspNetCore.Mvc;
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
using Microsoft.Extensions.Options;
|
|
|
-using MySystem.BsModels;
|
|
|
+using MySystem.Models;
|
|
|
using Library;
|
|
|
using LitJson;
|
|
|
using MySystemLib;
|
|
|
@@ -25,7 +25,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
public MsgPersonalController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
|
|
|
{
|
|
|
- OtherMySqlConn.connstr = ConfigurationManager.AppSettings["BsSqlConnStr"].ToString();
|
|
|
+ OtherMySqlConn.connstr = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
|
|
|
}
|
|
|
|
|
|
#region 个人消息列表
|
|
|
@@ -82,7 +82,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
|
|
|
}
|
|
|
|
|
|
- Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).IndexData("MsgPersonal", Fields, "Id desc", "0", page, limit, condition);
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MsgPersonal", Fields, "Id desc", "0", page, limit, condition);
|
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
|
{
|
|
|
@@ -153,7 +153,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("PushFlag", data.PushFlag); //推送标记
|
|
|
Fields.Add("Remark", data.Remark); //备注
|
|
|
Fields.Add("Status", 1);
|
|
|
- int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).Add("MsgPersonal", Fields, 0);
|
|
|
+ int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("MsgPersonal", Fields, 0);
|
|
|
AddSysLog(data.Id.ToString(), "MsgPersonal", "add");
|
|
|
bsdb.SaveChanges();
|
|
|
SetRedis(Id);
|
|
|
@@ -184,7 +184,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("PushFlag", data.PushFlag); //推送标记
|
|
|
Fields.Add("Remark", data.Remark); //备注
|
|
|
Fields.Add("Status", 1);
|
|
|
- int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).Add("MsgPersonal", Fields, 0);
|
|
|
+ int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("MsgPersonal", Fields, 0);
|
|
|
AddSysLog(data.Id.ToString(), "MsgPersonal", "add");
|
|
|
bsdb.SaveChanges();
|
|
|
SetRedis(Id);
|
|
|
@@ -215,7 +215,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
ViewBag.right = right;
|
|
|
|
|
|
|
|
|
- MsgPersonal editData = bsdb.MsgPersonal.FirstOrDefault(m => m.Id == Id) ?? new MsgPersonal();
|
|
|
+ MsgPersonal editData = db.MsgPersonal.FirstOrDefault(m => m.Id == Id) ?? new MsgPersonal();
|
|
|
ViewBag.data = editData;
|
|
|
return View();
|
|
|
}
|
|
|
@@ -250,7 +250,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("SeoTitle", data.SeoTitle);
|
|
|
Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
|
Fields.Add("SeoDescription", data.SeoDescription);
|
|
|
- new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).Edit("MsgPersonal", Fields, data.Id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MsgPersonal", Fields, data.Id);
|
|
|
AddSysLog(data.Id.ToString(), "MsgPersonal", "update");
|
|
|
bsdb.SaveChanges();
|
|
|
SetRedis(data.Id, "edit");
|
|
|
@@ -275,7 +275,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int id = int.Parse(subid);
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("Status", -1);
|
|
|
- new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).Edit("MsgPersonal", Fields, id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MsgPersonal", Fields, id);
|
|
|
}
|
|
|
bsdb.SaveChanges();
|
|
|
|
|
|
@@ -299,7 +299,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int id = int.Parse(subid);
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("PushFlag", 1);
|
|
|
- new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).Edit("MsgPersonal", Fields, id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MsgPersonal", Fields, id);
|
|
|
}
|
|
|
bsdb.SaveChanges();
|
|
|
return "success";
|
|
|
@@ -322,7 +322,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int id = int.Parse(subid);
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("Status", 1);
|
|
|
- new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).Edit("MsgPersonal", Fields, id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MsgPersonal", Fields, id);
|
|
|
}
|
|
|
bsdb.SaveChanges();
|
|
|
return "success";
|
|
|
@@ -345,7 +345,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int id = int.Parse(subid);
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("Status", 0);
|
|
|
- new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).Edit("MsgPersonal", Fields, id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MsgPersonal", Fields, id);
|
|
|
}
|
|
|
bsdb.SaveChanges();
|
|
|
return "success";
|
|
|
@@ -360,7 +360,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// <param name="Id"></param>
|
|
|
public string Sort(int Id, int Sort)
|
|
|
{
|
|
|
- new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).Sort("MsgPersonal", Sort, Id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Sort("MsgPersonal", Sort, Id);
|
|
|
|
|
|
AddSysLog(Id.ToString(), "MsgPersonal", "sort");
|
|
|
return "success";
|
|
|
@@ -380,13 +380,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
JsonData dr = list[i];
|
|
|
|
|
|
- bsdb.MsgPersonal.Add(new MsgPersonal()
|
|
|
+ db.MsgPersonal.Add(new MsgPersonal()
|
|
|
{
|
|
|
CreateDate = DateTime.Now,
|
|
|
UpdateDate = DateTime.Now,
|
|
|
|
|
|
});
|
|
|
- bsdb.SaveChanges();
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
AddSysLog("0", "MsgPersonal", "Import");
|
|
|
return "success";
|
|
|
@@ -406,7 +406,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("Title", "2"); //标题
|
|
|
Fields.Add("ReadFlag", "1"); //已读标记
|
|
|
|
|
|
- Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.BsTables).IndexData("MsgPersonal", Fields, "Id desc", "0", 1, 20000, "", "", false);
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MsgPersonal", Fields, "Id desc", "0", 1, 20000, "", "", false);
|
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
|
{
|
|
|
@@ -434,7 +434,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
|
|
|
private void SetRedis(int Id, string EditType = "add")
|
|
|
{
|
|
|
- MsgPersonal msg = bsdb.MsgPersonal.FirstOrDefault(m => m.Id == Id);
|
|
|
+ MsgPersonal msg = db.MsgPersonal.FirstOrDefault(m => m.Id == Id);
|
|
|
if (msg != null)
|
|
|
{
|
|
|
if (EditType == "add")
|