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/CommMng/Controllers/BasicDataRefController.cs

2332 lines
80 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using DSWeb.Areas.CommMng.DAL;
using DSWeb.Areas.CommMng.Models;
using DSWeb.Areas.RptMng.Comm;
using DSWeb.MvcShipping.DAL.MsSysParamSet;
using DSWeb.SoftMng.BLL;
using DSWeb.SoftMng.Model;
using DSWeb.TruckMng.Comm.Cookie;
using DSWeb.TruckMng.Helper;
using HcUtility.Comm;
using HcUtility.Core;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web.Mvc;
namespace DSWeb.Areas.CommMng.Controllers
{
[JsonRequestBehavior]
public class BasicDataRefController : Controller
{
//
// GET: /CommMng/BasicDataRef/GetFeeTypeRefList
#region 费用名称 费用分组
public JsonResult GetFeeTypeRefList(string condition,string CodeAndName="")
{
List<FeeTypeRefModel> evList = BasicDataRefDAL.GetFeeTypeRefList(condition, CodeAndName);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetFeeGroupRefList(string condition)
{
List<FeeTypeRefModel> evList = BasicDataRefDAL.GetFeeGroupRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
//
// GET: /CommMng/BasicDataRef/GetUserRefList
public JsonResult GetUserRefList(string condition, string dbname = "")
{
List<UserRefModel> evList = BasicDataRefDAL.GetUserRefList(condition, dbname);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetAllUserList(string condition, string dbname = "")
{
List<UserRefModel> evList = BasicDataRefDAL.GetAllUserList(condition, dbname);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetUserRefInUseList(string condition, string dbname = "")
{
if (!string.IsNullOrWhiteSpace(condition)) {
condition += " and ";
}
condition += " isnull(ISDELETED,0)=0 and isnull(ISDISABLE,0)=0 ";
List<UserRefModel> evList = BasicDataRefDAL.GetUserRefList(condition, dbname);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetUserActionRefListRm(string CODENAME,string MODULENAME, string condition = "")
{
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
}
else
{
if (condition == "")
condition = " (UserCode like '" + CODENAME + "%' or UserName like '%" + CODENAME + "%') ";
else
condition = condition + " and (UserCode like '" + CODENAME + "%' or UserName like '%" + CODENAME + "%') ";
}
List<UserRefModel> evList = BasicDataRefDAL.GetActionUserRefList(condition, MODULENAME);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetUserInUseByRoleList(string RolenameStr, string dbname = "")
{
var rolestr = "'" + RolenameStr.Replace(",", "','") + "'";
var condition = $" exists(select 1 from user_role where USERID = vMsTruckUser.GID and ROLEID in (select gid from VW_sys_roleauth where [Name] in ({rolestr}))) and isnull(ISDELETED,0)=0 and isnull(ISDISABLE,0)=0 ";
List<UserRefModel> evList = BasicDataRefDAL.GetUserRefList(condition, dbname);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
/// <summary>
/// 根据国家代码获取企业代码类型
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
public JsonResult GetEnterpriseCodetype(string code)
{
t_sys_country_codeBLL bll = new t_sys_country_codeBLL();
var list = bll.GetModelList("c_country_code='" + code + "'");
return Json(list);
}
#region 国家
public JsonResult GetCountryList(string condition)
{
var evList = BasicDataRefDAL.GetCountryList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
public JsonResult GetUser_0()
{
List<UserRefModel> evList = BasicDataRefDAL.GetUserRefList("", "");
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetUserLinkRefList(string condition)
{
List<UserLinkRefModel> evList = BasicDataRefDAL.GetUserLinkRefList(condition, Convert.ToString(Session["COMPANYID"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetUserLinkRefListRm(string CODENAME, string condition = "")
{
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
}
else
{
if (condition == "")
condition = " (u.CODENAME like '" + CODENAME + "%' or u.SHOWNAME like '%" + CODENAME + "%') ";
else
condition = condition + " and (u.CODENAME like '" + CODENAME + "%' or u.SHOWNAME like '%" + CODENAME + "%') ";
}
List<UserLinkRefModel> evList = BasicDataRefDAL.GetUserLinkRefList(condition, Convert.ToString(Session["COMPANYID"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
//
// GET: /CommMng/BasicDataRef/GetUserRefList
public JsonResult GetPluRefList(string condition)
{
List<PluRefModel> evList = BasicDataRefDAL.GetPluRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public ContentResult GetCustomRefList(string condition)
{
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
//,string CodeAndName = ""
//if (CodeAndName != "") {
// if (!string.IsNullOrWhiteSpace(condition)) {
// condition += " and ";
// }
// var cn = $"(codename like '%{CodeAndName}%' or shortname like '%{CodeAndName}%')";
// condition += cn;
//}
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomSimpleList(string condition)
{
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomSimpleList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListRm(string CODENAME, string isall = "0")
{
var condition = "";
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
} else
condition = " (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid, isall);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListRmAll(string CODENAME)
{
var condition = "";
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
}
else
condition = " (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var evList = BasicDataRefDAL.GetCustomRefListAll(condition);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListController(string CODENAME)
{
var condition = "";
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
condition = " ISCONTROLLER=1 ";
}
else condition = " ISCONTROLLER=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListController2(string CODENAME)
{
var condition = "";
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
condition = " ISCONTROLLER=1 ";
}
else condition = " ISCONTROLLER=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomRefList2(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListAgent(string CODENAME)
{
var condition = "";
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
condition = " ISAGENT=1 ";
}
else condition = " ISAGENT=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListCARRIER(string CODENAME)
{
var condition = "";
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
condition = " ISCARRIER=1 ";
}
else condition = " ISCARRIER=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListYARD(string CODENAME)
{
var condition = "";
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
condition = " ISYARD=1 ";
}
else condition = " ISYARD=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
//var userid = CookieConfig.GetCookie_UserId(Request);
//var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomRefList(condition);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListFORWARDER(string CODENAME)
{
var condition = "";
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
condition = " ISBOOKING=1 ";
}
else condition = " ISBOOKING=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListTRUCK(string CODENAME)
{
var condition = "";
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
condition = " ISTRUCK=1 ";
}
else condition = " ISTRUCK=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListCUSTOM(string CODENAME)
{
var condition = "";
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
condition = " ISCUSTOM=1 ";
}
else condition = " ISCUSTOM=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListSHIPAGENCY(string CODENAME)
{
var condition = "";
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
condition = " ISSHIPAGENCY=1 ";
}
else condition = " ISSHIPAGENCY=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListWAREHOUSE(string CODENAME)
{
var condition = "";
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
condition = " ISWAREHOUSE=1 ";
}
else condition = " ISWAREHOUSE=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListEnterp(string CODENAME)
{
var condition = "";
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
condition = " ISENTERP=1 ";
}
else condition = " ISENTERP=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public JsonResult GetCustom_SPPrice(string condition)
{
var evList = BasicDataRefDAL.GetCustom_SPPrice(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public ContentResult GetCustomYardRefList(string condition)
{
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomYardRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomInvRefList(string condition)
{
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomInvRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomInvRefListRm(string CODENAME)
{
var condition = "";
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
condition = "";
}
else condition = " (CODENAME like '" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomInvRefList(condition, ISENABLECUSTRANGE, userid);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public JsonResult GetCustomContact(string linkId)
{
var evList = BasicDataRefDAL.GetCustomContactRefList("LinkId='" + linkId + "'");
if (evList.Count == 0)
{
return Json(new { success = true, data = new CustomContactRefModel() });
}
else
{
return Json(new { success = true, data = evList[0] });
}
}
public JsonResult GetCustomContactList(string custCode)
{
var evList =
BasicDataRefDAL.GetCustomContactRefList("LINKID in (select gid from info_client where CODENAME='" +
custCode + "')");
return Json(new { success = true, data = evList.ToList() });
}
public ContentResult GetCustomACCOUNTList(string condition)
{
var evList = BasicDataRefDAL.GetMsClientAccount(condition);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public JsonResult GetAirLinesList(string condition)
{
var evList = BasicDataRefDAL.GetAirLinesList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetSource()
{
var evList = BasicDataRefDAL.GetSourceList("1=1");
if (evList.Count == 0)
{
return Json(new { success = true, data = new SourceModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetDeptList(string condition)
{
if (!string.IsNullOrEmpty(condition))
{
condition += " and LinkId='" + Convert.ToString(Session["COMPANYID"]) + "'";
}
else
{
condition = "LinkId='" + Convert.ToString(Session["COMPANYID"]) + "'";
}
var evList = BasicDataRefDAL.GetDeptList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new DeptModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetDeptList_All(string condition)
{
if (string.IsNullOrWhiteSpace(Session["USERID"].ToString())) {
return Json(new { success = true, data = new DeptModel() });
}
var evList = BasicDataRefDAL.GetDeptList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new DeptModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetDeptList_All_Group(string condition)
{
if (string.IsNullOrWhiteSpace(Session["USERID"].ToString()))
{
return Json(new { success = true, data = new DeptModel() });
}
var evList = BasicDataRefDAL.GetDeptList_Group(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new DeptModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetDeptListRm(string CODENAME)
{
var condition = "";
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
condition = "";
}
else condition = " (DEPTNAME like '" + CODENAME + "%') ";
if (!string.IsNullOrEmpty(condition))
{
condition += " and LinkId='" + Convert.ToString(Session["COMPANYID"]) + "'";
}
else
{
condition = "LinkId='" + Convert.ToString(Session["COMPANYID"]) + "'";
}
var evList = BasicDataRefDAL.GetDeptList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new DeptModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetSourceDetail(string SourceId)
{
var evList = BasicDataRefDAL.GetSourceDetailList("SOURCEID='" + SourceId + "'");
if (evList.Count == 0)
{
return Json(new { success = true, data = new SourceDetailModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetSourceDetail2(string condition)
{
var evList = BasicDataRefDAL.GetSourceDetailList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new SourceDetailModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
//
// GET: /CommMng/BasicDataRef/GetVoyRefList
public JsonResult GetVoyRefList(string condition)
{
var evList = BasicDataRefDAL.GetVoyRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
//
// GET: /CommMng/BasicDataRef/GetVoyRefList
public JsonResult GetCtnRefList(string condition)
{
var evList = BasicDataRefDAL.GetCtnRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetCtnDispList(string condition)
{
var evList = BasicDataRefDAL.GetCtnDispList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetCountryRefList(string condition)
{
var evList = BasicDataRefDAL.GetCountryRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
// GET: /CommMng/BasicDataRef/GetCargoRefList
public JsonResult GetCargoRefList(string condition)
{
var evList = BasicDataRefDAL.GetCargoRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
/// <summary>
/// 根据条件 查询HS代码对应的税率
/// </summary>
/// <param name="condition"></param>
/// <returns></returns>
public JsonResult GetCargoTax(string condition)
{
var evList = BasicDataRefDAL.GetCargoTax(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetCargociqRefList(string condition)
{
var evList = BasicDataRefDAL.GetCargociqRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
// GET: /CommMng/BasicDataRef/GetCargoRefList
public JsonResult GetcompanyList(string condition)
{
var evList = BasicDataRefDAL.GetcompanyList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
// GET: /CommMng/BasicDataRef/GetCargoRefList
public JsonResult Getimportremind(string condition)
{
var evList = BasicDataRefDAL.GetRemindList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
// GET: /CommMng/BasicDataRef/GetcurrRefList
/// <summary>
/// 币别信息 和币别的默认汇率
/// </summary>
/// <param name="condition"></param>
/// <returns></returns>
public JsonResult GetcurrRefList(string condition)
{
var evList = BasicDataRefDAL.GetcurrRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
// GET: /CommMng/BasicDataRef/GetTrader
public JsonResult GetTrader(string condition)
{
var evList = BasicDataRefDAL.GetTrader(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetPCTrader(string condition)
{
var evList = BasicDataRefDAL.GetPCTrader(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
// GET: /CommMng/BasicDataRef/GetBank
public JsonResult GetBank(string condition)
{
var evList = BasicDataRefDAL.GetBank(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
// GET: /CommMng/BasicDataRef/GetAccitems
public JsonResult GetAccitems(string condition)
{
var evList = BasicDataRefDAL.GetAccitems(condition, Convert.ToString(Session["USERID"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetMngAccitems(string condition)
{
var evList = BasicDataRefDAL.GetMngAccitems(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
//获取权限范围
public ContentResult GetAuthorityRange(string modName, string USERID)
{
var evList = BasicDataRefDAL.GetAR(modName, USERID);
AuthorityRangemb head = null;
if (evList.Count > 0)
head = evList[0];
if (head == null)
{
head = new AuthorityRangemb();
}
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = head });
return new ContentResult() { Content = json };
}
#region 获取本部门领取且未支取的支票号
public JsonResult GetUnusedCHEQUENUM(string DEPTID, string BXGID)
{
var evList = BasicDataRefDAL.GetUnusedCHEQUENUM(DEPTID, BXGID);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 获取工作流typeno 用于在工作流管理界面选择typeno
public JsonResult GetTYPENO(string condition)
{
var evList = BasicDataRefDAL.GetTYPENO(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 通过工作流名称获取该用户提交的工作流step
public JsonResult GetWorkFlowStep(string WorkFlowName)
{ //workflow.gid workflow_step.gid,userid
//var OrgCode = Convert.ToString(CookieConfig.GetCookie_OrgCode(Request));
var UserID = Convert.ToString(CookieConfig.GetCookie_UserId(Request));
var evList = BasicDataRefDAL.GetWorkFlowStep(WorkFlowName, UserID);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 键值维护表 crm_key_code
public JsonResult GetCrmKeyCodeList(string condition)
{
var evList = BasicDataRefDAL.GetCrmKeyCodeList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new CrmKeyCodeModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 品名
public JsonResult GetCodeGoodsList(string condition)
{
var evList= new List<CodeGoodsModel>();
var OPGOODUSEMSDS = MsSysParamSetDAL.GetData("PARAMNAME='OPGOODUSEMSDS'");
if (OPGOODUSEMSDS.PARAMVALUE == "1")
{
evList = BasicDataRefDAL.GetCodeMsdsGoodsList(condition);
} else evList = BasicDataRefDAL.GetCodeGoodsList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeGoodsModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetCodeGoodsListRm(string CODENAME)
{
var condition = "";
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
condition = " 1=1 ";
}
else condition = " (GOODCODE like '%" + CODENAME + "%' or GOODNAME like '%" + CODENAME + "%') ";
var evList = BasicDataRefDAL.GetCodeGoodsList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeGoodsModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetCodeGoodsListWmsRm(string CODENAME)
{
var condition = "";
var evList = new List<CodeGoodsModel>();
var WMSGOODNAMEIMPORTTRADE = MsSysParamSetDAL.GetData("PARAMNAME='WMSGOODNAMEIMPORTTRADE'");
if (WMSGOODNAMEIMPORTTRADE.PARAMVALUE == "1")
{
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
condition = " 1=1 ";
}
else condition = " CNNAME like '%" + CODENAME + "%' ";
evList = BasicDataRefDAL.GetImportCodeGoodsList(condition);
}
else {
if (string.IsNullOrWhiteSpace(CODENAME) || string.IsNullOrWhiteSpace(CODENAME.Trim()))
{
condition = " 1=1 ";
}
else condition = " (GOODCODE like '%" + CODENAME + "%' or GOODNAME like '%" + CODENAME + "%') ";
evList = BasicDataRefDAL.GetCodeGoodsList(condition);
}
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeGoodsModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
public ContentResult GetInvTemplateList(string condition)
{
var evList = BasicDataRefDAL.Getsys_templateList();
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
#region 品名明细表
public JsonResult GetCodeGoodsDetailList(string condition)
{
var evList = BasicDataRefDAL.GetCodeGoodsDetailList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeGoodsDetailModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 新版键值维护表 tSysEnumValue
public JsonResult GetTSysEnumValueList(string condition)
{
var evList = BasicDataRefDAL.GetTSysEnumValueList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new TSysEnumValueDataModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 国际港口(进口装货港、出口卸货港)
public JsonResult GetCodeDisportList()
{
var evList = BasicDataRefDAL.GetCodeDisportList("");
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeDisportModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetCodeDisportListRm(string PORT="",string LANE="")
{
if (PORT == "" && LANE=="")
{
return Json(new { success = true, data = new CodeDisportModel() });
}
var condition = " (PORT LIKE '%" + PORT + "%' or CNAME like '%" + PORT + "%' or EDICODE like '%" + PORT + "%')";
if (!string.IsNullOrWhiteSpace(LANE)) {
condition += " and PORTID in(select PORTID from vw_code_lanes_port where LANE='"+ LANE + "')";
}
var evList = BasicDataRefDAL.GetCodeDisportList(condition);
if (evList.Count == 1)
{
//当指定航线 没指定港口 然后返回值为空 则返回全部港口
if (PORT == "" && LANE != "")
{
condition = "1=1";
evList = BasicDataRefDAL.GetCodeDisportList(condition);
return Json(new { success = true, data = evList.ToList() });
}
else
{
return Json(new { success = true, data = new CodeDisportModel() });
}
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 国内港口(出口装货港、进口卸货港)
public JsonResult GetCodeLoadportListRm(string PORT)
{
if (PORT == "")
{
return Json(new { success = true, data = new CodeLoadportModel() });
}
var evList = BasicDataRefDAL.GetCodeLoadportList(" PORT LIKE '%" + PORT + "%' or CNAME like '%" + PORT + "%'");
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeLoadportModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetCodeLoadportList()
{
var evList = BasicDataRefDAL.GetCodeLoadportList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeLoadportModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 全部港口
public JsonResult GetCodeAllPortList()
{
var evList = BasicDataRefDAL.GetCodeDisportList("");
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeDisportModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 铁路港口
public JsonResult GetCodeRailwayPortListRm(string PORT)
{
if (PORT == "")
{
return Json(new { success = true, data = new CodeDisportModel() });
}
var evList = BasicDataRefDAL.GetCodeRailwayPortList(" PORTENAME LIKE '%" + PORT + "%' or PORTCNAME like '%" + PORT + "%'");
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeDisportModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 品名类型
public JsonResult GetCodeGoodsTypeList()
{
var evList = BasicDataRefDAL.GetCodeGoodsTypeList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeLoadportModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 箱型
public JsonResult GetCodeCtnList()
{
var evList = BasicDataRefDAL.GetCodeCtnList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeCtnModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 集装箱显示
public JsonResult GetCtnDisp()
{
var evList = BasicDataRefDAL.GetCtnDisp();
if (evList == null)
{
return Json(new { success = true, data = new CtnDispModel() });
}
else
{
return Json(new { success = true, data = evList });
}
}
#endregion
#region 航线
public JsonResult GetCodeLaneList(string CUSTOMERNAME="")
{
var evList = BasicDataRefDAL.GetCodeLaneList(CUSTOMERNAME);
if (evList.Count == 0)
{
return Json(new { success = true, data = new LaneModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 付费方式
public JsonResult GetCodeFrtList()
{
var evList = BasicDataRefDAL.GetCodeFrtList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeFrtModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 签单方式
public JsonResult GetCodeBLTYPEList()
{
var evList = BasicDataRefDAL.GetCodeBLTYPEList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeBLTYPEModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 运输条款
public JsonResult GetCodeSERVICEList()
{
var evList = BasicDataRefDAL.GetCodeSERVICEList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeSERVICEModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 提单模板
public JsonResult GetCodeTemplateList()
{
var evList = BasicDataRefDAL.GetCodeTemplateList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeTemplateModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 船名
public JsonResult GetVesselList(string condition)
{
var evList = BasicDataRefDAL.GetVesselList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new VesselModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetVoyNoList(string condition)
{
var evList = BasicDataRefDAL.GetVoyNoList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new VesselModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 件数包装
public JsonResult GetCodePackageList()
{
var evList = BasicDataRefDAL.GetCodePackageList();
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodePackageModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 币别
public JsonResult GetCodeCurrencyList(string condition)
{
var evList = BasicDataRefDAL.GetCodeCurrencyList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new CodeCurrencyModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 委托单位_联系人
public JsonResult GetInfoClientContactList(string condition)
{
var evList = BasicDataRefDAL.GetInfoClientContactList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new InfoClientContactModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
//委托单位 电话 邮箱 (含委托单位的)
public JsonResult GetInfoClientMailTel(string CUSTOMERNAME)
{
var evList = BasicDataRefDAL.GetInfoClientMailTel(CUSTOMERNAME);
if (evList.Count == 0)
{
return Json(new { success = true, data = new InfoClientContactModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 项目
public JsonResult GetCwItemList(string condition)
{
var evList = BasicDataRefDAL.GetCwItemList(condition, Convert.ToString(Session["USERID"]));
if (evList.Count == 0)
{
return Json(new { success = true, data = new CwItemModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 科目币别表
public ContentResult GetCwAccitemsCurrencyList(string condition)
{
var dataList = BasicDataRefDAL.GetCwAccitemsCurrencyList(condition, Convert.ToString(Session["USERID"]));
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", data = dataList.ToList() });
return new ContentResult() { Content = json };
}
#endregion
#region 业务类型
public JsonResult GetOPLBList(string condition)
{
var evList = BasicDataRefDAL.GetOPLBList(condition);
if (evList.Count == 0)
{
return Json(new { success = true, data = new OPLBModel() });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 总账科目信息
public JsonResult GetCwAccitemsGl(string condition)
{
var evList = BasicDataRefDAL.GetCwAccitemsGl(condition, Convert.ToString(Session["USERID"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 总账科目信息(包含上级科目)
public JsonResult GetCwAccitemsGlAll(string condition)
{
var evList = BasicDataRefDAL.GetCwAccitemsGlAll(condition, Convert.ToString(Session["USERID"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 接口科目信息
public JsonResult GetCwAccitems(string condition)
{
var evList = BasicDataRefDAL.GetCwAccitems(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 获取指定表内,符合条件的行的数量,主要用于防止删除主表
public ContentResult GetExist(string tablename, string condition)
{
var _count = BasicDataRefDAL.GetExist(tablename, condition);
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = _count });
return new ContentResult() { Content = json };
}
public ContentResult GetExist2(string tablename, string condition, string tablename2, string condition2)
{
var _count = BasicDataRefDAL.GetExist(tablename, condition);
_count = _count + BasicDataRefDAL.GetExist(tablename2, condition2);
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = _count });
return new ContentResult() { Content = json };
}
#endregion
#region 通用上传文件方法 20191008重构
#region 典型调用方法
/*
URLINFO = { KeyValue: record.data.GID}; //该列数据主键值
UrlType = _this.PicUploadType; //在FileUrlModel当中设定的某个类型
onUpLoadFileClick: function(URLINFO, UrlType)
{
me = this;
var imgform = new Ext.FormPanel({
region: 'center',
labelWidth: 40,
frame: true,
//bodyStyle: 'padding:5px 5px 0',
//autoScroll: true,
border: false,
fileUpload: true,
items: [
{
xtype: 'fileuploadfield',
id: 'LoadFile',
name: 'LoadFile',
emptyText: '请选择文件',
fieldLabel: '文件',
buttonText: '选择文件',
//20191008 对上传的文件扩展名暂时不做限制
//regex: /^.+\.(jpg|jpeg|png|pdf|gif|bmp|tiff)$/,
//regexText: "只能选择jpg|jpeg|png|pdf|gif|bmp|tiff格式的文件",
allowBlank: false,
buttonCfg: { iconCls: 'uploaddialog' },
anchor: '99%'
}],
buttons: [{
text: '上传',
type: 'submit',
handler: function() {
var UserFilePath = Ext.getCmp('LoadFile').getValue();
//if (!CheckFileExt(UserFilePath, /.frx/i)) {
// Ext.Msg.show({ title: '错误', msg: '请确认你上传的文件为frx文件!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
//}
if (!imgform.form.isValid()) { return; }
imgform.form.submit({
url: '/CommMng/BasicDataRef/FileUpload',
waitMsg: '正在上传',
method: 'POST',
submitEmptyText: false,
async: false,
params: {
URLINFO: Ext.JSON.encode(URLINFO),
UrlType: UrlType
},
success: function(form, action) {
win.close(this);
Ext.Msg.show({ title: '提示', msg: '上传成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
failure: function(form, action) {
form.reset();
win.close(this);
// if (action.failureType == Ext.form.Action.SERVER_INVALID) {
// Ext.MessageBox.alert('警告', action.result.errors.msg);
// }
}
});
}
}, {
text: '关闭',
type: 'submit',
handler: function() {
win.close(this);
}
}]
});
var win = new Ext.Window({
title: "上传文件",
width: 360,
height: 200,
modal: true,
resizable: false,
border: false,
items: imgform
});
win.show();
}*/
/*新的调用方式
* function UpLoadFile(URLINFO, UrlType, ResultAction, _this)
* 参数说明:
* URLINFO { KeyValue: 主表的主键值, INDATABASE: "false" };INDATABASE代表这个文件是否往数据库里直接存。如果是的话需要定义ImgName放置文件的字段名;
* UrlType一个字串 程序内固化其内容,一个字串会对应一组数据 包括TableName表名 KeyName表主键字段名 UrlName表中保存文件路径的字段名
//ResultAction调用此方法的js实体需实现这个函数以便执行保存操作后操作。
//该函数需要两个参数参数1为一个传回的str参数2为this作用域函数体内容为【在这个函数内利用str对this作用域的元素做xxx操作】
//_this:调用此方法的js实体的this作用域
*/
#endregion
[HttpPost]
public ContentResult FileUpload(string URLINFO, string UrlType = "")
{
//UrlType形如 'CargoName' 用于在FileUrlModel当中标示某个表名与字段名的组合
//如果没有就必须在URLINFO中写清所有信息
// KeyValue在URLINFO中是必须的
var URLInfo = new FileUrlModel(URLINFO, UrlType);
jsonresponse result = new jsonresponse();
if (Request.Files.Count != 1)
{
result.success = false;
result.message = "请选择上传的文件";
return new ContentResult() { Content = JsonConvert.Serialize(result) };
}
//FilePath
var file = Request.Files["LoadFile"];
if (file == null)
{
result.success = false;
result.message = "上传文件发生未知错误,请重新上传";
return new ContentResult() { Content = JsonConvert.Serialize(result) };
}
var _r = URLInfo.SaveFile(file);
if (string.IsNullOrEmpty(_r))
{
result.success = false;
result.message = "没有正确上传文件";
return new ContentResult() { Content = JsonConvert.Serialize(result) };
}
else {
result.success = true;
result.message = "文件上传成功";
result.data = _r;
ContentResult r = new ContentResult();
r.Content = JsonConvert.Serialize(result);
return r;
}
}
#endregion
#region 获取指定表内,符合条件的第一行
public ContentResult GetField(string tablename, string condition)
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(" top 1 * ");
strSql.Append(" from " + tablename + " ");
if (!string.IsNullOrEmpty(condition))
{
strSql.Append(" where " + condition);
}
var dbparams = new List<CustomDbParamter>();
var paramps_sSQL = new CustomDbParamter();
paramps_sSQL.ParameterName = "@sSQL";
paramps_sSQL.DbType = DbType.String;
paramps_sSQL.Direction = ParameterDirection.Input;
paramps_sSQL.Value = strSql.ToString();
dbparams.Add(paramps_sSQL);
var dbRptResult = PubSysDAL.GetMsSqlPrcDataSet("sMsExesqlQry", dbparams, "Result_Set");
var json = RptHelper.GetRptJsonResult(0, 1, dbRptResult, "Result_Set", true);
return new ContentResult() { Content = json };
}
#endregion
#region 出纳摘要信息
public JsonResult GetEXPLAN(string condition)
{
var evList = BasicDataRefDAL.GetEXPLAN(condition, Convert.ToString(Session["USERID"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 通用查询方法 参数是查询语句必须把GID和值as成GID和GValue
public JsonResult GeneralSelect(string condition)
{
//select distinct bankname2 as GVALUE,'' as GID from sys_bank
var evList = BasicDataRefDAL.GeneralSelect(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public JsonResult GetAllPort(string PORT)
{
var condition = "select t.* from (select PORT+'-'+ isnull(EDICODE,'') as GVALUE,PORTID as GID from code_loadport union all select PORT+'-'+ isnull(EDICODE,'') as GVALUE,PORTID as GID from code_disport)t ";
if (!string.IsNullOrWhiteSpace(PORT))
{
condition += $" where t.GVALUE like '%{PORT}%' ";
}
else {
condition += $" where 1=2 ";
}
var evList = BasicDataRefDAL.GeneralSelect(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
/// <summary>
/// 获取角色列表
/// </summary>
/// <param name="RoleName"></param>
/// <returns></returns>
public JsonResult GetRoleList(string RoleName)
{
var condition = "select GID ,[Name] GVALUE from VW_sys_roleauth ";
if (!string.IsNullOrWhiteSpace(RoleName))
{
condition += $" where [Name] like '%{RoleName}%' ";
}
else
{
//condition += $" where 1=2 ";
}
var evList = BasicDataRefDAL.GeneralSelect(condition);
evList.Add(new GeneralModel());
return Json(new { success = true, data = evList.ToList() });
//if (evList.Count == 0)
//{
// return Json(new { success = true, data = evList.ToList() });
//}
//else
//{
// return Json(new { success = true, data = evList.ToList() });
//}
}
#endregion
#region InfoClass管理分类表
public JsonResult GetMsInfoClass(string condition)
{
var evList = BasicDataRefDAL.GetMsInfoClass(condition, Convert.ToString(Session["USERID"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 客户子项目
public JsonResult GetMsInfoClientItem(string condition)
{
var evList = BasicDataRefDAL.GetMsInfoClientItem(condition, Convert.ToString(Session["USERID"]));
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
#endregion
#region 获取系统参数
public JsonResult GetParamValue(string PARAMNAME)
{
if (string.IsNullOrWhiteSpace(Session["USERID"].ToString())) {
return Json(new { success = false });
}
var paramvalue = MsSysParamSetDAL.GetSysParamValue(PARAMNAME);
if (string.IsNullOrWhiteSpace(paramvalue))
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = paramvalue });
}
}
#endregion
//#region 获取表刷新时间 以供前台决定是否更新表
////更新状态表
//public ContentResult GetTableStatusList()
//{
// var evList = BasicDataRefDAL.GetTableStatusList();
// if (evList.Count == 0)
// {
// var json = JsonConvert.Serialize(new { success = false });
// //return Json(new { success = false });
// return new ContentResult() { Content = json };
// }
// else
// {
// var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
// //return Json(new { success = true, data = evList.ToList() });
// return new ContentResult() { Content = json };
// }
//}
//// 获取通用表方式的store
//public ContentResult getPubStore(string STORENAME)
//{
// var userinfo = new USERINFO("EVERYONE");
// try
// {
// //
// if (STORENAME == "INFOCLIENT_ISCONTROLLER" || STORENAME == "OPSEAE_CUST_ISCONTROLLER" || STORENAME == "INFOCLIENT_INV" || STORENAME == "INFOCLIENT_ALL" || STORENAME == "INFOCLIENT_CARRIER")
// {
// var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
// var BLSTATUSSTR = "";
// try
// {
// var InfoClintBlstatus = MsSysParamSetDAL.GetData("PARAMNAME='InfoClintBlstatus'");
// if (InfoClintBlstatus.PARAMVALUE != "")
// {
// if (InfoClintBlstatus.PARAMVALUE == "1")
// {
// BLSTATUSSTR = " BLSTATUS=0 ";
// }
// }
// }
// catch
// {
// }
// userinfo = new USERINFO(Session["USERID"].ToString(), BLSTATUSSTR, ISENABLECUSTRANGE);
// }
// var storemb = StoreModifyStatusMb.getStore(STORENAME, userinfo);
// var diclist = ModelObjectBill.getDicList(ModelObjectConvert<PubStoremb>.ToModelObjectList(storemb));
// if (diclist.Count == 0)
// {
// var json = JsonConvert.Serialize(new { success = false });
// return new ContentResult() { Content = json };
// }
// else
// {
// var json = JsonConvert.Serialize(new { success = true, data = diclist.ToList() });
// return new ContentResult() { Content = json };
// }
// }
// catch (Exception e)
// {
// var json = JsonConvert.Serialize(new { success = true });
// return new ContentResult() { Content = json };
// }
//}
///// <summary>
/////
///// </summary>
///// <param name = "start" ></ param >
///// < param name="limit"></param>
///// <param name = "condition" ></ param >
///// < param name="sort"></param>
///// <returns></returns>
//public ContentResult getPubExtendStore(string STORENAME, string sort = "")
//{
// var userid = CookieConfig.GetCookie_UserId(Request);
// var SqlStr = "";
// var dataList = new List<PubStoremb>();
// if (STORENAME == "OPSEAE_CUST_ISCONTROLLER")
// {
// var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
// SqlStr = BasicDataRefDAL.GetCustomRefList_GetSqlStr(" ISCONTROLLER=1 ", ISENABLECUSTRANGE, userid).ToString();
// dataList = BasicDataRefDAL.getPubExtendStore(SqlStr);
// }
// if (STORENAME == "INFOCLIENT_CARRIER")
// {
// var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
// SqlStr = BasicDataRefDAL.GetCustomRefList_GetSqlStr(" ISCARRIER=1 ", ISENABLECUSTRANGE, userid).ToString();
// dataList = BasicDataRefDAL.getPubExtendStore(SqlStr);
// }
// var diclist = ModelObjectBill.getDicList(ModelObjectConvert<PubStoremb>.ToModelObjectList(dataList));
// if (diclist.Count == 0)
// {
// var json = JsonConvert.Serialize(new { success = false });
// return new ContentResult() { Content = json };
// }
// else
// {
// var json = JsonConvert.Serialize(new { success = true, data = diclist.ToList() });
// return new ContentResult() { Content = json };
// }
//}
//#endregion
#region 多种业务使用的业务信息查询
public ContentResult GetVOPBSList(int start, int limit,string OPLB, string sort, string condition)
{
var dataList = BasicDataRefDAL.getVOPBSStore(start, limit, OPLB, condition,sort);
var list = ModelObjectBill.getDicList(ModelObjectConvert<VOPBSmb>.ToModelObjectList(dataList));
//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 string GetSecCompnany(string GID)
{
DBResult result = new DBResult();
try
{
sys_secCompanyBLL cbll = new sys_secCompanyBLL();
sys_secCompany cmodel = cbll.GetModelList("GID='"+ GID + "'").FirstOrDefault();
result.setMessage(true, "");
result.Data = cmodel;
}
catch (Exception e)
{
result.SetErrorInfo(e.Message);
}
return JsonConvert.Serialize(result) ;
}
public string GetSecModel(string GID)
{
DBResult result = new DBResult();
try
{
sys_secModuleBLL ServerModel = new sys_secModuleBLL();
List<sys_secModule> ServerModelList = ServerModel.GetModelList("PID='" + GID + "'");
result.setMessage(true, "");
result.Data = ServerModelList.ToList();
}
catch (Exception e)
{
result.SetErrorInfo(e.Message);
}
return JsonConvert.Serialize(result);
}
#endregion
#region 查询指定userid是否具备指定权限范围能否看到某个模块/具备某个sys_module的权限在user_action中查找
public ContentResult CheckAuthority(string modname)
{
//前台方法在 mvcshipping/DsextjsEx.js内
//select * from * from user_action where USERID='2e10cf95-59e9-46c7-a4f1-90728fa242c9' and ACTIONID=(select gid from [action] where NAME='modSeaeExportManagement'
var _r = BasicDataRefDAL.CheckAuthority(Session["USERID"].ToString(), modname);
var json = JsonConvert.Serialize(new { Success = true, Message = "有操作权限" });
if (!_r)
{
json = JsonConvert.Serialize(new { Success = false, Message = "无操作权限" });
}
return new ContentResult() { Content = json };
}
#endregion
#region 根据BSNO查找业务中服务人员的联系方式
public ContentResult GetOPUSERINFO(string BSNO)
{
var dataList = BasicDataRefDAL.GetOPUSERINFO(BSNO);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
/// <summary>
/// 查找销售订舱中的联系人信息
/// </summary>
/// <param name="BSNO"></param>
/// <returns></returns>
public ContentResult GetSeaeSaleOrderUSERINFO(string BSNO)
{
var dataList = BasicDataRefDAL.GetSeaeSaleOrderUSERINFO(BSNO);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
#endregion
}
}