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.

790 lines
33 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DSWeb.MvcShipping.DAL.MsChFeeDAL;
using DSWeb.MvcShipping.Models.MsChFee;
using DSWeb.MvcShipping.Models.MsOpAmend;
using DSWeb.MvcShipping.Helper;
using HcUtility.Comm;
using HcUtility.Core;
using DSWeb.TruckMng.Comm.Cookie;
using DSWeb.TruckMng.Helper.Repository;
using DSWeb.EntityDA;
using DSWeb.MvcShipping.DAL.MsSysParamSet;
using DSWeb.MvcShipping.DAL.MsSysBillNoSet;
using DSWeb.MvcShipping.Models.MsSysBillNoSet;
using DSWeb.MvcShipping.DAL.ChMonthCloseDAL;
using DSWeb.Areas.CommMng.DAL;
using DSWeb.MvcShipping.DAL.MsBaseInfoDAL;
namespace DSWeb.MvcShipping.Controllers
{
[JsonRequestBehavior]
public class MsChFeeController : Controller
{
//
// GET: /MvcShipping/MsChFee/GetDataList
public ActionResult TemplateAddIndex()
{
return View();
}
public ActionResult YJFeeEditIndex()
{
return View();
}
/*
public ContentResult GetDataList(string billno, int type, string optype)
{
var dataList = MsChFeeDAL.GetDataList("BsNo='" + billno + "' and FeeType=" + type,type,optype, 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 GetDataList(string billno, int type, string optype, string condition, string SaleFee="")
{
var fieldcomm = "";
if (condition != null && condition.Trim() != "")
{
var dataList = MsChFeeDAL.GetDataList(condition, type, optype, 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 };
}
else
{
var dataList = MsChFeeDAL.GetDataList("BsNo='" + billno + "' and FeeType=" + type + fieldcomm, type, optype, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
if (type == 2 && SaleFee=="1")
{
var YJFADDTOHYF = MsSysParamSetDAL.GetData("PARAMNAME='YJFADDTOHYF'");
if (YJFADDTOHYF.PARAMVALUE == "1")
{
var YJFEENAME = MsSysParamSetDAL.GetData("PARAMNAME='YJFEENAME'");
dataList = MsChFeeDAL.SetYjData(dataList, YJFEENAME.PARAMVALUE);
}
}
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetDataListStr(string billno, int type, string optype, string condition, string SaleFee = "")
{
var fieldcomm = "";
if (condition != null && condition.Trim() != "")
{
var dataListStr = MsChFeeDAL.GetDataListStr(condition, type, optype, 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 };
}
else
{
var dataListStr = MsChFeeDAL.GetDataListStr("BsNo='" + billno + "' and FeeType=" + type + fieldcomm, type, optype, 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 };
}
}
public ContentResult GetRangDAStr(int type, string optype)
{
var rangstr = MsChFeeDAL.GetRangDAStr(type, optype, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
var isopen = MsBaseInfoDAL.GetUserModuleEnable("modFeenotopen", Convert.ToString(Session["USERID"]));
var isopenstr = "";
if (isopen == false)
{
isopenstr = " ( ENTEROPERATOR='" + Convert.ToString(Session["USERID"]) + "' OR ( ENTEROPERATOR<>'" + Convert.ToString(Session["USERID"]) + "' AND (ISOPEN=0 OR ISOPEN IS NULL))) ";
if (!string.IsNullOrEmpty(rangstr))
rangstr = rangstr + " and " + isopenstr;
else
rangstr = isopenstr;
}
var isacc = MsBaseInfoDAL.GetUserModuleEnable("modISWACC", Convert.ToString(Session["USERID"]));
var isaccstr = "";
if (isacc == false)
{
isaccstr = " ISNULL(ISACC,0)=0 ";
if (!string.IsNullOrEmpty(rangstr))
rangstr = rangstr + " and " + isaccstr;
else
rangstr = isaccstr;
}
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", data = rangstr });
return new ContentResult() { Content = json };
}
public ContentResult GetSaleDataList(string billno, int type, string optype, string condition)
{
var fieldcomm = "";
if (condition != null && condition.Trim() != "")
{
var dataList = MsChFeeDAL.GetDataList(condition, type, optype, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
var YJFADDTOHYF = MsSysParamSetDAL.GetData("PARAMNAME='YJFADDTOHYF'");
if (YJFADDTOHYF.PARAMVALUE == "1") {
var YJFEENAME = MsSysParamSetDAL.GetData("PARAMNAME='YJFEENAME'");
dataList = MsChFeeDAL.SetYjData(dataList, YJFEENAME.PARAMVALUE);
}
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
else
{
var dataList = MsChFeeDAL.GetDataList("BsNo='" + billno + "' and FeeType=" + type + fieldcomm, type, optype, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
var YJFADDTOHYF = MsSysParamSetDAL.GetData("PARAMNAME='YJFADDTOHYF'");
if (YJFADDTOHYF.PARAMVALUE == "1")
{
var YJFEENAME = MsSysParamSetDAL.GetData("PARAMNAME='YJFEENAME'");
dataList = MsChFeeDAL.SetYjData(dataList, YJFEENAME.PARAMVALUE);
}
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetImportDataList ( string billno, int type, string optype, List<string> Fields, List<string> Values )
{
var fieldcomm = "";
if (Fields != null)
{
if (Fields.Count != Values.Count)
{
var json2 = JsonConvert.Serialize(new { Success = false, Message = "错误,字段和数值数量不相等", totalCount = 0, data = "" });
return new ContentResult() { Content = json2 };
}
else
for (int _i = 0; _i < Fields.Count; _i++)
{
fieldcomm += " and " + Fields[_i] + " = '" + Values[_i] + "' ";
}
}
var dataList = MsChFeeDAL.GetImportDataList("BsNo='" + billno + "' and FeeType=" + type + fieldcomm, type, optype, 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 GetGainData(string bsno)
{
var dataList = MsChFeeDAL.GetDataGainList("BsNo='" + bsno + "'", Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
if (dataList.Count == 0) {
var bodyList = new List<MsChFeeGain>();
MsChFeeGain data = new MsChFeeGain();
bodyList.Add(data);
dataList = bodyList;
}
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult GetAmendGainData(string bsno)
{
var dataList = MsChFeeDAL.GetDataAmendGainList("B.PARENTID='" + bsno + "'", Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
if (dataList.Count == 0)
{
var bodyList = new List<MsChFeeGain>();
MsChFeeGain data = new MsChFeeGain();
bodyList.Add(data);
dataList = bodyList;
}
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult GetModifyData(string FeeID, string ApplyType)
{
var dataList = MsChFeeDAL.GetModifyData(FeeID,ApplyType);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult GetModifyAllData(string FeeID, string ApplyType)
{
var dataList = MsChFeeDAL.GetModifyAllData(FeeID, ApplyType);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult GetOPGainList(string bsno)
{
var LOCALCURR = CookieConfig.GetCookie_LocalCurr(Request);
var dataList = new List<MsOpGain>();
var FEEEDITTOTALADDAMEND = MsSysParamSetDAL.GetData("PARAMNAME='FEEEDITTOTALADDAMEND'");
if (FEEEDITTOTALADDAMEND.PARAMVALUE == "1")
{
dataList = MsChFeeDAL.GetOPGainAMENDList("B.PARENTID='" + bsno + "'", Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), LOCALCURR);
}
else {
dataList = MsChFeeDAL.GetOPGainList("BsNo='" + bsno + "'", Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), LOCALCURR);
}
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult GetMBLGainList(string condition)
{
var dataList = MsChFeeDAL.GetMBLGainList(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 GetAmendList(string billno)
{
var dataList = MsChFeeDAL.GetAmendList("PARENTID='" + billno + "'");
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult Save(string bsno, string chfeebody)
{
int iResult = 0;
var bodyList = JsonConvert.Deserialize<List<MsChFee>>(chfeebody);
var result =new DBResult();
if (bodyList != null)
{
iResult = MsChFeeDAL.SaveUpdateFee(bodyList, bsno, CookieConfig.GetCookie_UserId(Request));
}
if (iResult == 1) {
result.Success=true;
result.Message = "更新成功!";
MsChFeeDAL.p_op_gain(bsno, CookieConfig.GetCookie_UserId(Request));//Convert.ToString(Session["USERID"]));
}
else if (iResult == 0)
{
result.Success = true;
result.Message = "更新成功!";
}
else if (iResult == -1)
{
result.Success = false;
result.Message = "有异常,插入失败!";
}
else if (iResult == -2)
{
result.Success = false;
result.Message = "插入异常,事务已回滚成功!";
}
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
// Data = MsChFeeDAL.GetDataList(headData.BillNo, Convert.ToString(Session["USERID"]), CookieConfig.GetCookie_UserCode(Request), CookieConfig.GetCookie_OrgCode(Request))
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult Delete(string bsno,string data)
{
int iResult = 0;
var bodyList = data;
var result = new DBResult();
if (bodyList !="" ||bodyList != null)
{
iResult = MsChFeeDAL.DeleteFee(bodyList);
MsChFeeDAL.p_op_gain(bsno, Convert.ToString(Session["USERID"]));
}
if (iResult == 1)
{
result.Success = true;
result.Message = "删除成功!";
}
else if (iResult == 0)
{
result.Success = false;
result.Message = "出现错误,未删除!";
}
else if (iResult == -1)
{
result.Success = false;
result.Message = "有异常,删除失败!";
}
else if (iResult == -2)
{
result.Success = false;
result.Message = "删除异常,事务已回滚成功!";
}
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
// Data = MsChFeeDAL.GetDataList(headData.BillNo, Convert.ToString(Session["USERID"]), CookieConfig.GetCookie_UserCode(Request), CookieConfig.GetCookie_OrgCode(Request))
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult DeleteAmend(string data)
{
var head = JsonConvert.Deserialize<MsOpAmend>(data);
var modb = new ModelObjectDB();
DBResult result = modb.Delete(head);
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult GetAmendData(string handle, string condition)
{
MsOpAmend head = null;
if (handle == "edit" || handle == "copyadd")
{
var headlist = MsChFeeDAL.GetAmendList(condition);
if (headlist.Count > 0)
head=headlist[0];
else
head = new MsOpAmend();
}
if (head == null)
{
head = new MsOpAmend();
head.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
head.CREATEUSER = Convert.ToString(Session["SHOWNAME"]);
var period = ChMonthCloseDAL.GetData("", Convert.ToString(Session["COMPANYID"]));
if (Convert.ToDateTime(period.FDAY) > DateTime.Now)
{
head.ACCDATE = period.PERIOD;
}
}
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = head });
return new ContentResult() { Content = json };
}
public ContentResult SaveAmendData(string opstatus,string data,string bsno)
{
var head = JsonConvert.Deserialize<MsOpAmend>(data);
head.PARENTID = bsno;
var modb = new ModelObjectDB();
head.ACCDATE = head.ACCDATE.Substring(0, 7);
if (opstatus == "add")
{
head.GID = Guid.NewGuid().ToString();
head.BSNO = Guid.NewGuid().ToString();
head.PARENTID = bsno;
head.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
head.CREATEUSER = Convert.ToString(Session["SHOWNAME"]);
head.DbOperationType = DbOperationType.DbotIns;
if (string.IsNullOrEmpty(head.AMENDNO))
{
var billnoset = MsSysBillNoSetDAL.GetData("OPLBNAME='更改单'", Convert.ToString(Session["COMPANYID"]));
if (billnoset.BILLTYPE != "")
head.AMENDNO = MsSysBillNoSetDAL.GetBillNo(billnoset, DateTime.Now.ToString("yyyy-MM-dd"), head.ACCDATE.ToString().Trim(), DateTime.Now.ToString("yyyy-MM-dd"), head.CREATEUSER);
}
}
else
{
head.DbOperationType = DbOperationType.DbotUpd;
}
DBResult result = modb.Save(head);
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = MsChFeeDAL.GetAmendData("BSNO='" + head.BSNO + "'")
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult SaveAmend(string bsno, string data, string chdrfeebody, string chcrfeebody)
{
int iResult = 1;
var head = JsonConvert.Deserialize<MsOpAmend>(data);
var bodyListdr = JsonConvert.Deserialize<List<MsChFee>>(chdrfeebody);
var bodyListcr = JsonConvert.Deserialize<List<MsChFee>>(chcrfeebody);
var result = new DBResult();
var billno = head.BSNO;
if (bodyListdr != null)
{
iResult = MsChFeeDAL.SaveUpdateFee(bodyListdr, bsno, Convert.ToString(Session["USERID"]));
}
if (bodyListcr != null)
{
iResult = MsChFeeDAL.SaveUpdateFee(bodyListcr, bsno, Convert.ToString(Session["USERID"]));
}
if (iResult == 1)
{
result.Success = true;
result.Message = "更新成功!";
MsChFeeDAL.p_op_gain(bsno, Convert.ToString(Session["USERID"]));
var modb = new ModelObjectDB();
head.ACCDATE = head.ACCDATE.Substring(0,7);
if (head.CREATETIME == "")
{
head.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
head.CREATEUSER = Convert.ToString(Session["SHOWNAME"]);
head.DbOperationType = DbOperationType.DbotIns;
if (string.IsNullOrEmpty(head.AMENDNO))
{
var billnoset = MsSysBillNoSetDAL.GetData("OPLBNAME='更改单'", Convert.ToString(Session["COMPANYID"]));
if (billnoset.BILLTYPE != "")
head.AMENDNO = MsSysBillNoSetDAL.GetBillNo(billnoset, DateTime.Now.ToString("yyyy-MM-dd"), head.ACCDATE.ToString().Trim(), "", head.CREATEUSER);
}
}
else
{
head.DbOperationType = DbOperationType.DbotUpd;
}
modb.Save(head);
}
else if (iResult == 0)
{
result.Success = false;
result.Message = "出现错误,未更新!";
}
else if (iResult == -1)
{
result.Success = false;
result.Message = "有异常,插入失败!";
}
else if (iResult == -2)
{
result.Success = false;
result.Message = "插入异常,事务已回滚成功!";
}
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = MsChFeeDAL.GetAmendList("BSNO='" + billno + "'")
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult DeleteAmendList(string data)
{
var headData = JsonConvert.Deserialize<List<MsOpAmend>>(data);
var errstr = "";
if (headData != null)
{
T_ALL_DA T_ALL_DA = new T_ALL_DA();
foreach (var enumValue in headData)
{
var BLCOUNT = T_ALL_DA.GetStrSQL("BLCOUNT", "select count(*) BLCOUNT from ch_fee WHERE BSNO='" + enumValue.BSNO + "'");
if (BLCOUNT == "0"){
string blUpSQL = "delete from op_amend where BSNO='" + enumValue.BSNO + "'";
bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
}
else
{
if (errstr == "")
errstr = enumValue.BSNO;
else
errstr = errstr + "," + enumValue.BSNO;
}
}
}
if (errstr == "") errstr = "删除成功!";
else errstr = "存在费用,请先删除费用才能删除此票更改单!";
var jsonRespose = new JsonResponse { Success = true, Message = errstr };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
/*
public ContentResult GetAuditDataList(string billno)
{
var dataList = MsChFeeDAL.GetDataList("BsNo='" + billno + "' and (FeeStatus<>1 and FeeStatus<>6)");
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
*/
public ContentResult Audit(int newStatus, string list)
{
var chfeeList = JsonConvert.Deserialize<List<MsChFee>>(list);
DBResult result = MsChFeeDAL.Audit(newStatus, chfeeList);
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult GetCtnUnitList(string bsno,string bstype)
{
var list = MsChFeeDAL.GetCtnUnitList(bsno,bstype);
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = list.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult GetFeeCurrList(string condition)
{
var list = MsChFeeDAL.GetFeeCurrList();
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = list.ToList() });
return new ContentResult() { Content = json };
}
public JsonResult GetFeeTypeRefList(string condition)
{
List<FeeTypeRefModel> evList = MsChFeeDAL.GetFeeTypeRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
public ContentResult GetFeeOpRang(string optype)
{
var list = MsChFeeDAL.GetFeeOpRang(optype, Convert.ToString(Session["USERID"]));
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = list.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult GetFeeDateCurrList(string optype,string bsno)
{
var list = MsChFeeDAL.GetFeeDateCurrList(optype, bsno, Convert.ToString(Session["USERID"]), Convert.ToString(Session["COMPANYID"]));
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = list.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult GetFeeNowCurrList()
{
var COMPANYID = Convert.ToString(Session["COMPANYID"]);
var list = MsChFeeDAL.GetFeeNowCurrList(COMPANYID);
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = list.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult GetFeeNowInvCurrList()
{
var COMPANYID = Convert.ToString(Session["COMPANYID"]);
var list = MsChFeeDAL.GetFeeNowInvCurrList();
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = list.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult GetCurrList()
{
var COMPANYID = Convert.ToString(Session["COMPANYID"]);
var list = MsChFeeDAL.GetFeeNowCurrList2(COMPANYID);
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = list.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult GetFeeDefaultUnit( string BSNO,string FEENAME)
{
FeeDefaultUnitmb head = null;
var list = MsChFeeDAL.GetFeeDefaultUnitList(BSNO, FEENAME);
if (list.Count > 0)
head = list[0];
if (head == null)
{ head = new FeeDefaultUnitmb(); }
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = head });
return new ContentResult() { Content = json };
}
public ContentResult GetGainPrint(string bsno, string oplb)
{
DBResult result = MsChFeeDAL.GetGainPrint(bsno, oplb);
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult UpdateFeeCustNo(string body, string custno)
{
var bodyList = JsonConvert.Deserialize<List<MsChFee>>(body);
var result = new DBResult();
T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA();
if (bodyList != null)
{
foreach (var bill in bodyList)
{
string blUpSQL = " update ch_fee set WMSOUTBSNO='" + custno + "' where GID='"+bill.GId+"'";
bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
}
}
result.Success = true;
result.Message = "更新成功!";
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
// Data = MsChFeeDAL.GetDataList(headData.BillNo, Convert.ToString(Session["USERID"]), CookieConfig.GetCookie_UserCode(Request), CookieConfig.GetCookie_OrgCode(Request))
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult GetFeeBalAmount(string condition)
{
var feeBal = MsChFeeDAL.GetFeeBalAmount(condition);
var jsonRespose = new JsonResponse { Success = true, Message = "", Data = feeBal };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
#region 销售订舱费用
public ContentResult GetOrderDataList(string billno, int type, string optype)
{
var dataList = MsChFeeDAL.GetOrderDataList("BsNo='" + billno + "' and FeeType=" + type, type, optype, 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 OrderDelete(string bsno, string data)
{
int iResult = 0;
var bodyList = data;
var result = new DBResult();
if (bodyList != "" || bodyList != null)
{
iResult = MsChFeeDAL.DeleteOrderFee(bodyList);
// MsChFeeDAL.p_op_gain(bsno, Convert.ToString(Session["USERID"]));
}
if (iResult == 1)
{
result.Success = true;
result.Message = "删除成功!";
}
else if (iResult == 0)
{
result.Success = false;
result.Message = "出现错误,未删除!";
}
else if (iResult == -1)
{
result.Success = false;
result.Message = "有异常,删除失败!";
}
else if (iResult == -2)
{
result.Success = false;
result.Message = "删除异常,事务已回滚成功!";
}
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
// Data = MsChFeeDAL.GetDataList(headData.BillNo, Convert.ToString(Session["USERID"]), CookieConfig.GetCookie_UserCode(Request), CookieConfig.GetCookie_OrgCode(Request))
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult GetOrderGainList(string bsno)
{
var dataList = MsChFeeDAL.GetOrderGainList("BsNo='" + bsno + "'");
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
public ContentResult SaveOrderFee ( string bsno, string type, string OrderFeeBody )
{
var chfeeBodyList = JsonConvert.Deserialize<List<MsOrderFee>>(OrderFeeBody);
var chfeeDelBodyList = JsonConvert.Deserialize<List<MsOrderFee>>("");
var modb = new ModelObjectRepository();
DBResult result = modb.SaveComm("BsNo", bsno,
ModelObjectConvert<MsOrderFee>.ToModelObjectList(chfeeBodyList),
ModelObjectConvert<MsOrderFee>.ToModelObjectList(chfeeDelBodyList)
);
//刷新父窗口上的父节点
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
//Data = XXHDAL.GetData("M.ContractNo='" + head.ContractNo + "'")
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
#endregion
}
}