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.
98 lines
4.6 KiB
C#
98 lines
4.6 KiB
C#
using System;
|
|
using System.Linq;
|
|
using System.Web.Mvc;
|
|
using DSWeb.MvcShipping.DAL.MsCtCarryOverDAL;
|
|
using DSWeb.MvcShipping.Models.MsCtCarryOver;
|
|
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 MsCtCarryOverController : Controller
|
|
{
|
|
public ActionResult Index()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult Edit()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ContentResult GetDataList(string condition)
|
|
{
|
|
var dataList = MsCtCarryOverDAL.GetDataList(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
|
|
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
public ContentResult GetData(string handle, string condition)
|
|
{
|
|
MsCtCarryOver head = null;
|
|
if (handle == "edit")
|
|
{
|
|
head = MsCtCarryOverDAL.GetData(condition, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
|
|
head.MODIFIEDUSER = Convert.ToString(Session["USERID"]);
|
|
head.MODIFIEDTIME = DateTime.Now;
|
|
}
|
|
if (head == null)
|
|
{
|
|
head = new MsCtCarryOver();
|
|
head.CORPID = Convert.ToString(Session["COMPANYID"]);
|
|
head.MODIFIEDUSER = Convert.ToString(Session["USERID"]);
|
|
head.MODIFIEDTIME = DateTime.Now;
|
|
}
|
|
var json = JsonConvert.Serialize(
|
|
new { Success = true, Message = "查询成功", data = head });
|
|
return new ContentResult() { Content = json };
|
|
}
|
|
|
|
//轧账
|
|
public ContentResult onCARRYClick(string ACCDAY, string ISCARRY)
|
|
{
|
|
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) };
|
|
}
|
|
//
|
|
var modb = new ModelObjectDB();
|
|
DBResult result = MsCtCarryOverDAL.onCARRYClick(ACCDAY, ISCARRY, 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) };
|
|
}
|
|
|
|
//返轧账
|
|
public ContentResult onRETURNClick(string ACCDAY)
|
|
{
|
|
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) };
|
|
}
|
|
//
|
|
var modb = new ModelObjectDB();
|
|
DBResult result = MsCtCarryOverDAL.onRETURNClick(ACCDAY, 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) };
|
|
}
|
|
|
|
//判断是否是已轧账数据
|
|
public ContentResult onIsCARRY(string gid, string voudate, string tablename)
|
|
{
|
|
var modb = new ModelObjectDB();
|
|
DBResult result = MsCtCarryOverDAL.onIsCARRY(gid, voudate, tablename, 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) };
|
|
}
|
|
}
|
|
}
|
|
|