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/Import/Controllers/ReceiptDocController.cs

112 lines
3.5 KiB
C#

2 years ago
 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;
8 months ago
using DSWeb.SoftMng.Filter;
2 years ago
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();
}
//业务列表
8 months ago
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
2 years ago
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 };
}
8 months ago
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
2 years ago
//单据明细
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<ReceiptIOmb>(data);
var bodyList = JsonConvert.Deserialize<List<ReceiptDocmb>>(DocBody);
var DelbodyList = JsonConvert.Deserialize<List<ReceiptDocmb>>(DocBodyDel);
var modb = new ModelObjectRepository();
DBResult result = modb.SaveComm("BSNO", BSNO,
ModelObjectConvert<ReceiptDocmb>.ToModelObjectList(bodyList),
ModelObjectConvert<ReceiptDocmb>.ToModelObjectList(DelbodyList)
);
//刷新父窗口上的父节点
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
8 months ago
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
2 years ago
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 };
}
}
}