You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
4.8 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Linq;
using System.Web.Mvc;
using DSWeb.MvcShipping.DAL.MsUerAuthority;
using DSWeb.MvcShipping.Models.MsUserAuthority;
using DSWeb.MvcShipping.Helper;
using DSWeb.MvcShipping.Comm.Cookie;
using System.Collections.Generic;
using HcUtility.Comm;
using HcUtility.Core;
using DSWeb.TruckMng.Helper.Repository;
namespace DSWeb.MvcShipping.Controllers
{
[JsonRequestBehavior]
public class MsUserAuthorityController : Controller
{
//
// GET:
public ActionResult Index()
{
return View();
}
//
// GET: /
public ActionResult Edit()
{
return View();
}
//
// GET
public ContentResult GetUserAuthorityList(int start, int limit, string sort,string userid)
{
var dataList = MsUerAuthorityDAL.GetUserAuthorityList(userid,sort);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult GetUserTreeRefList(string PARENTID)
{
var dataList = MsUerAuthorityDAL.GetUserTreeRefList(PARENTID);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult Save(string body)
{
var bodyList = JsonConvert.Deserialize<List<UserAuthority>>(body);
var modb = new ModelObjectRepository();
DBResult result = MsUerAuthorityDAL.SaveDetail(bodyList, Convert.ToString(Session["USERID"]));
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult GetUserAuthorityCompanyList(int start, int limit, string sort, string userid, string authorityid)
{
var dataList = MsUerAuthorityDAL.GetUserAuthorityCompanyList(userid,authorityid,sort);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult SaveAuthorityCompany(string body, string rtype)
{
var bodyList = JsonConvert.Deserialize<List<UserAuthorityCompany>>(body);
var modb = new ModelObjectRepository();
DBResult result = MsUerAuthorityDAL.SaveAuthorityCompanyDetail(bodyList, Convert.ToString(Session["USERID"]), rtype);
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult GetUserAuthorityOpList(int start, int limit, string sort, string userid, string authorityid)
{
var dataList = MsUerAuthorityDAL.GetUserAuthorityOpList(userid, authorityid, sort);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult SaveAuthorityOpDetail(string body, string rtype)
{
var bodyList = JsonConvert.Deserialize<List<UserAuthorityOp>>(body);
var modb = new ModelObjectRepository();
DBResult result = MsUerAuthorityDAL.SaveAuthorityOpDetail(bodyList, Convert.ToString(Session["USERID"]), rtype);
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult SaveAuthorityOpAll(string body, string rtype)
{
var bodyList = JsonConvert.Deserialize<List<UserAuthorityOp>>(body);
var modb = new ModelObjectRepository();
DBResult result = MsUerAuthorityDAL.SaveAuthorityOpDetailAll(bodyList, Convert.ToString(Session["USERID"]), rtype);
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
#region 参照部分
#endregion
}
}