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/MvcShipping/Controllers/MsFeeTemplateController.cs

161 lines
5.8 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Linq;
using System.Web.Mvc;
using DSWeb.MvcShipping.DAL.MsFeeTemplate;
using DSWeb.MvcShipping.Models.MsFeeTemplate;
using DSWeb.MvcShipping.Helper;
using DSWeb.MvcShipping.Comm.Cookie;
using HcUtility.Comm;
using HcUtility.Core;
using System.Collections.Generic;
using DSWeb.Areas.Account.Models.MsOpBill;
using DSWeb.SoftMng.Filter;
namespace DSWeb.MvcShipping.Controllers
{
[JsonRequestBehavior]
public class MsFeeTemplateController : Controller
{
//
// GET:
public ActionResult Index()
{
return View();
}
public ActionResult AddFeeIndex()
{
return View();
}
public ActionResult AddFeePLIndex()
{
return View();
}
//
// GET: /
public ActionResult Edit()
{
return View();
}
//
// GET
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
public ContentResult GetDataList(int start, int limit, string sort, string condition)
{
var dataList = MsFeeTemplateDAL.GetDataList(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["DEPTNAME"]), sort);
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/TruckMng/MsWlTyreAcc/GetData/
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
public ContentResult GetData(string handle, string condition)
{
FeeTemplate head = null;
if (handle == "edit")
{
var list = MsFeeTemplateDAL.GetData(condition, Convert.ToString(Session["USERID"]),Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["DEPTNAME"]));
head = list;
}
if (head == null)
{
head = new FeeTemplate();
}
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = head });
return new ContentResult() { Content = json };
}
public ContentResult GetDetailDataList(string TemplateID)
{
var dataList = MsFeeTemplateDAL.GetDetailDataList(" TemplateID='" + TemplateID+ "'");
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult UpdateTemplate(string templateid)
{
DBResult result = MsFeeTemplateDAL.UpdateTemplate(templateid);
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
//
// GET/TruckMng/MsWlTyreAcc/Save
/*
public ContentResult Save(string opstatus, string data)
{
FeeTemplate head = JsonConvert.Deserialize<FeeTemplate>(data);
if (opstatus == "add")
{
head.DbOperationType = DbOperationType.DbotIns;
head.OrgCode = CookieConfig.GetCookie_OrgCode(Request);
}
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 = MsWlTyreAccDAL.GetData("SerialNo=" + head.SerialNo + "", Convert.ToString(Session["USERID"]), CookieConfig.GetCookie_UserCode(Request), CookieConfig.GetCookie_OrgCode(Request))
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
*/
public ContentResult Delete(string data)
{
var head = JsonConvert.Deserialize<FeeTemplate>(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) };
}
public ContentResult PiliangAdd(string bill, string body,string isclienttype="0")
{
var FeeTemplateList= JsonConvert.Deserialize<List< FeeTemplate >>(body);
var billList = JsonConvert.Deserialize<List<MsOpBill>>(bill);
DBResult result = MsFeeTemplateDAL.SavePiliangUpdate(billList, FeeTemplateList, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), CookieConfig.GetCookie_LocalCurr(Request), isclienttype);
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
#region 参照部分
#endregion
}
}