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.

154 lines
4.8 KiB
C#

10 months ago
using System;
using System.Linq;
using System.Web.Mvc;
using System.Collections.Generic;
using DSWeb.Areas.CommMng.DAL;
using DSWeb.Areas.Import.DAL;
using DSWeb.Areas.Import.DAL.CargoName;
using DSWeb.Areas.Import.Models.CargoName;
using DSWeb.TruckMng.Comm.Cookie;
using DSWeb.TruckMng.Helper;
using HcUtility.Comm;
using HcUtility.Core;
using DSWeb.TruckMng.Helper.Repository;
namespace DSWeb.Areas.Import.Controllers
{
/// <summary>
///
/// </summary>
[JsonRequestBehavior]
public class CargoNameController : Controller
{
//
// GET: /Import/cargoinfo/
public ActionResult Index()
{
return View();
}
//
// GET: /Import/cargoinfo/Edit
public ActionResult Edit()
{
return View();
}
//
// GET/Import/cargoinfo/GetDataList
public ContentResult GetFactoryNoList(int start, int limit, string sort, string condition)
{
var dataList = CargoNameDAL.GetFactoryNoList(condition);
var list = dataList.Skip(start).Take(limit);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult GetCargoNameList(int start, int limit, string sort, string condition)
{
var dataList = CargoNameDAL.GetCargoNameList(condition);
var list = dataList.Skip(start).Take(limit);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
return new ContentResult() { Content = json };
}
//
// GET/Import/Cargoinfo/GetData/
//
// GET/Import/CargoInfo/Save
public ContentResult Save(string CLIENTGID, string FactoryNobody, string FactoryNoDelbody
, string CargoNamebody, string CargoNameDelbody)
{
var FactoryNoList = JsonConvert.Deserialize<List<Import_FactoryNo>>(FactoryNobody);
var FactoryNoDelList = JsonConvert.Deserialize<List<Import_FactoryNo>>(FactoryNoDelbody);
var CargoNameList = JsonConvert.Deserialize<List<Import_CargoName>>(CargoNamebody);
var CargoNameDelList = JsonConvert.Deserialize<List<Import_CargoName>>(CargoNameDelbody);
var modb = new ModelObjectRepository();
DBResult result = modb.SaveComm("CLIENTGID", CLIENTGID,
ModelObjectConvert<Import_FactoryNo>.ToModelObjectList(FactoryNoList),
ModelObjectConvert<Import_FactoryNo>.ToModelObjectList(FactoryNoDelList),
ModelObjectConvert<Import_CargoName>.ToModelObjectList(CargoNameList),
ModelObjectConvert<Import_CargoName>.ToModelObjectList(CargoNameDelList)
);
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message/*,
Data = CargoinfoDAL.GetHeadDataByBillNo(Convert.ToString(headData.ID))*/
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult GetGoodCode ( string CLIENTGID)
{
var _count = 0;
_count = CargoNameDAL.GetGoodCode(CLIENTGID,Session["USERID"].ToString());
var jsonRespose = new JsonResponse
{
Success = true,
Message = ""/*,
Data = CargoinfoDAL.GetHeadDataByBillNo(Convert.ToString(headData.ID))*/
};
if (_count>0){
jsonRespose.Success=true;
}else{
jsonRespose.Success=false;
}
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
//
// GET/Import/Cargoinfo/Delete
/*
public ContentResult Delete(string data)
{
var headData = JsonConvert.Deserialize<Import_Cargoinfo>(data);
var modb = new ModelObjectDB();
DBResult result = modb.Delete(headData);
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult GetBodyList(int cargoid)
{
var condition = " CargoinfoID="+cargoid;
List<Import_Cargociq> list = CargoinfoDAL.GetBodyList(condition);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = list.Count, data = list.ToList() });
return new ContentResult() { Content = json };
}*/
#region 参照部分
#endregion
}
}