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

217 lines
8.6 KiB
C#

2 years ago
using System;
using System.Text;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Script.Serialization;
using System.Web.Configuration;
using System.Configuration;
using DSWeb.MvcShipping.Models.MsRptPriceShip;
using DSWeb.MvcShipping.DAL.MsRptPriceShipDAL;
using DSWeb.MvcShipping.Helper;
using DSWeb.MvcShipping.Comm.Cookie;
using DSWeb.Areas.CommMng.Models;
using HcUtility.Comm;
using HcUtility.Core;
using System.Collections.Generic;
using DSWeb.MvcShipping.DAL.MsBaseInfoDAL;
using DSWeb.EntityDA;
using DSWeb.Areas.RptMng.Comm;
using System.IO;
using System.Security.Principal;
using System.Web.Routing;
namespace DSWeb.MvcShipping.Controllers
{
[JsonRequestBehavior]
public class MsRptPriceShipController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult Edit()
{
return View();
}
#region 查询
public ContentResult GetDataList(int start, int limit, string sort, string condition)
{
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 dataList = MsRptPriceShipDAL.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 };
}
#endregion
#region 打印
public ContentResult GetDataListStr(string condition)
{
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 dataListStr = MsRptPriceShipDAL.GetDataListStr(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", data = dataListStr });
return new ContentResult() { Content = json };
}
#endregion
#region 导出
public ContentResult GetDataListSQL(string condition)
{
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 dataListStr = MsRptPriceShipDAL.GetDataListSQL(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
//dataListStr = "select " + dataListStr + "";
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", data = dataListStr });
return new ContentResult() { Content = json };
}
#endregion
#region 取其他费用权限_循环列
public JsonResult GetFeeName()
{
var evList = MsRptPriceShipDAL.GetFeeName(Convert.ToString(Session["SHOWNAME"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 取集装箱权限_循环列
public JsonResult GetCtn()
{
var evList = MsRptPriceShipDAL.GetCtn(Convert.ToString(Session["SHOWNAME"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 取报价权限_循环列
public JsonResult GetBaoJia()
{
var evList = MsRptPriceShipDAL.GetBaoJia(Convert.ToString(Session["SHOWNAME"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 启运港国内港口_下拉框
public JsonResult GetCodeLoaportList()
{
var evList = MsRptPriceShipDAL.GetCodeLoaportList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new XiaLaKuangModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 目的港国外港口_下拉框
public JsonResult GetCodeDisportList()
{
var evList = MsRptPriceShipDAL.GetCodeDisportList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new XiaLaKuangModel() });
}
else
{
var ss = Json(new { success = true, data = evList.ToList() });
return ss;
}
//var evList = MsRptPriceShipDAL.GetCodeDisportList();
//JavaScriptSerializer json = new JavaScriptSerializer();
//json.MaxJsonLength = Int32.MaxValue;
////string s = json.Serialize(evList.ToList());
////return Json(new { success = true, data = s });
//return json.Serialize(evList.ToList());
}
#endregion
#region 船公司_下拉框
public JsonResult GetCrmClientList()
{
var evList = MsRptPriceShipDAL.GetCrmClientList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new XiaLaKuangModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 航线_下拉框
public JsonResult GetCodeTradeList()
{
var evList = MsRptPriceShipDAL.GetCodeTradeList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new XiaLaKuangModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 获取当前年、周
public ContentResult GetData()
{
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 strACCDATE = MsRptPriceShipDAL.GetData(Convert.ToString(Session["USERID"]));
var json = JsonConvert.Serialize(new { Success = true, Message = "操作成功!", data = strACCDATE });
return new ContentResult() { Content = json };
}
#endregion
}
}