using System ;
using System.Collections.Generic ;
using System.Data ;
using System.Linq ;
using System.Text ;
using System.Web ;
using System.Web.Mvc ;
using DSWeb.Areas.CommMng.DAL ;
using DSWeb.Areas.RptMng.Comm ;
using DSWeb.TruckMng.Comm.Cookie ;
using DSWeb.TruckMng.Helper ;
using DSWeb.TruckMng.Helper.Repository ;
using Microsoft.Practices.EnterpriseLibrary.Data ;
using DSWeb.EntityDA ;
using DSWeb.Areas.CommMng.Models ;
using DSWeb.Areas.TruckMng.Models.MsWlBs ;
using DSWeb.Areas.TruckMng.Models.Comm ;
using HcUtility.Comm ;
using HcUtility.Core ;
using DSWeb.Areas.TruckMng.DAL.MsWlBs ;
using DSWeb.Areas.TruckMng.DAL.MsWlPc ;
using DSWeb.MvcShipping.DAL.MsChFeeDAL ;
using DSWeb.SoftMng.Filter ;
namespace DSWeb.Areas.TruckMng.Controllers
{
/// <summary>
/// 路单查询
/// </summary>
[JsonRequestBehavior]
public class MsWl_HaierController : Controller
{
/ /
// GET: /RptMng/MsRptPcHeadQry
public ActionResult Index ( )
{
return View ( ) ;
}
public ActionResult Edit ( )
{
return View ( ) ;
}
/ /
// GET: /RptMng/MsRptPcHeadQry/QryData
[SqlKeyWordsFilter(Type = "Action")] //sql 防注入过滤器
public ContentResult QryData ( int start , int limit , string condition , string sort )
{
var strDa = GetRangDAStr ( "index" , Convert . ToString ( Session [ "USERID" ] ) , CookieConfig . GetCookie_UserCode ( Request ) , CookieConfig . GetCookie_OrgCode ( Request ) ) ;
if ( ! string . IsNullOrEmpty ( strDa ) )
{
if ( ! string . IsNullOrEmpty ( condition ) )
{
condition = condition + " and " + strDa ;
}
else
{
condition = strDa ;
}
}
var strSql = new StringBuilder ( ) ;
strSql . Append ( "SELECT " ) ;
strSql . Append ( "A.BILLNO,A.GID,A.LRDATE,A.JzDate,A.USERCODE,A.USERNAME,A.ORGCODE,A.ORGNAME,A.TRUCKNO,A.MBLNO," ) ;
strSql . Append ( "(SELECT TRUCKNO FROM TMSWLTRUCK WHERE TRUCKNO=A.TRUCKNO) AS TRUCKNO_REF,DRVNAME," ) ;
strSql . Append ( "(SELECT DRVNAME FROM TMSWLDRIVER WHERE DRVCODE=A.DRVNAME) AS DRVNAME_REF,A.MOBILE,dbo.trimdate(A.ExpDate) ExpDate,A.CONTAINERTYPE," ) ;
strSql . Append ( "(SELECT CtnName FROM VMSTRUCKCTN WHERE CTNCODE=A.CONTAINERTYPE) AS CONTAINERTYPE_REF,A.CONTAINERQTY,A.VOYVEG, " ) ;
strSql . Append ( "(SELECT CODEANDNAME FROM VMSTRUCKVOYINFO WHERE VOYCODE=A.VOYVEG) AS VOYVEG_REF,A.ETDATE,A.ENDPORTDATE,A.MBLNO,A.YARDCODE," ) ;
strSql . Append ( "(SELECT CODEANDNAME FROM VMSTRUCKCLIENT WHERE CUSTCODE=A.YARDCODE) AS YARDCODE_REF,A.YARDNAME,A.RTNYARDCODE, " ) ;
strSql . Append ( "(SELECT CODEANDNAME FROM VMSTRUCKCLIENT WHERE CUSTCODE=A.RTNYARDCODE) AS RTNYARDCODE_REF,A.RTNYARDNAME,A.BSTYPE," ) ;
strSql . Append ( "(SELECT ENUMVALUENAME FROM TSYSENUMVALUE WHERE LANGID=0 AND ENUMTYPEID=99025 AND ENUMVALUEID=A.BSTYPE) AS BSTYPE_REF,A.DSTAREA,A.DETINATION,A.FactoryAddr,A.LINKTEL,A.LINKMAN,A.RATEDMIL,A.RATEDFUEL " ) ;
strSql . Append ( ",A.FUELQTY,A.REALMIL,A.REALFUEL,A.NOLOADMIL,A.OVERLOADMIL,A.TON,A.AROUNDTON,A.LOADCOUNT,A.ArriveDate,A.DDCODE, " ) ;
strSql . Append ( "(SELECT CODEANDNAME FROM VMSTRUCKUSER WHERE USERCODE=A.DDCODE) AS DDCODE_REF,A.DDNAME,A.RETURNDATE,A.REFBILLNO,A.REMARK,A.ISDOUBLE,A.REFBILLNOSE,A.CONTAINERTYPESE, " ) ;
strSql . Append ( "(SELECT CODEANDNAME FROM VMSTRUCKCTN WHERE CTNCODE=A.CONTAINERTYPESE) AS CONTAINERTYPESE_REF,A.CONTAINERQTYSE,A.MBLNOSE,A.VOYVEGSE, " ) ;
strSql . Append ( "(SELECT CODEANDNAME FROM VMSTRUCKVOYINFO WHERE VOYCODE=A.VOYVEGSE) AS VOYVEGSE_REF,A.ETDATESE,A.ENDPORTDATESE,A.YARDCODESE, " ) ;
strSql . Append ( "(SELECT CODEANDNAME FROM VMSTRUCKCLIENT WHERE CUSTCODE=A.YARDCODESE) AS YARDCODESE_REF,A.YARDNAMESE,A.DSTAREASE,A.FACTORYADDRSE,A.DETINATIONSE,A.LINKMANSE,A.LINKTELSE,A.RTNYARDCODESE, " ) ;
strSql . Append ( "(SELECT CODEANDNAME FROM VMSTRUCKCLIENT WHERE CUSTCODE=A.RTNYARDCODESE) AS RTNYARDCODESE_REF,A.RTNYARDNAMESE,A.BILLSTATUS, " ) ;
strSql . Append ( "(SELECT ENUMVALUENAME FROM TSYSENUMVALUE WHERE LANGID=0 AND ENUMTYPEID=99026 AND ENUMVALUEID=A.BILLSTATUS) AS BILLSTATUS_REF,A.FEESTATUS, " ) ;
strSql . Append ( "(SELECT ENUMVALUENAME FROM TSYSENUMVALUE WHERE LANGID=0 AND ENUMTYPEID=99027 AND ENUMVALUEID=A.FEESTATUS) AS FEESTATUS_REF,A.GID,A.TOTALMIL,A.LOADPLACE,A.LOADFUEL,A.NOLOADFUEL " ) ;
strSql . Append ( ",A.ARRIVETIME,A.RETURNTIME,A.CUSTLIKEMANCODE,A.CUSTLIKEMANNAME,A.CUSTTEL,A.DRVCODE,A.REFBILLNO" ) ;
strSql . Append ( ",A.CustCode,A.CustName,A.DETINATION,A.CONTAINERNO,A.SEALNO,A.Ton,A.ActualWeight,case A.isdouble when 1 then '是' else '否' end IsDoubleREF " ) ;
strSql . Append ( " ,convert(bigint ,A.TimeMark) as TimeMark " ) ;
strSql . Append ( "from tMsWlPcHead A " ) ;
strSql . Append ( " where A.PcBillType='0' " ) ;
if ( ! string . IsNullOrEmpty ( condition ) )
{
strSql . Append ( " and " + condition ) ;
}
var sortstring = DatasetSort . Getsortstring ( sort ) ;
if ( ! string . IsNullOrEmpty ( sortstring ) )
{
strSql . Append ( " order by " + sortstring ) ;
}
else {
strSql . Append ( " order by A.TRUCKNO,A.LRDATE DESC" ) ;
}
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 ( start , limit , dbRptResult , "Result_Set" , true ) ;
return new ContentResult ( ) { Content = json } ;
}
public static string GetRangDAStr ( string tb , string userid , string usercode , string orgcode )
{
string str = "" ;
var strSql = new StringBuilder ( ) ;
strSql . Append ( "SELECT " ) ;
strSql . Append ( " VISIBLERANGE,OPERATERANGE " ) ;
strSql . Append ( " from VW_User_Authority " ) ;
strSql . Append ( " where [NAME]='modTruckBs' and USERID='" + userid + "' and ISDELETE=0" ) ;
string visiblerange = "4" ;
string operaterange = "4" ;
Database db = DatabaseFactory . CreateDatabase ( ) ;
DataSet ds = new DataSet ( ) ;
using ( IDataReader reader = db . ExecuteReader ( CommandType . Text , strSql . ToString ( ) ) )
{
while ( reader . Read ( ) )
{
visiblerange = Convert . ToString ( reader [ "VISIBLERANGE" ] ) ;
operaterange = Convert . ToString ( reader [ "OPERATERANGE" ] ) ;
break ;
}
reader . Close ( ) ;
}
if ( visiblerange = = "4" )
{
str = "1=2" ;
}
else if ( visiblerange = = "3" )
{
if ( tb = = "index" )
{
str = " A.UserCode='" + usercode + "'" ;
}
else
{
str = " UPPER(A.OrgCode)='" + orgcode + "'" ;
}
}
else if ( visiblerange = = "2" )
{
if ( tb = = "index" )
{
var rangeDa = new RangeDA ( ) ;
var companyid = rangeDa . GetCORPID ( userid ) ;
var deptname = rangeDa . GetDEPTNAME ( userid ) ;
var userstr = new StringBuilder ( ) ;
userstr . Append ( " select codename from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "')" ) ;
Database userdb = DatabaseFactory . CreateDatabase ( ) ;
using ( IDataReader reader = userdb . ExecuteReader ( CommandType . Text , userstr . ToString ( ) ) )
{
str = "" ;
while ( reader . Read ( ) )
{
if ( str = = "" )
{
str = "(A.usercode='" + Convert . ToString ( reader [ "codename" ] ) + "'" ;
}
else
{
str = str + " or A.usercode='" + Convert . ToString ( reader [ "codename" ] ) + "'" ;
} ;
}
str = str + ")" ;
reader . Close ( ) ;
}
}
else
{
str = " UPPER(A.OrgCode)='" + orgcode + "'" ;
}
}
else if ( visiblerange = = "1" )
{
str = " UPPER(A.OrgCode)='" + orgcode + "'" ;
}
return str ;
}
[SqlKeyWordsFilter(Type = "Action")] //sql 防注入过滤器
public ContentResult GetDataList ( int start , int limit , string sort , string condition )
{
var dataList = GetDataList ( condition , 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 } ;
}
[SqlKeyWordsFilter(Type = "Action")] //sql 防注入过滤器
static public List < MsWlPcHead > GetDataList ( string condition , string sort )
{
var strSql = new StringBuilder ( ) ;
strSql . Append ( " SELECT BILLNO,GID,DdCode,DdName,CustCode,CustName,TRUCKNO,MBLNO,DrvCode,ArriveDate " ) ;
strSql . Append ( " ,(SELECT DRVNAME FROM TMSWLDRIVER WHERE DRVCODE=A.DrvCode) AS DRVNAME " ) ;
strSql . Append ( " ,FactoryAddr,ChangedFuel,OverLoadMil,NoLoadMil,RealMil,TotalMil,convert(bigint ,A.TimeMark) as TimeMark, " ) ;
strSql . Append ( " (SELECT CODEANDNAME FROM VMSTRUCKUSER WHERE USERCODE=A.DDCODE) AS DDCODE_REF,RealFuel,feestatus " ) ;
strSql . Append ( " ,(select sum(amount) from ch_fee where bsno=A.BillNo and feename='路桥费(重驶)' and feetype=1 ) ZSLQF" ) ;
strSql . Append ( " ,(select sum(amount) from ch_fee where bsno=A.BillNo and feename='路桥费(空驶)' and feetype=1 ) KSLQF" ) ;
strSql . Append ( " ,(select sum(amount) from ch_fee where bsno=A.BillNo and (feename='路桥费(空驶)' or feename='路桥费(重驶)') and feetype=1 ) LQF" ) ;
strSql . Append ( " from tmswlpchead A " ) ;
if ( ! string . IsNullOrEmpty ( condition ) )
{
strSql . Append ( " where " + condition . Replace ( "~" , "" ) ) ; //str.Replace("b","**");
}
var sortstring = DatasetSort . Getsortstring ( sort ) ;
if ( ! string . IsNullOrEmpty ( sortstring ) )
{
strSql . Append ( " order by " + sortstring ) ;
}
else
{
strSql . Append ( " order by billno " ) ;
}
return SetData ( strSql ) ;
}
/ *
public ContentResult GetData ( string condition )
{
MsWlPcHead head = null ;
var _t = "" ;
var list = GetDataList ( condition , _t ) ;
if ( list . Count > 0 )
head = list [ 0 ] ;
if ( head = = null )
{
head = new MsWlPcHead ( ) ;
}
var json = JsonConvert . Serialize (
new { Success = true , Message = "查询成功" , data = head } ) ;
return new ContentResult ( ) { Content = json } ;
} * /
[SqlKeyWordsFilter(Type = "Action")] //sql 防注入过滤器
static public MsWlPcHead GetData ( string condition )
{
var _t = "" ;
var list = GetDataList ( condition , _t ) ;
if ( list . Count > 0 )
return list [ 0 ] ;
return new MsWlPcHead ( ) ;
}
private static List < MsWlPcHead > SetData ( StringBuilder strSql )
{
var headList = new List < MsWlPcHead > ( ) ;
Database db = DatabaseFactory . CreateDatabase ( ) ;
using ( IDataReader reader = db . ExecuteReader ( CommandType . Text , strSql . ToString ( ) ) )
{
while ( reader . Read ( ) )
{
MsWlPcHead data = new MsWlPcHead ( ) ;
#region Set DB data to Object
data . BillNo = Convert . ToString ( reader [ "BILLNO" ] ) ;
data . GId = Convert . ToString ( reader [ "GID" ] ) ;
data . DdCode = Convert . ToString ( reader [ "DdCode" ] ) ;
data . DdCode_Ref = Convert . ToString ( reader [ "DDCODE_REF" ] ) ;
data . DdName = Convert . ToString ( reader [ "DdName" ] ) ;
data . CustCode = Convert . ToString ( reader [ "CustCode" ] ) ;
data . CustName = Convert . ToString ( reader [ "CustName" ] ) ;
data . TruckNo = Convert . ToString ( reader [ "TRUCKNO" ] ) ;
data . MblNo = Convert . ToString ( reader [ "MBLNO" ] ) ;
data . DrvCode = Convert . ToString ( reader [ "DrvCode" ] ) ;
data . DrvName = Convert . ToString ( reader [ "DrvName" ] ) ;
data . ArriveDate = Convert . ToString ( reader [ "ArriveDate" ] ) ;
data . FactoryAddr = Convert . ToString ( reader [ "FactoryAddr" ] ) ;
data . TimeMark = Convert . ToDecimal ( reader [ "TimeMark" ] ) ;
data . ChangedFuel = Convert . ToDecimal ( reader [ "ChangedFuel" ] ) ;
data . OverLoadMil = Convert . ToDecimal ( reader [ "OverLoadMil" ] ) ;
data . NoLoadMil = Convert . ToDecimal ( reader [ "NoLoadMil" ] ) ;
data . RealMil = Convert . ToDecimal ( reader [ "RealMil" ] ) ;
data . TotalMil = Convert . ToDecimal ( reader [ "TotalMil" ] ) ;
data . FEESTATUS = Convert . ToString ( reader [ "FeeStatus" ] ) ;
data . ZSLQF = Convert . ToString ( reader [ "ZSLQF" ] ) ;
data . KSLQF = Convert . ToString ( reader [ "KSLQF" ] ) ;
data . LQF = Convert . ToString ( reader [ "LQF" ] ) ;
# endregion
headList . Add ( data ) ;
}
reader . Close ( ) ;
}
return headList ;
}
public ContentResult CreatePC ( string data )
{
var head = JsonConvert . Deserialize < MsWlPcHead > ( data ) ;
head . DbOperationType = DbOperationType . DbotIns ;
head . ModelUIStatus = "I" ;
head . BillNo = PubSysDAL . GetBillNo ( "0111" ) ; //获取路单号
head . RefBillNo = head . BillNo ;
if ( ! string . IsNullOrEmpty ( head . ArriveDate ) )
{
head . ArriveDate = head . ArriveDate . Substring ( 0 , 10 ) ;
}
//head.PcBillType = '0';
var modb = new ModelObjectRepository ( ) ;
DBResult result = modb . Save ( head ) ;
//var USERID = Convert.ToString(CookieConfig.GetCookie_UserId(Request));
//var USERCODE = Convert.ToString(CookieConfig.GetCookie_UserCode(Request));
//var ORGCODE = Convert.ToString(CookieConfig.GetCookie_OrgCode(Request));
//刷新父窗口上的父节点
var _r = GetData ( " billno= '" + head . BillNo + "'" ) ;
var jsonRespose = new JsonResponse
{
Success = result . Success ,
Message = result . Message ,
Data = _r
} ;
return new ContentResult ( ) { Content = JsonConvert . Serialize ( jsonRespose ) } ;
}
////建立维修派车单
/// <summary>
/// 将派车单的开头字母WL改成WX
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public ContentResult CreateWXPC ( string data )
{
var head = JsonConvert . Deserialize < MsWlPcHead > ( data ) ;
head . DbOperationType = DbOperationType . DbotIns ;
head . ModelUIStatus = "I" ;
head . BillNo = PubSysDAL . GetBillNo ( "0111" ) ; //获取路单号
head . BillNo = head . BillNo . Replace ( "WL" , "WX" ) ;
head . RefBillNo = head . BillNo ;
if ( ! string . IsNullOrEmpty ( head . ArriveDate ) )
{
head . ArriveDate = head . ArriveDate . Substring ( 0 , 10 ) ;
}
//head.PcBillType = '0';
var modb = new ModelObjectRepository ( ) ;
DBResult result = modb . Save ( head ) ;
//var USERID = Convert.ToString(CookieConfig.GetCookie_UserId(Request));
//var USERCODE = Convert.ToString(CookieConfig.GetCookie_UserCode(Request));
//var ORGCODE = Convert.ToString(CookieConfig.GetCookie_OrgCode(Request));
//刷新父窗口上的父节点
var _r = GetData ( " billno= '" + head . BillNo + "'" ) ;
var jsonRespose = new JsonResponse
{
Success = result . Success ,
Message = result . Message ,
Data = _r
} ;
return new ContentResult ( ) { Content = JsonConvert . Serialize ( jsonRespose ) } ;
}
public ContentResult DeletePC ( string data )
{
var head = JsonConvert . Deserialize < MsWlPcHead > ( data ) ;
head . DbOperationType = DbOperationType . DbotDel ;
head . ModelUIStatus = "D" ;
var modb = new ModelObjectDB ( ) ;
DBResult result = modb . Delete ( head ) ;
var jsonRespose = new JsonResponse
{
Success = result . Success ,
Message = result . Message ,
Data = null
} ;
return new ContentResult ( ) { Content = JsonConvert . Serialize ( jsonRespose ) } ;
}
public ContentResult SavePC ( string data )
{
var head = JsonConvert . Deserialize < MsWlPcHead > ( data ) ;
head . DbOperationType = DbOperationType . DbotUpd ;
head . ModelUIStatus = "E" ;
if ( ! string . IsNullOrEmpty ( head . ArriveDate ) )
{
head . ArriveDate = head . ArriveDate . Substring ( 0 , 10 ) ;
}
var modb = new ModelObjectRepository ( ) ;
DBResult result = modb . Save ( head ) ;
//var USERID = Convert.ToString(CookieConfig.GetCookie_UserId(Request));
//var USERCODE = Convert.ToString(CookieConfig.GetCookie_UserCode(Request));
//var ORGCODE = Convert.ToString(CookieConfig.GetCookie_OrgCode(Request));
//刷新父窗口上的父节点
var jsonRespose = new JsonResponse
{
Success = result . Success ,
Message = result . Message ,
Data = GetData ( " gid= '" + head . GId + "'" )
} ;
return new ContentResult ( ) { Content = JsonConvert . Serialize ( jsonRespose ) } ;
}
public int SetFee ( string GIDList , string FeeName , string Amount , string Type )
{
var strSql = new StringBuilder ( ) ;
var userid = Convert . ToString ( Session [ "USERID" ] ) ;
var _GIDList = JsonConvert . Deserialize < List < string > > ( GIDList ) ;
var _count = 0 ;
if ( Type = = "1" )
{
foreach ( var GID in _GIDList )
{
strSql . Append ( " if ((select count(*) _count from ch_fee where FEETYPE=1 " ) ;
strSql . Append ( " and FEENAME='" + FeeName + "' and amount=" + Amount + " and bsno='" + GID + "')=0) " ) ;
strSql . Append ( " BEGIN " ) ;
strSql . Append ( " insert into ch_fee (gid,bsno,feetype,feename,unitprice,quantity,AMOUNT,customername,remark,enteroperator) " ) ;
strSql . Append ( " VALUES(newid(),'" + GID + "',1,'" + FeeName + "'," + Amount + ",1," + Amount + ",'华泰',dbo.trimdate(getdate())+'批量添加','" + userid + "') " ) ;
strSql . Append ( " END " ) ;
_count = _count + DoSQL ( strSql ) ;
}
}
else if ( Type = = "0" )
{
foreach ( var GID in _GIDList )
{
strSql . Append ( " delete from ch_fee where FEENAME='" + FeeName + "' and amount=" + Amount + " and bsno='" + GID + "' " ) ;
_count = _count + DoSQL ( strSql ) ;
}
}
return _count ; //ExecuteNonQuery
}
private static int DoSQL ( StringBuilder strSql )
{
var _count = 0 ;
Database db = DatabaseFactory . CreateDatabase ( ) ;
_count = db . ExecuteNonQuery ( CommandType . Text , strSql . ToString ( ) ) ;
return _count ;
}
public ContentResult SaveCHFEE ( string ChFeeBody , string ChFeeDelBody , string ChFee_YFBody , string ChFee_YFDelBody )
{
var ChFeeBodyList = JsonConvert . Deserialize < List < MsChFee > > ( ChFeeBody ) ;
var ChFeeDelBodyList = JsonConvert . Deserialize < List < MsChFee > > ( ChFeeDelBody ) ;
var ChFee_YFBodyList = JsonConvert . Deserialize < List < MsChFee > > ( ChFee_YFBody ) ;
var ChFee_YFDelBodyList = JsonConvert . Deserialize < List < MsChFee > > ( ChFee_YFDelBody ) ;
var modb = new ModelObjectRepository ( ) ;
DBResult result = modb . SaveComm (
ModelObjectConvert < MsChFee > . ToModelObjectList ( ChFeeBodyList ) ,
ModelObjectConvert < MsChFee > . ToModelObjectList ( ChFeeDelBodyList ) ,
ModelObjectConvert < MsChFee > . ToModelObjectList ( ChFeeBodyList ) ,
ModelObjectConvert < MsChFee > . 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 ) } ;
}
#region 参照部分
# endregion
public ContentResult DeleteYDHZ ( string data )
{
var head = JsonConvert . Deserialize < MsWlHaier > ( data ) ;
head . DbOperationType = DbOperationType . DbotDel ;
head . ModelUIStatus = "D" ;
var modb = new ModelObjectDB ( ) ;
DBResult result = modb . Delete ( head ) ;
var jsonRespose = new JsonResponse
{
Success = result . Success ,
Message = result . Message ,
Data = null
} ;
return new ContentResult ( ) { Content = JsonConvert . Serialize ( jsonRespose ) } ;
}
public ContentResult SaveYDHZ ( string data )
{
var head = JsonConvert . Deserialize < MsWlHaier > ( data ) ;
head . DbOperationType = DbOperationType . DbotUpd ;
head . ModelUIStatus = "E" ;
//if (!string.IsNullOrEmpty(head.ArriveDate))
//{
// head.ArriveDate=head.ArriveDate.Substring(0,10);
//}
var modb = new ModelObjectRepository ( ) ;
DBResult result = modb . Save ( head ) ;
//var USERID = Convert.ToString(CookieConfig.GetCookie_UserId(Request));
//var USERCODE = Convert.ToString(CookieConfig.GetCookie_UserCode(Request));
//var ORGCODE = Convert.ToString(CookieConfig.GetCookie_OrgCode(Request));
//刷新父窗口上的父节点
var jsonRespose = new JsonResponse
{
Success = result . Success ,
Message = result . Message ,
Data = GetData ( " M.gid= '" + head . GID + "'" )
} ;
return new ContentResult ( ) { Content = JsonConvert . Serialize ( jsonRespose ) } ;
}
}
}