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.

98 lines
3.0 KiB
C#

10 months ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using DSWeb.Areas.TruckMng.Models.Comm;
using DSWeb.Areas.CommMng.DAL;
using DSWeb.Areas.Import.DAL.GridPanelShowDAL;
using DSWeb.Areas.Import.Models.GridPanelShow;
using DSWeb.Areas.Import.Models.XXH;
using DSWeb.TruckMng.Comm.Cookie;
using DSWeb.TruckMng.Helper;
using DSWeb.TruckMng.Helper.Repository;
using DSWeb.Areas.TruckMng.DAL.Comm;
using HcUtility.Comm;
using HcUtility.Core;
namespace DSWeb.Areas.Import.Controllers
{
[JsonRequestBehavior]
public class GridPanelShowController : Controller
{
//
// GET: /Import/XXH
public ActionResult Index()
{
return View();
}
//
// GET: /Import/XXH/Edit
public ActionResult Edit()
{
return View();
}
//
// GET/Import/GridPanelShow/GetDataList
public ContentResult GetDataList(string USERID, string FORMNAME)
{
var dataList = GridPanelShowDAL.GetDataList(USERID, FORMNAME);
var list = dataList.Skip(0).Take(500);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
return new ContentResult() { Content = json };
}
//
// GET/Import/XXH/Save
7 months ago
[ValidateInput(false)]
10 months ago
public ContentResult Save(string GridPanelBody,string USERID,string FORMNAME)
{
var GridPanelBodyList = JsonConvert.Deserialize<List<GridPanelShowmb>>(GridPanelBody);
DBResult result=GridPanelShowDAL.SaveDetail(GridPanelBodyList,USERID,FORMNAME);
//var head = JsonConvert.Deserialize<XXHmb>(""); //空的头数据
//var dataList = GridPanelShowDAL.GetDataList("", ""); //空的del数据
//var modb = new ModelObjectRepository();
//DBResult result = modb.SaveComm(//head,
// ModelObjectConvert<GridPanelShowmb>.ToModelObjectList(GridPanelBodyList)
// //,ModelObjectConvert<GridPanelShowmb>.ToModelObjectList(dataList)
// );
//刷新父窗口上的父节点
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = GridPanelShowDAL.GetDataList(USERID, FORMNAME)
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult Delete(string data)
{
var head = JsonConvert.Deserialize<GridPanelShowmb>(data);
var modb = new ModelObjectDB();
DBResult result = modb.Delete(head);
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
#region 参照部分
#endregion
}
}