@ -172,7 +172,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSaleRptDAL
static public List < MsOpSaleRpt > GetNewDataList ( )
{
String strSql = "SELECT *, DATEDIFF([day],STLDATE,GETDATE()) NODAY,(select top 1 PLANDATE from op_sale_rpt where BSNO=v_noday_fee.BSNO ORDER BY CREATETIME DESC) PLANDATE FROM v_noday_fee WHERE DATEDIFF([day],STLDATE,GETDATE())>0 ";
String strSql = "SELECT *, DATEDIFF([day],STLDATE,GETDATE()) NODAY,(select top 1 PLANDATE from op_sale_rpt where BSNO=v_noday_fee.BSNO ORDER BY CREATETIME DESC) PLANDATE ,(select top 1 REMARK from op_sale_rpt where BSNO=v_noday_fee.BSNO ORDER BY CREATETIME DESC) REMARK FROM v_noday_fee WHERE DATEDIFF([day],STLDATE,GETDATE())>0 ";
return SetNewData ( strSql ) ;
}
@ -216,7 +216,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSaleRptDAL
if ( reader [ "NODAY" ] ! = DBNull . Value )
data . NODAY = Convert . ToString ( reader [ "NODAY" ] ) ;
data . REMARK = Convert . ToString ( reader [ "REMARK" ] ) ;
# endregion
headList . Add ( data ) ;
@ -240,13 +240,15 @@ namespace DSWeb.MvcShipping.DAL.MsOpSaleRptDAL
try
{
var cmdUpdate = db . GetSqlStringCommand ( @"update op_sale_rpt set SORT=1 " ) ;
cmdUpdate . Parameters . Clear ( ) ;
db . ExecuteNonQuery ( cmdUpdate , tran ) ;
var cmdInsert =
db . GetSqlStringCommand (
@ "insert into op_sale_rpt ([GID],[BSNO],[MBLNO],[CUSTOMERNAME],[ACCDATE],[OP],[SALE],[ETD],[RMBDR],[USDDR],[STLRMBDR],[STLUSDDR]
, [ BALRMBDR ] , [ BALUSDDR ] , [ TTLBALDR ] , [ CREATEUSER ] , [ CREATETIME ] , [ PLANDATE ] , [ RPTSTATUS ] , STLDATE , NODAY )
, [ BALRMBDR ] , [ BALUSDDR ] , [ TTLBALDR ] , [ CREATEUSER ] , [ CREATETIME ] , [ PLANDATE ] , [ RPTSTATUS ] , STLDATE , NODAY ,REMARK , SORT )
values ( NEWID ( ) , @BSNO , @MBLNO , @CUSTOMERNAME , @ACCDATE , @OP , @SALE , @ETD , @RMBDR , @USDDR , @STLRMBDR , @STLUSDDR
, @BALRMBDR , @BALUSDDR , @TTLBALDR , @CREATEUSER , GETDATE ( ) , @PLANDATE , ' 未 发 布 ' , @STLDATE , @NODAY ) ");
, @BALRMBDR , @BALUSDDR , @TTLBALDR , @CREATEUSER , GETDATE ( ) , @PLANDATE , ' 未 发 布 ' , @STLDATE , @NODAY ,@REMARK , @SORT ) ");
if ( headList ! = null & & headList . Count ! = 0 )
@ -275,6 +277,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpSaleRptDAL
db . AddInParameter ( cmdInsert , "@PLANDATE" , DbType . String , null ) ;
db . AddInParameter ( cmdInsert , "@STLDATE" , DbType . String , enumValue . STLDATE ) ;
db . AddInParameter ( cmdInsert , "@NODAY" , DbType . String , enumValue . NODAY ) ;
db . AddInParameter ( cmdInsert , "@REMARK" , DbType . String , enumValue . REMARK ) ;
db . AddInParameter ( cmdInsert , "@SORT" , DbType . Int16 , 0 ) ;
db . ExecuteNonQuery ( cmdInsert , tran ) ;