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/MsMainFormController.cs

234 lines
8.6 KiB
C#

3 years ago
using System;
using System.Linq;
using System.Web.Mvc;
using DSWeb.MvcShipping.Models.MsMainForm;
using DSWeb.MvcShipping.DAL.MsMainForm;
using DSWeb.MvcShipping.Helper;
using DSWeb.MvcShipping.Comm.Cookie;
using System.Collections.Generic;
using HcUtility.Comm;
using HcUtility.Core;
namespace DSWeb.MvcShipping.Controllers
{
[JsonRequestBehavior]
public class MsMainFormController : Controller
{
//
// GET:
public ActionResult Index()
{
return View();
}
//
// GET: /
public ActionResult Edit()
{
return View();
}
//
// GET
public ContentResult GetDataList(string condition,string sort)
{
var dataList = MsMainFormDAL.GetDataList(condition, Convert.ToString(Session["COMPANYID"]),sort);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
//
// GET/TruckMng/MsWlTyreAcc/GetData/
public ContentResult GetUserDataList(string condition, string sort)
{
var dataList = MsMainFormDAL.GetUserDataList(condition, Convert.ToString(Session["USERID"]), sort);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult GetUserMainList(string condition, string sort)
{
var dataList = MsMainFormDAL.GetUserMainList(condition, Convert.ToString(Session["USERID"]), sort);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult SaveUserSetDetail(string body)
{
var bodyList = JsonConvert.Deserialize<List<UserMainmoduleSet>>(body);
DBResult result = MsMainFormDAL.SaveUserSetDetail(bodyList, Convert.ToString(Session["USERID"]));
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = result.Data
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult DeleteUserModule(string data)
{
var headData = JsonConvert.Deserialize<UserMainmoduleSet>(data);
var modb = new ModelObjectDB();
DBResult result = MsMainFormDAL.DeleteDetail(headData.GID);
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
//
// GET
public ContentResult GetUserMainFormSetInfo(string gid)
{
var dataList = MsMainFormDAL.GetUserMainFormSetInfo(gid, Convert.ToString(Session["COMPANYID"]));
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
//
// GET
public ContentResult GetUserTemplet(string gid)
{
var dataList = MsMainFormDAL.GetUserTemplet(gid, Convert.ToString(Session["COMPANYID"]));
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
//
// GET
public ContentResult GetUserTempletItem(string gid)
{
var dataList = MsMainFormDAL.GetUserTempletItem(gid);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
//
// GET
public ContentResult GetUserTempletDetail(string gid, string itemName)
{
var dataList = MsMainFormDAL.GetUserTempletDetail(gid, itemName);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
//
// GET
public ContentResult GetEmployeeList()
{
var dataList = MsMainFormDAL.GetEmployeeList(Session["COMPANYID"].ToString());
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
//
// GET
public ContentResult GetEmployeePopedom(string id)
{
var dataList = MsMainFormDAL.GetEmployeePopedom(id);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
//
//SET:
public ContentResult InsertItem(string globalid, string itemid, string itemname)
{
//var bodyList = JsonConvert.Deserialize<List<UserMainmoduleSet>>(body);
DBResult result = MsMainFormDAL.InsertItem(globalid, itemid, itemname, Convert.ToString(Session["USERID"]), Convert.ToString(Session["COMPANYID"]));
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = result.Data
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
//
//SET:
public ContentResult DeleteItem(string id, string name)
{
//var bodyList = JsonConvert.Deserialize<List<UserMainmoduleSet>>(body);
DBResult result = MsMainFormDAL.DeleteItem(id, name, Convert.ToString(Session["USERID"]), Convert.ToString(Session["COMPANYID"]));
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = result.Data
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
//
//SET:
public ContentResult InsertItemLink(string groupid, string parentValue, string inputid, string itemname, string linkurl, string inquire)
{
//var bodyList = JsonConvert.Deserialize<List<UserMainmoduleSet>>(body);
DBResult result = MsMainFormDAL.InsertItemLink(groupid, parentValue, inputid, itemname, linkurl, inquire, Convert.ToString(Session["USERID"]), Convert.ToString(Session["COMPANYID"]));
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = result.Data
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
//
//SET:
public ContentResult DeleteItemLink(string itemid)
{
//var bodyList = JsonConvert.Deserialize<List<UserMainmoduleSet>>(body);
DBResult result = MsMainFormDAL.DeleteItemLink(itemid);
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = result.Data
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
//
//SET:
public ContentResult SaveFormSet(string title, string usergid, string top, string left, string width, string height)
{
//var bodyList = JsonConvert.Deserialize<List<UserMainmoduleSet>>(body);
DBResult result = MsMainFormDAL.SaveFormSet(title, usergid, top, left, width, height, Session["USERID"].ToString());
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = result.Data
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
#region 参照部分
#endregion
}
}