@ -75,19 +75,20 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
strSql . Append ( " * from OP_SuperVision_Truck " ) ;
strSql . Append ( " * from OP_SuperVision_Truck " ) ;
if ( ! string . IsNullOrEmpty ( strCondition ) )
if ( ! string . IsNullOrEmpty ( strCondition ) )
{
{
strSql . Append ( " where 1=1 AND " + strCondition + " ) ") ;
strSql . Append ( " where 1=1 AND " + strCondition + " ") ;
}
}
else
else
{
{
strSql . Append ( " where 1=1 " ) ;
strSql . Append ( " where 1=1 " ) ;
}
}
strSql . Append ( string . Format ( "where t.num>{0} and t.num<={1} order by t.num " , start , start + limit ) ) ;
strSql . Append ( @")as t " ) ;
strSql . Append ( @")as t " ) ;
strSql . Append ( string . Format ( "where t.num>{0} and t.num<={1} order by t.num " , start , start + limit ) ) ;
count = getTotalCount ( strCondition , USERID ) ;
count = getTotalCount ( strCondition , USERID ) ;
return SetData ( strSql ) ;
return SetData ( strSql ) ;
@ -96,18 +97,18 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
public static int getTotalCount ( string strCondition , string userid )
public static int getTotalCount ( string strCondition , string userid )
{
{
var rangstr = OP_SuperVision_Truck_md . GetRangeCondition ( userid ) ;
//var rangstr = OP_SuperVision_Truck_md.GetRangeCondition(userid) ;
if ( ! string . IsNullOrEmpty ( rangstr ) )
//if (!string.IsNullOrEmpty(rangstr) )
{
// {
if ( ! string . IsNullOrEmpty ( strCondition ) )
// if (!string.IsNullOrEmpty(strCondition))
{
// {
strCondition = strCondition + " and " + rangstr ;
// strCondition = strCondition + " and " + rangstr;
}
// }
else
// else
{
// {
strCondition = rangstr ;
// strCondition = rangstr;
}
// }
}
// }
StringBuilder strSql = new StringBuilder ( ) ;
StringBuilder strSql = new StringBuilder ( ) ;
strSql . Append ( "select count(*) " ) ;
strSql . Append ( "select count(*) " ) ;
strSql . Append ( " from OP_SuperVision_Truck " ) ;
strSql . Append ( " from OP_SuperVision_Truck " ) ;
@ -115,7 +116,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
if ( ! string . IsNullOrEmpty ( strCondition ) )
if ( ! string . IsNullOrEmpty ( strCondition ) )
{
{
strSql . Append ( " where 1=1 AND " + strCondition + " ) ") ;
strSql . Append ( " where 1=1 and " + strCondition + " ") ;
}
}
else
else
{
{
@ -185,6 +186,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
result . BILLTYPE = "主单" ;
result . BILLTYPE = "主单" ;
result . TRANSPORTTYPE = "普通业务" ;
result . TRANSPORTTYPE = "普通业务" ;
result . FEEFRT = "PP" ;
return result ;
return result ;
}
}
@ -203,13 +205,13 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
// result.SetErrorInfo("发车日期必填");
// result.SetErrorInfo("发车日期必填");
//}
//}
var _count = BasicDataRefDAL . GetExist ( "OP_SuperVision_Truck" , $" headData <>'{headData.GID}' and isnull(MBLNO,'')<>'' and isnull(MBLNO,'')='{headData.MBLNO}' ") ;
var _count = BasicDataRefDAL . GetExist ( "OP_SuperVision_Truck" , $" GID <>'{headData.GID}' and isnull(MBLNO,'')<>'' and isnull(MBLNO,'')='{headData.MBLNO}' ") ;
if ( _count > 0 )
if ( _count > 0 )
{
{
result . SetErrorInfo ( "主单号不允许重复" ) ;
result . SetErrorInfo ( "主单号不允许重复" ) ;
}
}
_count = BasicDataRefDAL . GetExist ( "OP_SuperVision_Truck" , $" headData <>'{headData.GID}' and isnull(HBLNO,'')<>'' and isnull(HBLNO,'')='{headData.HBLNO}' ") ;
_count = BasicDataRefDAL . GetExist ( "OP_SuperVision_Truck" , $" GID <>'{headData.GID}' and isnull(HBLNO,'')<>'' and isnull(HBLNO,'')='{headData.HBLNO}' ") ;
if ( _count > 0 )
if ( _count > 0 )
{
{
result . SetErrorInfo ( "分单号不允许重复" ) ;
result . SetErrorInfo ( "分单号不允许重复" ) ;
@ -383,9 +385,14 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
OP_SuperVision_Truck_md data = new OP_SuperVision_Truck_md ( ) ;
OP_SuperVision_Truck_md data = new OP_SuperVision_Truck_md ( ) ;
#region Set DB data to Object
#region Set DB data to Object
data . GID = Convert . ToString ( reader [ "GID" ] ) ;
data . GID = Convert . ToString ( reader [ "GID" ] ) ;
data . CUSTNO = Convert . ToString ( reader [ "CUST NO"] ) ;
data . MASTERNO = Convert . ToString ( reader [ "MASTER NO"] ) ;
data . BILLTYPE = Convert . ToString ( reader [ "BILLTYPE" ] ) ;
data . BILLTYPE = Convert . ToString ( reader [ "BILLTYPE" ] ) ;
data . CUSTNO = Convert . ToString ( reader [ "CUSTNO" ] ) ;
data . ACCDATE = Convert . ToString ( reader [ "ACCDATE" ] ) ;
data . BSSTATUS = Convert . ToBoolean ( reader [ "BSSTATUS" ] ) ;
data . FEESTATUS = Convert . ToBoolean ( reader [ "FEESTATUS" ] ) ;
data . TRANSPORTTYPE = Convert . ToString ( reader [ "TRANSPORTTYPE" ] ) ;
data . TRANSPORTTYPE = Convert . ToString ( reader [ "TRANSPORTTYPE" ] ) ;
data . FEEFRT = Convert . ToString ( reader [ "FEEFRT" ] ) ;
data . CreatorID = Convert . ToString ( reader [ "CreatorID" ] ) ;
data . CreatorID = Convert . ToString ( reader [ "CreatorID" ] ) ;
data . CreateTime = Convert . ToDateTime ( reader [ "CreateTime" ] ) ;
data . CreateTime = Convert . ToDateTime ( reader [ "CreateTime" ] ) ;
data . Creator = Convert . ToString ( reader [ "Creator" ] ) ;
data . Creator = Convert . ToString ( reader [ "Creator" ] ) ;
@ -398,6 +405,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
data . HBLNO = Convert . ToString ( reader [ "HBLNO" ] ) ;
data . HBLNO = Convert . ToString ( reader [ "HBLNO" ] ) ;
data . WBLNO = Convert . ToString ( reader [ "WBLNO" ] ) ;
data . WBLNO = Convert . ToString ( reader [ "WBLNO" ] ) ;
data . CUSTOMERNAME = Convert . ToString ( reader [ "CUSTOMERNAME" ] ) ;
data . CUSTOMERNAME = Convert . ToString ( reader [ "CUSTOMERNAME" ] ) ;
data . OPERATOR = Convert . ToString ( reader [ "OPERATOR" ] ) ;
data . TRANSFERCOMPANY = Convert . ToString ( reader [ "TRANSFERCOMPANY" ] ) ;
data . TRANSFERCOMPANY = Convert . ToString ( reader [ "TRANSFERCOMPANY" ] ) ;
data . PKGS = Convert . ToDecimal ( reader [ "PKGS" ] ) ;
data . PKGS = Convert . ToDecimal ( reader [ "PKGS" ] ) ;
data . KGS = Convert . ToDecimal ( reader [ "KGS" ] ) ;
data . KGS = Convert . ToDecimal ( reader [ "KGS" ] ) ;