@ -30,16 +30,21 @@ namespace SCP.Views.PlanData
return ;
return ;
}
}
BindFactory ( ) ;
BindFactory ( ) ;
BindArrive ( ) ;
BindArrive ( "1" ) ;
DP_StartDate . MaxDate = DateTime . Now ;
DP_StartDate . MinDate = DateTime . Now . AddYears ( - 1 ) ;
}
}
private void BindFactory ( )
private void BindFactory ( )
{
{
var _l s = ScpCache . FactoryList ;
var _l s = ScpCache . FactoryList ;
_l s = _l s . Where ( q = > CurrentUser . FactoryList . Contains ( q . FactoryId ) ) . ToList ( ) ;
_l s . Insert ( 0 , new TB_FACTORY ( ) { FactoryId = "" , FactoryName = "" } ) ;
_l s . Insert ( 0 , new TB_FACTORY ( ) { FactoryId = "" , FactoryName = "" } ) ;
factoryList . DataSource = _l s ;
factoryList . DataSource = _l s ;
factoryList . DataBind ( ) ;
factoryList . DataBind ( ) ;
}
}
public void BindArrive ( )
public void BindArrive ( string flag = "0" )
{
if ( flag = = "0" )
{
{
SearchV_TB_ARRIVEData ( ( result ) = >
SearchV_TB_ARRIVEData ( ( result ) = >
{
{
@ -48,6 +53,8 @@ namespace SCP.Views.PlanData
Grid_V_TB_ARRIVE . DataSource = list ;
Grid_V_TB_ARRIVE . DataSource = list ;
Grid_V_TB_ARRIVE . DataBind ( ) ;
Grid_V_TB_ARRIVE . DataBind ( ) ;
} ) ;
} ) ;
}
}
}
public void SearchV_TB_ARRIVEData ( Action < IQueryable < V_TB_ARRIVE > > p_action )
public void SearchV_TB_ARRIVEData ( Action < IQueryable < V_TB_ARRIVE > > p_action )
@ -78,6 +85,10 @@ namespace SCP.Views.PlanData
{
{
_ entity . SubSite = factoryList . SelectedValue ;
_ entity . SubSite = factoryList . SelectedValue ;
}
}
else if ( string . IsNullOrEmpty ( factoryList . SelectedValue ) )
{
_ entity . Site = CurrentUser . UsedDomain ;
}
if ( ! string . IsNullOrEmpty ( DDL_BillState . SelectedValue ) )
if ( ! string . IsNullOrEmpty ( DDL_BillState . SelectedValue ) )
{
{
_ entity . BillType_DESC = DDL_BillState . SelectedValue ;
_ entity . BillType_DESC = DDL_BillState . SelectedValue ;
@ -86,10 +97,18 @@ namespace SCP.Views.PlanData
{
{
_ entity . BeginTime = DP_StartDate . SelectedDate ;
_ entity . BeginTime = DP_StartDate . SelectedDate ;
}
}
else
{
_ entity . BeginTime = DateTime . Now . AddYears ( - 1 ) ;
}
if ( DP_StartDate . SelectedDate ! = null )
if ( DP_StartDate . SelectedDate ! = null )
{
{
_ entity . EndTime = Date_EndDate . SelectedDate ;
_ entity . EndTime = Date_EndDate . SelectedDate ;
}
}
else
{
_ entity . EndTime = DateTime . Now ;
}
_ entity . UserInAddress = CurrentUser . FactoryList ;
_ entity . UserInAddress = CurrentUser . FactoryList ;
_ entity . UserInVendIds = CurrentUser . VenderList ;
_ entity . UserInVendIds = CurrentUser . VenderList ;
_ entity . UserInSubSite = CurrentUser . SubSiteList ;
_ entity . UserInSubSite = CurrentUser . SubSiteList ;
@ -121,17 +140,24 @@ namespace SCP.Views.PlanData
PageContext . RegisterStartupScript ( Window1 . GetShowReference ( string . Format ( "../PlanData/SCP_ARRIVE_DETAIL.aspx?ArrvBillNum={0}&SubSite={1}" , ArrvBillNum , SubSite ) ) ) ;
PageContext . RegisterStartupScript ( Window1 . GetShowReference ( string . Format ( "../PlanData/SCP_ARRIVE_DETAIL.aspx?ArrvBillNum={0}&SubSite={1}" , ArrvBillNum , SubSite ) ) ) ;
}
}
protected void Grid_V_TB_ARRIVE_PageIndexChange ( object sender , GridPageEventArgs e )
protected void Grid_V_TB_ARRIVE_PageIndexChange ( object sender , GridPageEventArgs e )
{
if ( Grid_V_TB_ARRIVE . RecordCount ! = 0 )
{
{
BindArrive ( ) ;
BindArrive ( ) ;
}
}
}
protected void Grid_V_TB_ARRIVE_RowDataBound ( object sender , GridRowEventArgs e )
protected void Grid_V_TB_ARRIVE_RowDataBound ( object sender , GridRowEventArgs e )
{
{
}
}
protected void Grid_V_TB_ARRIVE_Sort ( object sender , GridSortEventArgs e )
protected void Grid_V_TB_ARRIVE_Sort ( object sender , GridSortEventArgs e )
{
if ( Grid_V_TB_ARRIVE . RecordCount ! = 0 )
{
{
BindArrive ( ) ;
BindArrive ( ) ;
}
}
}
protected void btnShow_Click ( object sender , EventArgs e )
protected void btnShow_Click ( object sender , EventArgs e )
{
{
gp1 . Hidden = false ;
gp1 . Hidden = false ;
@ -147,29 +173,78 @@ namespace SCP.Views.PlanData
protected void ddlGridPageSize_SelectedIndexChanged ( object sender , EventArgs e )
protected void ddlGridPageSize_SelectedIndexChanged ( object sender , EventArgs e )
{
{
Grid_V_TB_ARRIVE . PageSize = Convert . ToInt32 ( ddlGridPageSize . SelectedValue ) ;
Grid_V_TB_ARRIVE . PageSize = Convert . ToInt32 ( ddlGridPageSize . SelectedValue ) ;
if ( Grid_V_TB_ARRIVE . RecordCount ! = 0 )
{
BindArrive ( ) ;
BindArrive ( ) ;
}
}
}
protected void Window1_Close ( object sender , WindowCloseEventArgs e )
protected void Window1_Close ( object sender , WindowCloseEventArgs e )
{
{
BindArrive ( ) ;
BindArrive ( ) ;
}
}
protected void btnOutput_OnClick ( object sender , EventArgs e )
protected void btnOutput_OnClick ( object sender , EventArgs e )
{
{
List < string > _l s = new List < string > ( ) ;
if ( Grid_V_TB_ARRIVE . RecordCount = = 0 )
SearchV_TB_ARRIVEData ( rs = > {
{
_l s = rs . Select ( p = > p . ArrvBillNum ) . ToList ( ) ;
Alert . Show ( "请先完成查询后再进行导出!" ) ;
DataSet ds = null ;
return ;
if ( CurrentUser . VenderList . Count > 0 )
}
V_TB_ARRIVE _ entity = new V_TB_ARRIVE ( ) ;
_ entity . IsDeleted = false ;
if ( ! string . IsNullOrEmpty ( TXT_BillNo . Text ) )
{
_ entity . PoBillNum = TXT_BillNo . Text ;
}
if ( ! string . IsNullOrEmpty ( TXT_ArriveBill . Text ) )
{
_ entity . ArrvBillNum = TXT_ArriveBill . Text ;
}
if ( ! string . IsNullOrEmpty ( TXT_AsnBill . Text ) )
{
_ entity . AsnBillNum = TXT_AsnBill . Text ;
}
if ( ! string . IsNullOrEmpty ( TXT_AskBill . Text ) )
{
_ entity . AskBillNum = TXT_AskBill . Text ;
}
if ( ! string . IsNullOrEmpty ( TXT_VendId . Text ) )
{
_ entity . VendId = TXT_VendId . Text ;
}
if ( ! string . IsNullOrEmpty ( factoryList . SelectedValue ) )
{
_ entity . SubSite = factoryList . SelectedValue ;
}
else if ( string . IsNullOrEmpty ( factoryList . SelectedValue ) )
{
{
ds = SCP_EXCEL_CONTROLLER . GET_ARRIVE_EXECEL ( _l s , CurrentUser . VenderList . FirstOrDefault ( ) ) ;
_ entity . Site = CurrentUser . UsedDomain ;
}
if ( ! string . IsNullOrEmpty ( DDL_BillState . SelectedValue ) )
{
_ entity . BillType_DESC = DDL_BillState . SelectedValue ;
}
if ( DP_StartDate . SelectedDate ! = null )
{
_ entity . BeginTime = DP_StartDate . SelectedDate ;
}
}
else
else
{
{
ds = SCP_EXCEL_CONTROLLER . GET_ARRIVE_EXECEL ( _l s ) ;
_ entity . BeginTime = DateTime . Now . AddYears ( - 1 ) ;
}
}
if ( DP_StartDate . SelectedDate ! = null )
{
_ entity . EndTime = Date_EndDate . SelectedDate ;
}
else
{
_ entity . EndTime = DateTime . Now ;
}
_ entity . UserInAddress = CurrentUser . FactoryList ;
_ entity . UserInVendIds = CurrentUser . VenderList ;
_ entity . UserInSubSite = CurrentUser . SubSiteList ;
DataSet ds = null ;
ds = SCP_EXCEL_CONTROLLER . GET_ARRIVE_EXECELBycondition ( _ entity ) ;
PageBase . DataSetToExcel ( ds , "到货单" ) ;
PageBase . DataSetToExcel ( ds , "到货单" ) ;
} ) ;
}
}
}
}
}
}