|
|
@@ -25,7 +25,6 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
public SysAdminOperateController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
|
|
|
{
|
|
|
- OtherMySqlConn.connstr = ConfigurationManager.AppSettings["OpSqlConnStr"].ToString();
|
|
|
}
|
|
|
|
|
|
#region 运营中心列表
|
|
|
@@ -89,7 +88,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.OpTables).IndexData("SysAdmin", Fields, "Id desc", "0", page, limit, condition);
|
|
|
+ Dictionary<string, object> obj = new AdminContentByConn(_accessor.HttpContext, PublicFunction.OpTables, OpConn).IndexData("SysAdmin", 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)
|
|
|
{
|
|
|
@@ -184,7 +183,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("FilePath", data.FilePath); //附件
|
|
|
Fields.Add("QueryCount", 1); //是否为主账号(1是,0否)
|
|
|
|
|
|
- int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.OpTables).Add("SysAdmin", Fields, 0);
|
|
|
+ int Id = new AdminContentByConn(_accessor.HttpContext, PublicFunction.OpTables, OpConn).Add("SysAdmin", Fields, 0);
|
|
|
SysAdmin edit = opdb.SysAdmin.FirstOrDefault(m => m.Id == Id);
|
|
|
if (edit != null)
|
|
|
{
|
|
|
@@ -214,7 +213,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Field.Add("Sort", Id); //运营中心Id
|
|
|
Field.Add("Id", edit.UserId); //创客Id
|
|
|
Field.Add("UserId", edit.UserId); //创客Id
|
|
|
- int Ids = new AdminContentOther(_accessor.HttpContext, PublicFunction.OpTables).Add("UserAccount", Field, 0);
|
|
|
+ int Ids = new AdminContentByConn(_accessor.HttpContext, PublicFunction.OpTables, OpConn).Add("UserAccount", Field, 0);
|
|
|
AddSysLog(userAccount.Id.ToString(), "UserAccount", "add");
|
|
|
var query = opdb.SysAdminRole.Add(new SysAdminRole()
|
|
|
{
|
|
|
@@ -328,7 +327,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("Password", function.MD5_32(data.Password)); //密码
|
|
|
}
|
|
|
}
|
|
|
- new AdminContentOther(_accessor.HttpContext, PublicFunction.OpTables).Edit("SysAdmin", Fields, data.Id);
|
|
|
+ new AdminContentByConn(_accessor.HttpContext, PublicFunction.OpTables, OpConn).Edit("SysAdmin", Fields, data.Id);
|
|
|
SysAdmin edit = opdb.SysAdmin.FirstOrDefault(m => m.Id == data.Id);
|
|
|
edit.CreateDate = edit.CreateDate;
|
|
|
AddSysLog(data.Id.ToString(), "SysAdmin", "update");
|
|
|
@@ -363,7 +362,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
var operateForCode = opdb.OperateForCode.FirstOrDefault(m => m.OpId == id) ?? new OpModels.OperateForCode();
|
|
|
if (operateForCode.OpId > 0)
|
|
|
{
|
|
|
- new AdminContentOther(_accessor.HttpContext, PublicFunction.OpTables).Delete("UserAccount", operateForCode.OpId);
|
|
|
+ new AdminContentByConn(_accessor.HttpContext, PublicFunction.OpTables, OpConn).Delete("UserAccount", operateForCode.OpId);
|
|
|
}
|
|
|
//修改运营中心仓
|
|
|
var storeHouse = db.StoreHouse.Where(m => m.Sort == id && m.Status == 1 && m.UserId == sysAdmin.UserId && m.OpId == sysAdmin.UserId).ToList();
|
|
|
@@ -422,7 +421,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("Status", -1);
|
|
|
- new AdminContentOther(_accessor.HttpContext, PublicFunction.OpTables).Edit("SysAdmin", Fields, id);
|
|
|
+ new AdminContentByConn(_accessor.HttpContext, PublicFunction.OpTables, OpConn).Edit("SysAdmin", Fields, id);
|
|
|
}
|
|
|
opdb.SaveChanges();
|
|
|
|
|
|
@@ -446,7 +445,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.OpTables).Edit("SysAdmin", Fields, id);
|
|
|
+ new AdminContentByConn(_accessor.HttpContext, PublicFunction.OpTables, OpConn).Edit("SysAdmin", Fields, id);
|
|
|
}
|
|
|
opdb.SaveChanges();
|
|
|
return "success";
|
|
|
@@ -469,7 +468,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.OpTables).Edit("SysAdmin", Fields, id);
|
|
|
+ new AdminContentByConn(_accessor.HttpContext, PublicFunction.OpTables, OpConn).Edit("SysAdmin", Fields, id);
|
|
|
}
|
|
|
opdb.SaveChanges();
|
|
|
return "success";
|
|
|
@@ -484,7 +483,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// <param name="Id"></param>
|
|
|
public string Sort(int Id, int Sort)
|
|
|
{
|
|
|
- new AdminContentOther(_accessor.HttpContext, PublicFunction.OpTables).Sort("SysAdmin", Sort, Id);
|
|
|
+ new AdminContentByConn(_accessor.HttpContext, PublicFunction.OpTables, OpConn).Sort("SysAdmin", Sort, Id);
|
|
|
|
|
|
AddSysLog(Id.ToString(), "SysAdmin", "sort");
|
|
|
return "success";
|
|
|
@@ -531,7 +530,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("Role", "1"); //角色
|
|
|
Fields.Add("LastLoginDate", "3"); //最后登录时间
|
|
|
|
|
|
- Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.OpTables).IndexData("SysAdmin", Fields, "Id desc", "0", 1, 20000, "", "", false);
|
|
|
+ Dictionary<string, object> obj = new AdminContentByConn(_accessor.HttpContext, PublicFunction.OpTables, OpConn).IndexData("SysAdmin", 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)
|
|
|
{
|