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/TruckMng/Controllers/MsWlCheckAccController.cs

174 lines
5.2 KiB
C#

2 years ago
using System.Linq;
using System.Web.Mvc;
using DSWeb.Areas.TruckMng.DAL.MsWlCheckAcc;
using DSWeb.Areas.TruckMng.Models.MsWlCheckAcc;
using DSWeb.TruckMng.Helper;
using HcUtility.Comm;
using HcUtility.Core;
using System;
using System.Collections.Generic;
using DSWeb.TruckMng.Comm.Cookie;
using DSWeb.TruckMng.Helper.Repository;
using DSWeb.Areas.CommMng.Models;
using DSWeb.EntityDA;
using System.Data;
using DSWeb.DataAccess;
8 months ago
using DSWeb.SoftMng.Filter;
2 years ago
namespace DSWeb.Areas.TruckMng.Controllers
{
/// <summary>
/// 集运对账
/// </summary>
[JsonRequestBehavior]
public class MsWlCheckAccController : Controller
{
//
// GET: /TruckMng/MsWlCheckAcc
public ActionResult Index()
{
return View();
}
public ActionResult PcIndex()
{
return View();
}
//
// GET/TruckMng/MsWlCheckAcc/GetDataList
8 months ago
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
2 years ago
public ContentResult GetDataList(int start, int limit, string sort, string condition)
{
var USERID = CookieConfig.GetCookie_UserId(Request);
var ORGCODE = CookieConfig.GetCookie_OrgCode(Request);
var dataList = MsWlCheckAccDAL.GetDataList(condition, USERID, ORGCODE);
var list = dataList.Skip(start).Take(limit);
//decimal ysTotal = 0;
//decimal yfTotal = 0;
//foreach (var acc in list)
//{
// if (acc.FeeType == 1)
// {
// ysTotal = ysTotal + acc.Freight + acc.ExtrasFee;
// }
// else
// {
// yfTotal = yfTotal + acc.Freight + acc.ExtrasFee;
// }
//}
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 GetDataPcList(int start, int limit, string sort, string condition)
{
var dataList = MsWlCheckAccDAL.GetDataPcList(condition);
var list = dataList.Skip(start).Take(limit);
//decimal ysTotal = 0;
//decimal yfTotal = 0;
//foreach (var acc in list)
//{
// if (acc.FeeType == 1)
// {
// ysTotal = ysTotal + acc.Freight + acc.ExtrasFee;
// }
// else
// {
// yfTotal = yfTotal + acc.Freight + acc.ExtrasFee;
// }
//}
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
return new ContentResult() { Content = json };
}
//
// GET/TruckMng/MsWlCheckAcc/GetData/
8 months ago
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
2 years ago
public ContentResult GetData(string handle, string condition)
{
MsWlCheckAcc head = null;
if (handle == "edit")
{
var list = MsWlCheckAccDAL.GetDataList(condition);
if (list.Count > 0)
head = list[0];
}
if (head == null)
{
head = new MsWlCheckAcc();
}
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = head});
return new ContentResult() { Content = json };
}
//
// GET/TruckMng/MsWlCheckAcc/Save
//public ContentResult Save(string opstatus, string data)
//{
// MsWlCheckAcc head = JsonConvert.Deserialize<MsWlCheckAcc>(data);
// if (opstatus == "add")
// {
// head.DbOperationType = DbOperationType.DbotIns;
// }
// else if (opstatus == "edit")
// {
// head.DbOperationType = DbOperationType.DbotUpd;
// }
// else
// {
// head.DbOperationType = DbOperationType.DbotDel;
// }
// var modb = new ModelObjectDB();
// DBResult result = modb.Save(head);
// var jsonRespose = new JsonResponse
// {
// Success = result.Success,
// Message = result.Message,
// Data = MsWlCheckAccDAL.GetData("GId='" + head.GId + "'")
// };
// return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
//}
public ContentResult Delete(string data)
{
var head = JsonConvert.Deserialize<MsWlCheckAcc>(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
}
}