using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; using DSWeb.Areas.OA.Models.Comm; using DSWeb.TruckMng.Comm.Cookie; using DSWeb.TruckMng.Helper; using DSWeb.TruckMng.Helper.Repository; using DSWeb.Areas.CommMng.DAL; using HcUtility.Comm; using HcUtility.Core; using Microsoft.Practices.EnterpriseLibrary.Data; using System.Text; using System.Data; using DSWeb.Areas.Import.DAL.ImportTrade; using DSWeb.Areas.Import.DAL.XXH; using DSWeb.Areas.Import.DAL.ReceiptDoc; using DSWeb.Areas.Import.Models.ImportTrade; using DSWeb.EntityDA; using WebSqlHelper; namespace DSWeb.Areas.Import.Controllers { [JsonRequestBehavior] public class ReceiptDocController : Controller { // // GET: /Import/XXH public ActionResult Index() { return View(); } // // GET: /Import/XXH/Edit public ActionResult Edit() { return View(); } //业务列表 public ContentResult GetDataList(int start, int limit, string sort, string condition) { var dataList = XXHDAL.GetDataList_ALL_single(condition, CookieConfig.GetCookie_UserCode(Request), CookieConfig.GetCookie_UserName(Request), CookieConfig.GetCookie_CompanyId(Request)); 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 GetDocList ( string condition ) { var dataList = ReceiptDocDAL.GetDocList(condition); //var list = dataList.Skip(start).Take(limit); var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() }); return new ContentResult() { Content = json }; } public ContentResult SaveDoc ( string BSNO, string DocBody, string DocBodyDel ) { //var head = JsonConvert.Deserialize(data); var bodyList = JsonConvert.Deserialize>(DocBody); var DelbodyList = JsonConvert.Deserialize>(DocBodyDel); var modb = new ModelObjectRepository(); DBResult result = modb.SaveComm("BSNO", BSNO, ModelObjectConvert.ToModelObjectList(bodyList), ModelObjectConvert.ToModelObjectList(DelbodyList) ); //刷新父窗口上的父节点 var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message }; return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; } public ContentResult GetDocPubList ( string condition ) { var dataList = ReceiptDocDAL.GetDocPubList(condition); //var list = dataList.Skip(start).Take(limit); var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() }); return new ContentResult() { Content = json }; } } }