@ -1987,7 +1987,18 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
var blUpSQL = " insert into sys_log(GID,NAME,LOGTYPE,LOGTIME,LOGCONTENT,CREATEUSER) values(NEWID(),'" + headData . BSNO + "','提单号更改','" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "','" + headData . MBLNO + '(' + MBLNO + ')' + "','" + userid + "')" ;
var blUpSQL = " insert into sys_log(GID,NAME,LOGTYPE,LOGTIME,LOGCONTENT,CREATEUSER) values(NEWID(),'" + headData . BSNO + "','提单号更改','" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "','" + headData . MBLNO + '(' + MBLNO + ')' + "','" + userid + "')" ;
bool bl = T_ALL_DA . GetExecuteSqlCommand ( blUpSQL ) ;
bool bl = T_ALL_DA . GetExecuteSqlCommand ( blUpSQL ) ;
}
}
var ETD = T_ALL_DA . GetStrSQL ( "ETD" , "select ETD from OP_SEAE WHERE BSNO='" + headData . BSNO + "'" ) ;
if ( ETD ! = headData . ETD )
{
var blUpSQL = " insert into sys_log(GID,NAME,LOGTYPE,LOGTIME,LOGCONTENT,CREATEUSER) values(NEWID(),'" + headData . BSNO + "','ETD更改','" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "','" + headData . ETD + '(' + ETD + ')' + "','" + userid + "')" ;
bool bl = T_ALL_DA . GetExecuteSqlCommand ( blUpSQL ) ;
}
var ACCDATE2 = T_ALL_DA . GetStrSQL ( "ACCDATE" , "select MBLNO from OP_SEAE WHERE BSNO='" + headData . BSNO + "'" ) ;
if ( ACCDATE2 ! = headData . ACCDATE )
{
var blUpSQL = " insert into sys_log(GID,NAME,LOGTYPE,LOGTIME,LOGCONTENT,CREATEUSER) values(NEWID(),'" + headData . BSNO + "','会计期间更改','" + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) + "','" + headData . ACCDATE + '(' + ACCDATE2 + ')' + "','" + userid + "')" ;
bool bl = T_ALL_DA . GetExecuteSqlCommand ( blUpSQL ) ;
}
}
}
else
else
{
{
@ -3672,7 +3683,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
# endregion
# endregion
#region 批量修改
#region 批量修改
public static DBResult Modify ( List < MsOpSeae > bodyList , MsOpSeae modifydata , string companyid )
public static DBResult Modify ( List < MsOpSeae > bodyList , MsOpSeae modifydata , string companyid ,string userid )
{
{
var result = new DBResult ( ) ;
var result = new DBResult ( ) ;
@ -3828,6 +3839,12 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSqlBL . Append ( " where BSNO=@BSNO " ) ;
strSqlBL . Append ( " where BSNO=@BSNO " ) ;
var strSqllog = new StringBuilder ( ) ;
strSqllog . Append ( "insert into sys_log(GID,NAME,LOGTYPE,LOGTIME,LOGCONTENT,CREATEUSER) values(newid(),@LOGNAME,@LOGTYPE,@LOGTIME,@LOGCONTENT,@CREATEUSER) " ) ;
var cmdupdateLog = db . GetSqlStringCommand ( strSqllog . ToString ( ) ) ;
var cmdupdateBL =
var cmdupdateBL =
db . GetSqlStringCommand ( strSqlBL . ToString ( ) ) ;
db . GetSqlStringCommand ( strSqlBL . ToString ( ) ) ;
var cmdupdate =
var cmdupdate =
@ -3948,7 +3965,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
if ( isPost )
if ( isPost )
{
{
bool isedt = false ;
bool isaccdate = false ;
cmdupdate . Parameters . Clear ( ) ;
cmdupdate . Parameters . Clear ( ) ;
cmdupdateBL . Parameters . Clear ( ) ;
cmdupdateBL . Parameters . Clear ( ) ;
@ -4018,22 +4036,22 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
var day = Convert . ToDateTime ( modifydata . ETD ) . Day ;
var day = Convert . ToDateTime ( modifydata . ETD ) . Day ;
if ( day > nowperiod . CLOSEDAY )
if ( day > nowperiod . CLOSEDAY )
{
{
var ACCDATE = Convert . ToDateTime ( modifydata . ETD ) . AddMonths ( 1 ) . ToString ( "yyyy-MM" ) ;
modifydata . ACCDATE = Convert . ToDateTime ( modifydata . ETD ) . AddMonths ( 1 ) . ToString ( "yyyy-MM" ) ;
db . AddInParameter ( cmdupdate , "@ACCDATE" , DbType . String , ACCDATE) ;
db . AddInParameter ( cmdupdate , "@ACCDATE" , DbType . String , modifydata. ACCDATE) ;
}
}
else {
else {
var ACCDATE = Convert . ToDateTime ( modifydata . ETD ) . ToString ( "yyyy-MM" ) ;
modifydata . ACCDATE = Convert . ToDateTime ( modifydata . ETD ) . ToString ( "yyyy-MM" ) ;
db . AddInParameter ( cmdupdate , "@ACCDATE" , DbType . String , ACCDATE) ;
db . AddInParameter ( cmdupdate , "@ACCDATE" , DbType . String , modifydata. ACCDATE) ;
}
}
}
}
else
else
{
{
var ACCDATE = Convert . ToDateTime ( modifydata . ETD ) . ToString ( "yyyy-MM" ) ;
modifydata . ACCDATE = Convert . ToDateTime ( modifydata . ETD ) . ToString ( "yyyy-MM" ) ;
db . AddInParameter ( cmdupdate , "@ACCDATE" , DbType . String , ACCDATE) ;
db . AddInParameter ( cmdupdate , "@ACCDATE" , DbType . String , modifydata. ACCDATE) ;
}
}
isaccdate = true ;
}
}
isedt = true ;
}
}
if ( modifydata . CLOSINGDATE ! = "" & & modifydata . CLOSINGDATE ! = null )
if ( modifydata . CLOSINGDATE ! = "" & & modifydata . CLOSINGDATE ! = null )
db . AddInParameter ( cmdupdate , "@CLOSINGDATE" , DbType . String , modifydata . CLOSINGDATE ) ;
db . AddInParameter ( cmdupdate , "@CLOSINGDATE" , DbType . String , modifydata . CLOSINGDATE ) ;
@ -4046,7 +4064,10 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
if ( ACCDATESAMEETD ! = "1" )
if ( ACCDATESAMEETD ! = "1" )
{
{
if ( modifydata . ACCDATE ! = "" & & modifydata . ACCDATE ! = null )
if ( modifydata . ACCDATE ! = "" & & modifydata . ACCDATE ! = null )
{
db . AddInParameter ( cmdupdate , "@ACCDATE" , DbType . String , modifydata . ACCDATE ) ;
db . AddInParameter ( cmdupdate , "@ACCDATE" , DbType . String , modifydata . ACCDATE ) ;
isaccdate = true ;
}
}
}
if ( modifydata . SALEDEPT ! = "" & & modifydata . SALEDEPT ! = null )
if ( modifydata . SALEDEPT ! = "" & & modifydata . SALEDEPT ! = null )
db . AddInParameter ( cmdupdate , "@SALEDEPT" , DbType . String , modifydata . SALEDEPT ) ;
db . AddInParameter ( cmdupdate , "@SALEDEPT" , DbType . String , modifydata . SALEDEPT ) ;
@ -4098,6 +4119,28 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
db . AddInParameter ( cmdupdateBL , "@BSNO" , DbType . String , enumValue . BSNO ) ;
db . AddInParameter ( cmdupdateBL , "@BSNO" , DbType . String , enumValue . BSNO ) ;
db . ExecuteNonQuery ( cmdupdateBL , tran ) ;
db . ExecuteNonQuery ( cmdupdateBL , tran ) ;
i = i + 1 ;
i = i + 1 ;
if ( isedt ) {
cmdupdateLog . Parameters . Clear ( ) ;
db . AddInParameter ( cmdupdateLog , "@LOGNAME" , DbType . String , enumValue . BSNO ) ;
db . AddInParameter ( cmdupdateLog , "@LOGTYPE" , DbType . String , "更新开船日期 " ) ;
db . AddInParameter ( cmdupdateLog , "@LOGTIME" , DbType . String , DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) ) ;
db . AddInParameter ( cmdupdateLog , "@LOGCONTENT" , DbType . String , modifydata . ETD + "(" + enumValue . ETD + ")" ) ;
db . AddInParameter ( cmdupdateLog , "@CREATEUSER" , DbType . String , userid ) ;
db . ExecuteNonQuery ( cmdupdateLog , tran ) ;
}
if ( isedt )
{
cmdupdateLog . Parameters . Clear ( ) ;
db . AddInParameter ( cmdupdateLog , "@LOGNAME" , DbType . String , enumValue . BSNO ) ;
db . AddInParameter ( cmdupdateLog , "@LOGTYPE" , DbType . String , "更新会计期间 " ) ;
db . AddInParameter ( cmdupdateLog , "@LOGTIME" , DbType . String , DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) ) ;
db . AddInParameter ( cmdupdateLog , "@LOGCONTENT" , DbType . String , modifydata . ACCDATE + "(" + enumValue . ACCDATE + ")" ) ;
db . AddInParameter ( cmdupdateLog , "@CREATEUSER" , DbType . String , userid ) ;
db . ExecuteNonQuery ( cmdupdateLog , tran ) ;
}
}
}
}
}