|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Web.Mvc;
|
|
|
|
|
|
|
|
|
|
using DSWeb.Areas.OA.DAL.Baoxiao;
|
|
|
|
|
using DSWeb.Areas.OA.Models.Baoxiao;
|
|
|
|
|
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.TruckMng.Models.Card;
|
|
|
|
|
using DSWeb.Areas.TruckMng.DAL.Card;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using DSWeb.EntityDA;
|
|
|
|
|
|
|
|
|
|
using WebSqlHelper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace DSWeb.Areas.TruckMng.Controllers
|
|
|
|
|
{
|
|
|
|
|
[JsonRequestBehavior]
|
|
|
|
|
public class CardController : Controller
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
// GET: /Import/XXH
|
|
|
|
|
public ActionResult Index()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// GET: /Import/XXH/Edit
|
|
|
|
|
public ActionResult Edit()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ContentResult GetDataList ( string OWNGID )
|
|
|
|
|
{
|
|
|
|
|
var dataList = CardDAL.GetDataList(" OWNGID='" + OWNGID + "'");
|
|
|
|
|
|
|
|
|
|
//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 DealCard(string BILLNO, string OWNID, string CARDTYPE, string Operate, string Innum, string Outnum)
|
|
|
|
|
{
|
|
|
|
|
var _count = CardDAL.DealCard(BILLNO,OWNID, CARDTYPE, Operate, Innum, Outnum);
|
|
|
|
|
|
|
|
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", data = _count });
|
|
|
|
|
return new ContentResult() { Content = json };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ContentResult GetCardRemain(string OWNID, string CARDTYPE)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var Remain = CardDAL.GetCardRemain(OWNID, CARDTYPE);
|
|
|
|
|
|
|
|
|
|
var json = JsonConvert.Serialize(
|
|
|
|
|
new { Success = true, Message = "查询成功", data = Remain });
|
|
|
|
|
return new ContentResult() { Content = json };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ContentResult GetUseList ( string CARDGID )
|
|
|
|
|
{
|
|
|
|
|
var dataList = CardDAL.GetUseList(" CARDGID='" + CARDGID + "'");
|
|
|
|
|
|
|
|
|
|
//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 SaveCardUse ( string CARDGID,string CardUsebody, string CardUseDelbody )
|
|
|
|
|
{
|
|
|
|
|
var CardUsebodyList = JsonConvert.Deserialize<List<CardUsemb>>(CardUsebody);
|
|
|
|
|
var CardUseDelbodyList = JsonConvert.Deserialize<List<CardUsemb>>(CardUseDelbody);
|
|
|
|
|
|
|
|
|
|
var modb = new ModelObjectRepository();
|
|
|
|
|
DBResult result = modb.SaveComm("CARDGID",CARDGID,
|
|
|
|
|
ModelObjectConvert<CardUsemb>.ToModelObjectList(CardUsebodyList),
|
|
|
|
|
ModelObjectConvert<CardUsemb>.ToModelObjectList(CardUseDelbodyList)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
//刷新父窗口上的父节点
|
|
|
|
|
var jsonRespose = new JsonResponse
|
|
|
|
|
{
|
|
|
|
|
Success = result.Success,
|
|
|
|
|
Message = result.Message,
|
|
|
|
|
//Data = XXHDAL.GetData("M.ContractNo='" + head.ContractNo + "'")
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 获取指定卡片ID的卡片使用记录数量,防止有使用明细的卡片被删
|
|
|
|
|
public ContentResult SearchCardUse ( string GID)
|
|
|
|
|
{
|
|
|
|
|
//HTmb head = null;
|
|
|
|
|
|
|
|
|
|
var _count = CardDAL.SearchCardUse(" where CARDGID='"+GID+"' ");
|
|
|
|
|
|
|
|
|
|
var json = JsonConvert.Serialize(
|
|
|
|
|
new { Success = true, Message = "查询成功", data = _count });
|
|
|
|
|
return new ContentResult() { Content = json };
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 删除卡片
|
|
|
|
|
public ContentResult DeleteCard ( string GID )
|
|
|
|
|
{
|
|
|
|
|
//HTmb head = null;
|
|
|
|
|
|
|
|
|
|
var _count = CardDAL.DeleteCard(GID);
|
|
|
|
|
|
|
|
|
|
var json = JsonConvert.Serialize(
|
|
|
|
|
new { Success = true, Message = "查询成功", data = _count });
|
|
|
|
|
return new ContentResult() { Content = json };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ContentResult DeleteCardUse ( string GID )
|
|
|
|
|
{
|
|
|
|
|
//HTmb head = null;
|
|
|
|
|
|
|
|
|
|
var _count = CardDAL.DeleteCardUse(GID);
|
|
|
|
|
|
|
|
|
|
var json = JsonConvert.Serialize(
|
|
|
|
|
new { Success = true, Message = "查询成功", data = _count });
|
|
|
|
|
return new ContentResult() { Content = json };
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 参照部分
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|