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.

81 lines
2.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using DSWeb.MvcShipping.Helper;
using DSWeb.MvcShipping.Comm.Cookie;
using DSWeb.Areas.CommMng.DAL;
using DSWeb.Areas.RptMng.Comm;
using HcUtility.Comm;
using HcUtility.Core;
using Microsoft.Practices.EnterpriseLibrary.Data;
using DSWeb.EntityDA;
using DSWeb.Areas.CommMng.Models;
using DSWeb.Areas.Account.Models.BSNOLB;
using DSWeb.Areas.Account.Models.MsOpBill;
using DSWeb.MvcShipping.DAL.ChMonthCloseDAL;
using DSWeb.Areas.Account.Models.ChMonthClose;
namespace DSWeb.Areas.Account.Controllers
{
/// <summary>
/// 月末结账
/// </summary>
[JsonRequestBehavior]
public class ChMonthCloseController : Controller
{
//
// GET:
public ActionResult Index()
{
return View();
}
public ContentResult GetNowPeriod(string condition)
{
Period head = null;
head = ChMonthCloseDAL.GetData(condition, Convert.ToString(Session["COMPANYID"]));
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = head });
return new ContentResult() { Content = json };
}
public ContentResult Save(string data, string type)
{
if (Convert.ToString(Session["COMPANYID"]).ToString().Trim() == "" || Convert.ToString(Session["USERID"]).ToString().Trim() == "" || Convert.ToString(Session["CODENAME"]).ToString().Trim() == "" || Convert.ToString(Session["SHOWNAME"]).ToString().Trim() == "" || Convert.ToString(Session["DEPTNAME"]).ToString().Trim() == "")
{
var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
}
//
var headData = JsonConvert.Deserialize<Period>(data);
DBResult result = ChMonthCloseDAL.MonthClose(headData, type, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = ChMonthCloseDAL.GetData("1=1", Convert.ToString(Session["COMPANYID"]))
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
}
}