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/MsCtBankCheckingController.cs

116 lines
6.2 KiB
C#

using System;
using System.Data;
using System.Linq;
using System.Web.Mvc;
using DSWeb.MvcShipping.Models.MsCtBankJournal;
using DSWeb.MvcShipping.Models.MsCtBankStatement;
using DSWeb.MvcShipping.DAL.MsCtBankCheckingDAL;
using DSWeb.MvcShipping.Helper;
using DSWeb.MvcShipping.Comm.Cookie;
using HcUtility.Comm;
using HcUtility.Core;
using System.Collections.Generic;
using DSWeb.MvcShipping.DAL.MsBaseInfoDAL;
using DSWeb.EntityDA;
using DSWeb.Areas.CommMng.DAL;
namespace DSWeb.MvcShipping.Controllers
{
[JsonRequestBehavior]
public class MsCtBankCheckingController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult Edit()
{
return View();
}
#region 查询_银行日记账
public ContentResult GetDataList(int start, int limit, string sort, string condition)
{
var dataList = MsCtBankCheckingDAL.GetDataList(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), 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 };
}
public ContentResult GetData(string handle, string condition)
{
MsCtBankJournal head = null;
head = MsCtBankCheckingDAL.GetData(condition, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = head });
return new ContentResult() { Content = json };
}
#endregion
#region 查询_银行对账单
public ContentResult GetDataListStatement(int start, int limit, string sort, string condition)
{
var dataList = MsCtBankCheckingDAL.GetDataListStatement(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), 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 };
}
public ContentResult GetDataStatement(string handle, string condition)
{
MsCtBankStatement head = null;
head = MsCtBankCheckingDAL.GetDataStatement(condition, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = head });
return new ContentResult() { Content = json };
}
#endregion
#region 自动对账
public ContentResult onAutoClick(string sACCGID, string sVOUDATE, string sVOUDATEend, string sDaysOf, string sCbSETTLETYPE, string sCbBILLNO, string sCbVOUDATE)
{
if (Convert.ToString(Session["COMPANYID"]).Trim() == "" || Convert.ToString(Session["USERID"]).Trim() == "" || Convert.ToString(Session["CODENAME"]).Trim() == "" || Convert.ToString(Session["SHOWNAME"]).Trim() == "" || Convert.ToString(Session["DEPTNAME"]).Trim() == "")
{
var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
}
//
DBResult result = MsCtBankCheckingDAL.onAutoClick(sACCGID, sVOUDATE, sVOUDATEend, sDaysOf, sCbSETTLETYPE, sCbBILLNO, sCbVOUDATE, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
#endregion
#region 手动对账
public ContentResult onAddClick(string gidJ, string gidS, string sACCGID, string sVOUDATE)
{
if (Convert.ToString(Session["COMPANYID"]).Trim() == "" || Convert.ToString(Session["USERID"]).Trim() == "" || Convert.ToString(Session["CODENAME"]).Trim() == "" || Convert.ToString(Session["SHOWNAME"]).Trim() == "" || Convert.ToString(Session["DEPTNAME"]).Trim() == "")
{
var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
}
//
DBResult result = MsCtBankCheckingDAL.onAddClick(gidJ, gidS, sACCGID, sVOUDATE, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
#endregion
#region 取消对账
public ContentResult Delete(string gidJ, string gidS, string sql, string sCbVOUDATE, string sACCGID)
{
if (Convert.ToString(Session["COMPANYID"]).Trim() == "" || Convert.ToString(Session["USERID"]).Trim() == "" || Convert.ToString(Session["CODENAME"]).Trim() == "" || Convert.ToString(Session["SHOWNAME"]).Trim() == "" || Convert.ToString(Session["DEPTNAME"]).Trim() == "")
{
var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
}
//
DBResult result = MsCtBankCheckingDAL.Delete(gidJ, gidS, sql, sCbVOUDATE, sACCGID, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
#endregion
}
}