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.
DS7/DSWeb/Areas/MvcShipping/Controllers/MsHomeController.cs

121 lines
4.0 KiB
C#

3 years ago
using System;
using System.Linq;
using System.Web.Mvc;
using DSWeb.MvcShipping.Models.MsHome;
using DSWeb.MvcShipping.DAL.MsHome;
using DSWeb.MvcShipping.Helper;
using DSWeb.MvcShipping.Comm.Cookie;
using System.Collections.Generic;
using HcUtility.Comm;
using HcUtility.Core;
using DSWebComponent;
namespace DSWeb.MvcShipping.Controllers
{
[JsonRequestBehavior]
public class MsHomeController : Controller
{
//
// GET:
public ActionResult Index()
{
return View();
}
public ContentResult GetColourStyle()
{
var dataList = MsHomeDAL.GetColourStyle(Session["USERID"].ToString());
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });//
return new ContentResult() { Content = json };
}
public ContentResult GetModuleList()
{
var dataList = MsHomeDAL.GetDataList(Session["USERID"].ToString(), Session["COMPANYID"].ToString());
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });//
return new ContentResult() { Content = json };
}
public ContentResult SetDialogVisible(string id)//, bool chkVal
{
DBResult result = MsHomeDAL.SetDialogVisible(id);
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = result.Data
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult GetLocation()
{
string _key = "";
Dictionary<string, string> _dictionary = Dictionary.GetDictionary();
List<Location> locationList = new List<Location>();
foreach (KeyValuePair<string, string> kvp in _dictionary)
{
if (kvp.Key.IndexOf("SET-LOCATION") != -1)
{
_key = kvp.Key;
_key = _key.Replace("SET-LOCATION-", "");
Location _location = new Location();
_location.MODULEID = _key;
locationList.Add(_location);
}
}
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = locationList.Count, data = locationList.ToList() });//
return new ContentResult() { Content = json };
}
public ContentResult SetLocation(string gid, string x, string y, string width, string height)
{
DBResult result = null;
result = MsHomeDAL.SetLoacation(gid, Session["USERID"].ToString(), x, y, width, height);
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message, Data = "" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult GetSize()
{
string _key = "";
Dictionary<string, string> _dictionary = Dictionary.GetDictionary();
List<Location> locationList = new List<Location>();
foreach (KeyValuePair<string, string> kvp in _dictionary)
{
if (kvp.Key.IndexOf("SET-SIZE") != -1)
{
_key = kvp.Key;
_key = _key.Replace("SET-SIZE-", "");
Location _location = new Location();
_location.MODULEID = _key;
locationList.Add(_location);
}
}
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = locationList.Count, data = locationList.ToList() });//
return new ContentResult() { Content = json };
}
#region 参照部分
#endregion
}
}