using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using LYFZ.ComponentLibrary;
using LYFZ.Helper;
using LYFZ.Software.MainBusiness.DoorCityProcess;
namespace LYFZ.Software.MainBusiness.CameraControlBook
{
public partial class OrderReportFormMain : LYFZ.Software.UI.CameraControlBook.OrderReportFormMain
{
LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
LYFZ.BLL.BLL_ErpPayment ptbll = new BLL.BLL_ErpPayment();
LYFZ.BLL.BLL_ErpKepanLogo klbll = new BLL.BLL_ErpKepanLogo();
LYFZ.BLL.BLL_ErpOrderDigital odbll = new BLL.BLL_ErpOrderDigital();
LYFZ.BLL.BLL_ErpOrdersPerson pnbll = new BLL.BLL_ErpOrdersPerson();
LYFZ.BLL.BLL_ErpPlusPickItems pibll = new BLL.BLL_ErpPlusPickItems();
LYFZ.BLL.BLL_ErpTwoSalesOrder tobll = new BLL.BLL_ErpTwoSalesOrder();
LYFZ.BLL.BLL_ErpCustomerGroup ctgpbll = new BLL.BLL_ErpCustomerGroup();
LYFZ.BLL.BLL_ErpWeddingService wsbll = new BLL.BLL_ErpWeddingService();
LYFZ.BLL.BLL_ErpOrderProductLOG lgbll = new BLL.BLL_ErpOrderProductLOG();
LYFZ.BLL.BLL_ErpOrderProductList plbll = new BLL.BLL_ErpOrderProductList();
LYFZ.BLL.BLL_ErpOrderPhotoPrints ppbll = new BLL.BLL_ErpOrderPhotoPrints();
LYFZ.BLL.BLL_ErpOrdersPhotography opbll = new BLL.BLL_ErpOrdersPhotography();
LYFZ.BLL.BLL_ErpOrderDigitalStatus orsbll = new BLL.BLL_ErpOrderDigitalStatus();
LYFZ.BLL.BLL_ErpCustomerGroupMembers ctgmbll = new BLL.BLL_ErpCustomerGroupMembers();
LYFZ.BLL.BLL_ErpPieceCommissionRecords prbll = new BLL.BLL_ErpPieceCommissionRecords();
LYFZ.BLL.BLL_ErpOrderDigitalStatus ordsbll = new BLL.BLL_ErpOrderDigitalStatus();
public OrderReportFormMain()
{
this.Shown += OrderReportFormMain_Shown;
this.Load += OrderReportFormMain_Load;
this.cmbTextQuery.KeyDown += cmbTextQuery_KeyDown;
this.btnQuery.Click += btnQuery_Click;
this.btnConditionQuery.Click += btnConditionQuery_Click;
this.chkDressVersion.Click += chkDressVersion_Click;
this.chkKidsVersion.Click += chkKidsVersion_Click;
this.chkPortraitVersion.Click += chkPortraitVersion_Click;
this.chkServiceVersion.Click += chkServiceVersion_Click;
this.chkIntent.CheckedChanged += chkIntent_CheckedChanged;
this.btnReservation.Click += btnReservation_Click;
this.btnCustomerData.Click += btnCustomerData_Click;
this.btnClientServiceAnPai.Click += btnClientServiceAnPai_Click;
this.btnExport.Click += btnExport_Click;
this.btnDelete.Click += btnDelete_Click;
this.btnPrint.Click += btnPrint_Click;
this.btnClose.Click += btnClose_Click;
this.Resize += OrderReportFormMain_Resize;
this.cmbtreevStoreName.ComboBoxTree_NodeMouseClick += cmbtreevStoreName_ComboBoxTree_NodeMouseClick;
this.chkWeddingCelebration.Click += chkWeddingCelebration_Click;
this.chkShowCompleteOrder.Click += chkShowCompleteOrder_Click;
this.dgvData.CellMouseDoubleClick += dgvData_CellMouseDoubleClick;
this.dgvData.ColumnHeaderMouseClick += dgvData_ColumnHeaderMouseClick;
this.dgvData.CellClick += dgvData_CellClick;
this.dgvData.MouseDoubleClick += dgvData_MouseDoubleClick;
this.dgvData.CellMouseDown += dgvData_CellMouseDown;
this.flowLayoutPanel1.Height = 34;
ucPagerEx1.EventPaging += ucPagerEx1_EventPaging;
}
int ucPagerEx1_EventPaging( UCPager.EventPagingArg e )
{
//pageData.PageSize = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReportFormPageSize;
this.ucPagerEx1.PageSize = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReportFormPageSize;
PublicFunctionRows();
return ucPagerEx1.NMax;
}
///
/// 安排任务的任务类型
///
public string StrClientServiceType = "";
///
/// 是否首次运行
///
bool IsFirstRun = true;
///
/// 查询条件
///
private Dictionary DictData = new Dictionary();
///
/// 员工编号
///
string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
///
/// 窗体加载事件
///
///
///
void OrderReportFormMain_Shown( object sender, EventArgs e )
{
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName( this.cmbtreevStoreName, StrKeyCode: "qt002" );
this.PublicFunctionRights();
if ( this.StrClientServiceType.Trim().Length > 0 )
{
this.chkIntent.Checked = true;
}
//this.PublicFunctionRows();
ucPagerEx1.Bind();
this.IsFirstRun = false;
this.OrderReportFormMain_Resize( this, null );
}
///
/// 窗体加载事件
///
///
///
void OrderReportFormMain_Load( object sender, EventArgs e )
{
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetSystemVersion( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion );
if ( this.dgvData.Columns.Count <= 0 )
{
string strColumn = "订单号,订单类型,客户区域,客户姓名,客户电话,客户性别,客户来源,套系类别,套系名称,套系价格,接单人,拍摄名称,拍照状态,摄影师,拍摄时间,化妆师,初修师,初修时间,初修状态,选片师,选片时间,选片状态,设计师,设计时间,设计状态,精修师,精修时间,精修状态,看版师,看版时间,看版状态,看版要求,取件状态,取件日期,备注,录入员,下单日期";
this.dgvData.DataColumns( strColumn, LYFZ.Software.MainBusiness.CommonLogical.CacheData.StrOrderReportHideField );
}
}
///
/// 选择分店获取权限
///
void PublicFunctionRights()
{
this.btnPrint.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresOPenSingle", LYFZ.CustomAttributes.OperatingAuthority.Print );
this.btnExport.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "OrderReport", LYFZ.CustomAttributes.OperatingAuthority.DataExport );
this.btnDelete.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "OrderReport", LYFZ.CustomAttributes.OperatingAuthority.Delete );
this.chkIntent.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "OrderReport", LYFZ.CustomAttributes.OperatingAuthority.OrderIntent );
}
///
/// 分店选择查询数据
///
///
///
void cmbtreevStoreName_ComboBoxTree_NodeMouseClick( object sender, TreeNodeMouseClickEventArgs e )
{
this.PublicFunctionRights();
//this.PublicFunctionRows();
ucPagerEx1.PageCurrent = 1;
ucPagerEx1.Bind();
}
///
/// 回车
///
///
///
void cmbTextQuery_KeyDown( object sender, KeyEventArgs e )
{
if ( e.KeyCode == Keys.Enter )
{
this.btnQuery_Click( this, null );
}
}
///
/// 查询
///
///
///
void btnQuery_Click( object sender, EventArgs e )
{
this.DictData.Clear();
//this.PublicFunctionRows();
ucPagerEx1.PageCurrent = 1;
ucPagerEx1.Bind();
}
///
/// 查询条件
///
///
///
void btnConditionQuery_Click( object sender, EventArgs e )
{
LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ConditionQuerySamllForm frm = new DoorCityProcess.SetSmallForm.ConditionQuerySamllForm();
frm.IsShowBootDivision = !this.chkServiceVersion.Checked;
frm.LoadType = "订单报表";
frm.ShowDialog();
if ( frm.DictDataArray.Count > 0 )
{
this.cmbTextQuery.Text = "";
this.DictData.Clear();
this.DictData = frm.DictDataArray;
//this.PublicFunctionRows();
ucPagerEx1.PageCurrent = 1;
ucPagerEx1.Bind();
}
}
///
/// 婚纱版
///
///
///
void chkDressVersion_Click( object sender, EventArgs e )
{
if ( this.chkDressVersion.Checked )
{
this.panelShowCompleteOrder.Visible = true;
this.btnCustomerData.Visible = true;
this.chkPortraitVersion.Checked = false;
this.chkKidsVersion.Checked = false;
this.chkServiceVersion.Checked = false;
this.chkWeddingCelebration.Checked = false;
}
this.cmbTextQuery.Text = "";
//this.PublicFunctionRows();
ucPagerEx1.PageCurrent = 1;
ucPagerEx1.Bind();
}
///
/// 儿童版
///
///
///
void chkKidsVersion_Click( object sender, EventArgs e )
{
if ( this.chkKidsVersion.Checked )
{
this.panelShowCompleteOrder.Visible = true;
this.btnCustomerData.Visible = true;
this.chkPortraitVersion.Checked = false;
this.chkDressVersion.Checked = false;
this.chkServiceVersion.Checked = false;
this.chkWeddingCelebration.Checked = false;
}
this.cmbTextQuery.Text = "";
//this.PublicFunctionRows();
ucPagerEx1.PageCurrent = 1;
ucPagerEx1.Bind();
}
///
/// 写真版
///
///
///
void chkPortraitVersion_Click( object sender, EventArgs e )
{
if ( this.chkPortraitVersion.Checked )
{
this.panelShowCompleteOrder.Visible = true;
this.btnCustomerData.Visible = true;
this.chkKidsVersion.Checked = false;
this.chkDressVersion.Checked = false;
this.chkServiceVersion.Checked = false;
this.chkWeddingCelebration.Checked = false;
}
this.cmbTextQuery.Text = "";
//this.PublicFunctionRows();
ucPagerEx1.PageCurrent = 1;
ucPagerEx1.Bind();
}
///
/// 婚庆
///
///
///
void chkWeddingCelebration_Click( object sender, EventArgs e )
{
if ( this.chkWeddingCelebration.Checked )
{
this.panelShowCompleteOrder.Visible = true;
this.btnCustomerData.Visible = true;
this.chkPortraitVersion.Checked = false;
this.chkKidsVersion.Checked = false;
this.chkDressVersion.Checked = false;
this.chkServiceVersion.Checked = false;
}
this.cmbTextQuery.Text = "";
//this.PublicFunctionRows();
ucPagerEx1.PageCurrent = 1;
ucPagerEx1.Bind();
}
///
/// 服务版
///
///
///
void chkServiceVersion_Click( object sender, EventArgs e )
{
this.chkShowCompleteOrder.Checked = false;
if ( this.chkServiceVersion.Checked )
{
this.panelShowCompleteOrder.Visible = true;
this.btnCustomerData.Visible = false;
this.chkPortraitVersion.Checked = false;
this.chkKidsVersion.Checked = false;
this.chkDressVersion.Checked = false;
this.chkWeddingCelebration.Checked = false;
}
this.cmbTextQuery.Text = "";
//this.PublicFunctionRows();
ucPagerEx1.PageCurrent = 1;
ucPagerEx1.Bind();
}
///
/// 意向订单
///
///
///
void chkIntent_CheckedChanged( object sender, EventArgs e )
{
this.cmbTextQuery.Text = "";
this.btnClientServiceAnPai.Visible = this.chkIntent.Checked;
if ( this.chkIntent.Checked )
{
this.chkShowCompleteOrder.Checked = false;
this.chkShowCompleteOrder.Enabled = false;
}
else
{
this.chkShowCompleteOrder.Enabled = true;
}
//this.PublicFunctionRows();
ucPagerEx1.PageCurrent = 1;
ucPagerEx1.Bind();
}
///
/// 显示已取订单
///
///
///
void chkShowCompleteOrder_Click( object sender, EventArgs e )
{
ucPagerEx1.PageCurrent = 1;
ucPagerEx1.Bind();
}
///
/// 预约单
///
///
///
void btnReservation_Click( object sender, EventArgs e )
{
if ( this.dgvData.Rows.Count > 0 )
{
if ( this.dgvData.CurrentRow != null )
{
if ( this.dgvData.CurrentRow.Index >= 0 )
{
string OrdNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
frmContractManagement frmCManagement = new frmContractManagement();
frmCManagement.OrdNumber = OrdNumber;
frmCManagement.ShowDialog();
}
}
else
{
MessageBoxCustom.Show( "请选择要操作的订单" );
}
}
}
///
/// 打开订单
///
void openOrder()
{
if ( this.dgvData.Rows.Count > 0 )
{
if ( this.dgvData.CurrentRow != null )
{
if ( this.dgvData.CurrentRow.Index >= 0 )
{
Point p = this.Parent.PointToScreen( new Point( 0, 0 ) );
p.Y += 2;
string OrdNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
string OrdType = this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim();
//DataTable dt = orbll.GetView_Custom("tb_ErpOrder", StrWhere: "Ord_Number = '" + OrdNumber + "'", ShowColumnName: "Ord_Type").Tables[0];
EnumPublic.OrderType orderType = (LYFZ.EnumPublic.OrderType)Enum.Parse( typeof( LYFZ.EnumPublic.OrderType ), OrdType.Trim() );
//#if DEBUG
OpenNewOrder( orderType, OrdNumber );
//#else
//LYFZ.Software.MainBusiness.DoorCityProcess.OnSingleFormMain01 frm = new DoorCityProcess.OnSingleFormMain01();
//frm.OrdType = orderType;
//frm.IsUpdateOrderLoad = true;
//frm.StrNumber = OrdNumber;
//frm.IsShowUcNavigationTool = false;
//frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
//frm.Location = p;
//frm.Size = new Size(this.Width - 4, this.Height - 5);
//frm.ShowDialog();
//if (frm.IsSaveed)
//{
// ucPagerEx1.PageCurrent = 1;
// ucPagerEx1.Bind();
//}
// #endif
}
}
else { MessageBoxCustom.Show( "请选择要操作的订单" ); }
}
}
void OpenNewOrder( EnumPublic.OrderType orderType, string _OrderNumber )
{
frmNewOrder newOrder = new frmNewOrder();
newOrder.OrderNumber = _OrderNumber;
newOrder.IsShowUcNavigationTool = false;
newOrder.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
newOrder.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
newOrder.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
newOrder.OrderType = orderType;
newOrder.ShowDialog();
if ( newOrder.IsSaveData )
{
ucPagerEx1.PageCurrent = 1;
ucPagerEx1.Bind();
}
}
///
/// 安排客服
///
///
///
void btnClientServiceAnPai_Click( object sender, EventArgs e )
{
if ( this.dgvData.SelectedRows.Count > 0 )
{
LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm frm = new DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm();
frm.ShowDialog();
if ( frm.IsSaveed )
{
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ClientServiceAnPai( this.dgvData, LYFZ.EnumPublic.ClientServiceTaskType.意向跟踪, frm.model, LYFZ.EnumPublic.ClientServiceTaskItem.订单意向 );
}
}
}
///
/// 列表双击事件
///
///
///
void dgvData_CellMouseDoubleClick( object sender, DataGridViewCellMouseEventArgs e )
{
if ( this.dgvData.Rows.Count > 0 )
{
if ( e.RowIndex != -1 && e.ColumnIndex != -1 )
{
this.openOrder();
}
}
}
///
/// 列表单击事件
///
///
///
void dgvData_CellClick( object sender, DataGridViewCellEventArgs e )
{
try
{
string StrNumber = this.dgvData.CurrentRow.Cells["订单号"].Value.ToString().Trim();
if ( string.IsNullOrEmpty( StrNumber ) || StrNumber.Trim() == "(取件OK)" )
{
bool IsFind = false;
int i = this.dgvData.CurrentRow.Index;
while ( !IsFind )
{
i = i - 1;
if ( !string.IsNullOrEmpty( this.dgvData.Rows[i].Cells["订单号"].Value.ToString().Trim() ) )
{
StrNumber = this.dgvData.Rows[i].Cells["订单号"].Value.ToString().Trim(); IsFind = true;
}
}
}
LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = StrNumber;
}
catch
{
}
}
///
/// 对列表控件双击事件
///
///
///
void dgvData_MouseDoubleClick( object sender, MouseEventArgs e )
{
Point hit = this.dgvData.PointToClient( Cursor.Position );
DataGridView.HitTestInfo hitTest = this.dgvData.HitTest( hit.X, hit.Y );
if ( hitTest.RowIndex < 0 && hitTest.ColumnIndex < 0 )
{
if ( !string.IsNullOrEmpty( this.cmbTextQuery.Text.Trim() ) )
{
LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = "";
this.cmbTextQuery.Text = "";
//this.PublicFunctionRows();
ucPagerEx1.Bind();
}
}
}
///
/// 客户资料
///
///
///
void btnCustomerData_Click( object sender, EventArgs e )
{
if ( this.dgvData.Rows.Count > 0 )
{
if ( this.dgvData.CurrentRow.Index >= 0 )
{
string OrdNumber = this.dgvData.Rows[this.dgvData.CurrentRow.Index].Cells["Ord_Number"].Value.ToString().Trim();
if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( EnumPublic.OrderType.儿童订单 ).ToString().Trim() )
{
LYFZ.Software.MainBusiness.Customers.FrmOldCustomerRecordBaby frm = new Customers.FrmOldCustomerRecordBaby();
frm.Theorderno = OrdNumber;
frm.ShowDialog();
if ( frm.IsSaved )
{
//this.PublicFunctionRows();
ucPagerEx1.Bind();
}
}
else
{
LYFZ.Software.MainBusiness.Customers.FrmOldCustomerRecord frm = new Customers.FrmOldCustomerRecord();
frm.Theorderno = OrdNumber;
frm.ShowDialog();
if ( frm.IsSaved )
{
//this.PublicFunctionRows();
ucPagerEx1.Bind();
}
}
}
}
}
///
/// 导出
///
///
///
void btnExport_Click( object sender, EventArgs e )
{
if ( this.dgvData.Rows.Count > 0 )
{
if ( this.dgvData.CurrentRow.Index >= 0 )
{
LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.OrderReportExportOptionsSuperSmallForm frm = new SuperSmallForm.OrderReportExportOptionsSuperSmallForm();
frm.ShowDialog();
if ( frm.IsSaveed )
{
try
{
if ( !frm.isExportPhotograph )
{
if ( frm.IsExportCurrent )
{
this.dgvData.ExportDataTable( StrFileName: "订单报表" );
}
else
{
Dictionary dictColumns = new Dictionary();
Hashtable htData = this.PublicFunctionData( -1, ref dictColumns );
DataTable newTable = (DataTable)htData["DataTable"];
SaveFileDialog saveFile = new SaveFileDialog();
saveFile.FileName = "订单报表";
saveFile.Title = "导出数据报表文件";
saveFile.Filter = "EXECL文件(*.xls) |*.xls |文本文件(*.txt) |*.txt |所有文件(*.*) |*.*";
saveFile.FilterIndex = 1;
DialogResult drst = saveFile.ShowDialog();
if ( drst == DialogResult.No || drst == DialogResult.Cancel || drst == DialogResult.No || drst == DialogResult.Abort )
{
return;
}
newTable.Columns.Remove( "Ord_Number" );
newTable.Columns.Remove( "Ordv_ViceNumber" );
newTable.Columns.Remove( "Ord_Type" );
LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod( delegate ( object obj, System.ComponentModel.BackgroundWorker backgroundWorker )
{
try
{
if ( LYFZ.WinAPI.CustomPublicMethod.DataGridViewToExcel( saveFile.FileName.Trim(), newTable, null, backgroundWorker ) )
{
MessageBoxCustom.Show( "数据导出成功!" );
}
else
{
MessageBoxCustom.Show( "数据导出失败!" );
}
}
catch ( Exception ex )
{
MessageBoxCustom.Show( String.Format( "导出数据出错:{0}", ex.Message ) );
}
} );
//if ( LYFZ.Command.Command_ExportExcel.DataTable2Sheet(saveFile.FileName.Trim(), newTable, "Sheet1", IsCoveredExistingFile: true))
//{ MessageBoxCustom.Show("导出成功!"); }
//else
//{ MessageBoxCustom.Show("导出失败!"); }
}
}
else
{
Dictionary dictColumns = new Dictionary();
DataTable newTable = GetExportReportData( 100, ref dictColumns );
SaveFileDialog saveFile = new SaveFileDialog();
saveFile.FileName = "订单报表";
saveFile.Title = "导出数据报表文件";
saveFile.Filter = "EXECL文件(*.xls) |*.xls |文本文件(*.txt) |*.txt |所有文件(*.*) |*.*";
saveFile.FilterIndex = 1;
DialogResult drst = saveFile.ShowDialog();
if ( drst == DialogResult.No || drst == DialogResult.Cancel || drst == DialogResult.No || drst == DialogResult.Abort )
{
return;
}
newTable.Columns.Remove( "Ord_Number" );
newTable.Columns.Remove( "Ordv_ViceNumber" );
newTable.Columns.Remove( "Ord_Type" );
LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod( delegate ( object obj, System.ComponentModel.BackgroundWorker backgroundWorker )
{
try
{
if ( LYFZ.WinAPI.CustomPublicMethod.DataGridViewToExcel( saveFile.FileName.Trim(), newTable, null, backgroundWorker ) )
{
MessageBoxCustom.Show( "数据导出成功!" );
}
else
{
MessageBoxCustom.Show( "数据导出失败!" );
}
}
catch ( Exception ex )
{
MessageBoxCustom.Show( String.Format( "导出数据出错:{0}", ex.Message ) );
}
} );
//if (LYFZ.Command.Command_ExportExcel.DataTable2Sheet(saveFile.FileName.Trim(), newTable, "Sheet1", IsCoveredExistingFile: true))
//{ MessageBoxCustom.Show("导出成功!"); }
//else
//{ MessageBoxCustom.Show("导出失败!"); }
}
}
catch ( Exception ex )
{
MessageBoxCustom.Show( "导出失败:" + ex.Message );
}
}
}
}
}
///
/// 删除
///
///
///
void btnDelete_Click( object sender, EventArgs e )
{
if ( this.dgvData.Rows.Count > 0 )
{
if ( this.dgvData.CurrentRow.Index >= 0 )
{
List clist = new List();
string Ord_Number = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString();
string Ordv_ViceNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString();
DataTable tbl = orbll.GetView_Custom( "tb_ErpOrder", ShowColumnName: "Ord_Type,Ord_Class,Ord_SeriesPrice,dbo.fn_GetOrderArrears(dbo.tb_ErpOrder.Ord_Number) AS Ord_OrderArrears", StrWhere: "Ord_Number = '" + Ord_Number + "'" ).Tables[0];
DateTime strTime = SDateTime.Now;
if ( tbl.Rows.Count > 0 )
{
string Ordv_TypeString = Enum.Parse( typeof( LYFZ.EnumPublic.OrderType ), this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() ).ToString().Trim();
string StrCustomerGroup = "";
//if (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Account.ToLower() != LYFZ.AuthorizeUserName.AdministratorsName)
//{
if ( Convert.ToDecimal( tbl.Rows[0]["Ord_OrderArrears"] ) < Convert.ToDecimal( tbl.Rows[0]["Ord_SeriesPrice"] ) )
{
MessageBoxCustom.Show( "此订单已有付款记录,不能删除订单!" ); return;
}
//}
if ( Ordv_ViceNumber != "" )
{
if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Account.ToLower() != LYFZ.AuthorizeUserName.AdministratorsName )
{
DataTable tbl2 = orbll.GetView_Custom( "tb_ErpOrdersPhotography", StrWhere: "Ordpg_ViceNumber = '" + Ordv_ViceNumber + "' and Ordpg_PhotographyStatus= '1'", ShowColumnName: "Ordpg_PhotographyStatus" ).Tables[0];
if ( tbl2.Rows.Count > 0 )
{
MessageBoxCustom.Show( "此订单已有景点已拍照OK,不能删除订单!" ); return;
}
}
clist.Add( klbll.GetDeleteCommandInfo( "kp_OrderNumber", "=", Ordv_ViceNumber ) );//刻盘记录表
clist.Add( ppbll.GetDeleteCommandInfo( "Opps_OrderNumber", "=", Ordv_ViceNumber ) );//相片冲印表
clist.Add( plbll.GetDeleteCommandInfo( "OPlist_ViceNumber", "=", Ordv_ViceNumber ) );//订单商品表
clist.Add( opbll.GetDeleteCommandInfo( "Ordpg_ViceNumber", "=", Ordv_ViceNumber ) );//拍摄景点表
clist.Add( odbll.GetDeleteCommandInfo( "Ordv_ViceNumber", "=", Ordv_ViceNumber ) );//副订单
clist.Add( ordsbll.GetDeleteCommandInfo( "Ords_ViceNumber", "=", Ordv_ViceNumber ) );//副订单
}
DataTable tbl3 = orbll.GetView_Custom( "tb_ErpOrderDigital", StrWhere: "Ordv_Number = '" + Ord_Number + "'", ShowColumnName: "Ordv_ViceNumber" ).Tables[0];
if ( tbl3.Rows.Count == 1 )
{
clist.Add( lgbll.GetDeleteCommandInfo( "Ordplg_OrderNumber", "=", Ord_Number ) );//订单商品操作记录表
clist.Add( plbll.GetDeleteCommandInfo( "OPlist_OrderNumber", "=", Ord_Number ) );//订单商品表
clist.Add( wsbll.GetDeleteCommandInfo( "Ws_Number", "=", Ord_Number ) );//订单服务表
clist.Add( pnbll.GetDeleteCommandInfo( "OrdPe_OrderNumber", "=", Ord_Number ) );//订单人表
clist.Add( ptbll.GetDeleteCommandInfo( "Pay_OrdNumber", "=", Ord_Number ) );//订单收款
clist.Add( pibll.GetDeleteCommandInfo( "Plu_OrdNumber", "=", Ord_Number ) );//收款商品表
clist.Add( prbll.GetDeleteCommandInfo( "Pcr_OrderNumber", "=", Ord_Number ) );//计件提成记录
clist.Add( tobll.GetDeleteCommandInfo( "Tsorder_Number", "=", Ord_Number ) );//二销订单
clist.Add( orbll.GetDeleteCommandInfo( "Ord_Number", "=", Ord_Number ) );//主订单
LYFZ.Model.Model_ErpCustomerGroup modelClient = ctgpbll.GetModel( "GP_OrderNumber", Ord_Number );
StrCustomerGroup = modelClient.GP_CustomerGroupID;
clist.Add( ctgpbll.GetDeleteCommandInfo( "ID", "=", modelClient.ID ) );
clist.Add( ctgmbll.GetDeleteCommandInfo( "GM_CustomerGroupID", "=", modelClient.GP_CustomerGroupID ) );
}
else if ( tbl.Rows[0]["Ord_Class"].ToString().Trim() == "0" )
{
if ( tbl.Rows.Count == 1 )
{
clist.Add( orbll.GetDeleteCommandInfo( "Ord_Number", "=", Ord_Number ) );
}//主订单
LYFZ.Model.Model_ErpCustomerGroup modelClient = ctgpbll.GetModel( "GP_OrderNumber", Ord_Number );
clist.Add( ctgpbll.GetDeleteCommandInfo( "ID", "=", modelClient.ID ) );
clist.Add( ctgmbll.GetDeleteCommandInfo( "GM_CustomerGroupID", "=", modelClient.GP_CustomerGroupID ) );
}
string StrUserName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
string StrUserIP = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.User_IP;
string StrContent = "[删除订单] 主订单号为:" + Ord_Number + ",订单类型:" + Ordv_TypeString + ",数码订单号为:" + Ordv_ViceNumber;
clist.Add( new LYFZ.BLL.BLL_ErpSystemLogs().GetAddCommandInfo( LYFZ.BLL.BLL_ErpSystemLogs.GetWriteLogModel( LYFZ.EnumPublic.SystemLogsType.删除订单, StrContent, StrUserID, StrUserName, StrUserIP ) ) );
clist.Add( new BLL.BLL_ErpACVBSYS().GetAddCommandInfo( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetModelLog( LYFZ.EnumPublic.SystemLogsType.删除订单.ToString(), StrContent, "", strTime ) ) );
if ( clist.Count > 0 )
{
if ( MessageBoxCustom.Show( "警告!此单相关资料将全部被删除?您确定吗?", "警告提示", MessageBoxButtons.YesNo ) == DialogResult.Yes )
{
if ( LYFZ.BLL.BaseBllOperate.ExecuteSqlTran( clist ) > 0 )
{
MessageBoxCustom.Show( "订单删除成功" );
//this.dgvData.Rows.RemoveAt(this.dgvData.CurrentRow.Index);
//更新客户组成员表
if ( !string.IsNullOrEmpty( StrCustomerGroup ) )
{
LYFZ.DAL.DAL_ErpCustomer.UpdateAggregationCustomer( StrCustomerGroup );
}
else
{
LYFZ.DAL.DAL_ErpCustomer.UpdateAggregationCustomer( Ord_Number );
}
// this.PublicFunctionRows();
ucPagerEx1.Bind();
return;
}
else
{
MessageBoxCustom.Show( "订单删除失败" ); return;
}
}
}
}
}
else
{
MessageBoxCustom.Show( "请选择你要删除的订单!" );
}
}
}
public struct ScenicSpot
{
// 景点名称或成长次名称;
public string strScenicName;
// 副订单号,既儿童成长次单号;
public string strViceNumber;
// 景点或成长的选片状态;
public string strSelectPhotoStatus;
};
///
/// 打印
///
///
///
void btnPrint_Click( object sender, EventArgs e )
{
if ( this.dgvData.Rows.Count > 0 )
{
if ( this.dgvData.CurrentRow != null )
{
if ( this.dgvData.CurrentRow.Index >= 0 )
{
#if IGNORE
Hashtable htData = new Hashtable();
// 订单号;
htData["strNumber"] = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
// 订单类型;
htData["strOrdType"] = Enum.Parse(typeof(LYFZ.EnumPublic.OrderType), this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim()).ToString().Trim();
LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.订单预约单, htData);
#else
if ( Enum.Parse( typeof( LYFZ.EnumPublic.OrderType ), this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() ).ToString().Trim() == "儿童订单" )
{ // 儿童版,弹出对话框,选择要打印的次数;
Hashtable htData = new Hashtable();
// 订单号;
htData["strNumber"] = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
// 订单类型;
htData["strOrdType"] = Enum.Parse( typeof( LYFZ.EnumPublic.OrderType ), this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() ).ToString().Trim();
// 当前订单号;
List listScenicSpot = new List();
string strOrderNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
int nIndex = this.dgvData.CurrentRow.Index;
while ( --nIndex > -1 )
{
if ( strOrderNumber == this.dgvData.Rows[nIndex].Cells["Ord_Number"].Value.ToString().Trim() )
{
listScenicSpot.Add( new ScenicSpot
{
strScenicName = this.dgvData.Rows[nIndex].Cells["拍摄名称"].Value.ToString().Trim(),
strViceNumber = this.dgvData.Rows[nIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim(),
strSelectPhotoStatus = this.dgvData.Rows[nIndex].Cells["选片状态"].Value.ToString().Trim()
} );
}
else
{
break;
}
}
nIndex = this.dgvData.CurrentRow.Index;
listScenicSpot.Add( new ScenicSpot
{
strScenicName = this.dgvData.Rows[nIndex].Cells["拍摄名称"].Value.ToString().Trim(),
strViceNumber = this.dgvData.Rows[nIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim(),
strSelectPhotoStatus = this.dgvData.Rows[nIndex].Cells["选片状态"].Value.ToString().Trim()
} );
while ( ++nIndex < this.dgvData.Rows.Count )
{
if ( strOrderNumber == this.dgvData.Rows[nIndex].Cells["Ord_Number"].Value.ToString().Trim() )
{
listScenicSpot.Add( new ScenicSpot
{
strScenicName = this.dgvData.Rows[nIndex].Cells["拍摄名称"].Value.ToString().Trim(),
strViceNumber = this.dgvData.Rows[nIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim(),
strSelectPhotoStatus = this.dgvData.Rows[nIndex].Cells["选片状态"].Value.ToString().Trim()
} );
}
else
{
break;
}
}
// 弹出选择框;
frmChooseScenicToPrint dlg = new frmChooseScenicToPrint( LYFZ.EnumPublic.PrintTypeEnum.订单预约单, htData, listScenicSpot, false );
dlg.ShowDialog();
}
else
{// 非儿童订单;
Hashtable htData = new Hashtable();
// 订单号;
htData["strNumber"] = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
// 订单类型;
htData["strOrdType"] = Enum.Parse( typeof( LYFZ.EnumPublic.OrderType ), this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() ).ToString().Trim();
LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat( LYFZ.EnumPublic.PrintTypeEnum.订单预约单, htData, null, false );
}
#endif
return;
}
}
MessageBoxCustom.Show( "请选择订单" );
}
}
///
/// 关闭
///
///
///
void btnClose_Click( object sender, EventArgs e )
{
this.Close();
}
///
/// 窗体大小发生改变事件
///
///
///
void OrderReportFormMain_Resize( object sender, EventArgs e )
{
if ( !this.IsFirstRun )
{
switch ( this.panelShowCompleteOrder.Location.Y )
{
case 4:
this.flowLayoutPanel1.Height = 37;
break;
case 36:
this.flowLayoutPanel1.Height = 68;
break;
case 68:
this.flowLayoutPanel1.Height = 98;
break;
}
}
}
///
/// 右键菜单
///
///
///
void dgvData_CellMouseDown( object sender, DataGridViewCellMouseEventArgs e )
{
if ( e.Button == MouseButtons.Right )
{
if ( e.RowIndex >= 0 && e.ColumnIndex >= 0 )
{
ToolStripMenuItem item = new ToolStripMenuItem();
Hashtable htData = new Hashtable();
htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
htData["StrViceNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
item.Text = "订单备注";
item.Tag = htData;
item.Name = "OrderRemark";
this.dgvData.conMenu.Items.Add( item );
// this.dgvData.conMenu.Show( MousePosition.X, MousePosition.Y );//弹出操作菜单
this.dgvData.conMenu.ItemClicked -= dgvData_DataGridViewConMenu_ItemClicked;
this.dgvData.conMenu.ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
//this.dgvData.conMenu.Show();
if (!this.dgvData.conMenu.Visible)
{
this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
}
}
else
{
this.dgvData.conMenu.Items.Clear();
ToolStripMenuItem item = new ToolStripMenuItem();
item.Text = "设置标题";
item.Tag = "SetColumnShow";
item.Name = "SetColumnShow";
this.dgvData.conMenu.Items.Add( item );
// this.dgvData.conMenu.Show( MousePosition.X, MousePosition.Y );//弹出操作菜单
this.dgvData.conMenu.ItemClicked -= dgvData_DataGridViewConMenu_ItemClicked;
this.dgvData.conMenu.ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
// this.dgvData.conMenu.Show();
if (!this.dgvData.conMenu.Visible)
{
this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
}
}
}
}
///
/// 右键菜单选择项事件
///
///
///
void dgvData_DataGridViewConMenu_ItemClicked( object sender, ToolStripItemClickedEventArgs e )
{
ToolStripItem item = e.ClickedItem;
if ( item.Name.Trim() == "SetColumnShow" )
{
if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ShowDataGridViewSetColumn( this.dgvData ) )
{
//this.PublicFunctionRows();
ucPagerEx1.Bind();
}
}
else if ( item.Name.ToString().Trim() == "OrderRemark" )
{
Hashtable htData = (Hashtable)item.Tag;
LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OrderRemarkRecordAddSuperSmallForm frm = new DoorCityProcess.SuperSmallForm.OrderRemarkRecordAddSuperSmallForm();
frm.StrOrderNumber = htData["StrNumber"].ToString().Trim();
frm.StrOrdViceNumber = htData["StrViceNumber"].ToString().Trim();
frm.StrOrdModuleName = "";
frm.ShowDialog();
}
}
///
/// 点击列标头排序
///
///
///
void dgvData_ColumnHeaderMouseClick( object sender, DataGridViewCellMouseEventArgs e )
{
if ( e.Button == MouseButtons.Left )
{
string StrColumnName = this.dgvData.Columns[e.ColumnIndex].Name.Trim();
if ( StrColumnName == this.StrCurrentClickField || this.dgvData.StrValueNullColumn.Trim().IndexOf( StrColumnName ) != -1 || string.IsNullOrEmpty( this.StrCurrentClickField ) )
{
if ( this.StrSortOrder == "ASC" )
{
this.StrSortOrder = "DESC";
}
else
{
this.StrSortOrder = "ASC";
}
}
else
{
this.StrSortOrder = "DESC";
}
if ( this.dgvData.StrValueNullColumn.Trim().IndexOf( StrColumnName ) == -1 || StrColumnName.Trim() == "套系金额" )
{
this.StrSortField = StrColumnName + " " + this.StrSortOrder + ",Ord_CreateDateTime";
}
else
{
this.StrSortField = "Ord_CreateDateTime " + this.StrSortOrder;
}
this.StrCurrentClickField = StrColumnName;
//this.PublicFunctionRows();
ucPagerEx1.Bind();
}
}
public void BindPageData( int pageIndx, int pageSize, int totalCount )
{
ucPagerEx1.NMax = totalCount;
ucPagerEx1.CurrentPageCount = (pageSize);
ucPagerEx1.PageCurrent = pageIndx;
}
///
/// 当前点击的字段
///
string StrCurrentClickField = "";
///
/// 排序字段
///
string StrSortField = "Ord_CreateDateTime DESC";
///
/// 排序顺序
///
string StrSortOrder = "DESC";
///
/// 创建行
///
void PublicFunctionRows()
{
// List doubleList = new List();
//System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
//stopwatch.Start();
double lastSecond = 0;
Dictionary dictColumns = new Dictionary();
int intTopCount = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPageSize();
//System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
//stopwatch.Start();
Hashtable htData = this.PublicFunctionDataNew( ucPagerEx1.PageCurrent, ucPagerEx1.PageSize, ref dictColumns );//this.PublicFunctionData(intTopCount, ref dictColumns);
//lastSecond = stopwatch.Elapsed.TotalSeconds;
//stopwatch.Stop();
new System.Threading.Thread( new System.Threading.ParameterizedThreadStart( SetDataGridViewPage ) ).Start( htData );
//this.dgvData.DataColumns(string.Join(",", dictColumns.Keys.ToArray()), strHideField: this.dgvData.dgvFixedHideColumn);
if ( dgvData.Columns.Contains( "客户姓名" ) )
{
this.dgvData.Columns["客户姓名"].Frozen = true;
}
//stopwatch.Stop();
//MessageBoxCustom.Show(stopwatch.Elapsed.ToString());
}
void SetDataGridViewPage( object _htData )
{
Hashtable htData = (Hashtable)_htData;
if ( !string.IsNullOrEmpty( htData["PageSql"].ToString() ) )
{
try
{
//(htData["PageSql"].ToString())
DataTable dtCount = orbll.DAL.GetViewDataSetByCustomer(htData["PageSql"].ToString()).Tables[0];
htData["CurrentCount"] =
Convert.ToInt32((Convert.ToInt32(dtCount.Rows[0][0]) - (ucPagerEx1.PageCurrent) * ucPagerEx1.PageSize) > ucPagerEx1.PageSize ?
ucPagerEx1.PageSize :
(Convert.ToInt32(dtCount.Rows[0][0]) - (ucPagerEx1.PageCurrent) * ucPagerEx1.PageSize));
BindPageData(ucPagerEx1.PageCurrent, Convert.ToInt32(htData["CurrentCount"]), Convert.ToInt32(dtCount.Rows[0][0]));
this.dataGridViewStatisticsCount1.LocationX = this.dgvData.RowHeadersWidth;
this.dataGridViewStatisticsCount1.CurrenQuantity = Convert.ToInt32(htData["CurrentCount"]);
this.dataGridViewStatisticsCount1.TotalQuantity = Convert.ToInt32(dtCount.Rows[0][0]);
ucPagerEx1.SetPageControlData(Convert.ToInt32(htData["TotalPage"]));
}
catch {
}
}
//ucPagerEx1.Bind();
}
///
/// 获取要导出的数据
///
/// 要获取的条数
/// 当显示的列标题
///
Hashtable PublicFunctionDataNew( int pageIndex, int pageSize, ref Dictionary dictColumns )
{
string StrGuidName = "";
string StrFieldName = "";
if ( this.chkServiceVersion.Checked )
{
StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0033.ToString().Trim();
this.dgvData.StrValueNullColumn = "订单号,客户区域,客户地址,客户姓名,客户性别,客户电话,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系价格,接单人,备注,录入员,下单日期,会员卡号,客户QQ";
StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系价格,接单人,服务名称,数量,服务状态,服务时间,服务人员1,服务人员2,备注,录入员,下单日期,会员卡号,客户QQ,客户地址";
}
else if ( this.chkWeddingCelebration.Checked )
{
StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0034.ToString().Trim();
this.dgvData.StrValueNullColumn = "订单号,客户区域,客户地址,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态";
StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态,客户地址";
}
else
{
StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0010.ToString().Trim();
this.dgvData.StrValueNullColumn = "订单号,订单类型,客户区域,客户地址,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,套系类别,客户来源,套系名称,套系价格,接单人,订单类别,会员卡号,客户QQ,下单日期,录入员,备注";
StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,拍摄名称,摄影师,化妆师,引导师,拍摄时间,拍照状态,初修师,初修时间,初修状态,选片师,选片时间,选片状态,设计师,设计时间,设计状态,精修师,精修时间,精修状态,看版师,看版时间,看版状态,看版要求,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态,客户地址";
}
this.dgvData.dgvCurrentColumnOriginalSet = StrFieldName;
this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type";
this.dgvData.dgvGuidName = StrGuidName;
this.dgvData.dgvUserEmployeeID = this.StrUserID;
this.dgvData.DataColumns( this.dgvData.dgvCurrentColumnOriginalSet, strHideField: this.dgvData.dgvFixedHideColumn );
dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns( this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet );
if ( LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns( dictColumns ).IndexOf( this.dgvData.dgvFixedHideColumn ) == -1 )
{
if ( LYFZ.DAL.DAL_GridViewDisplayIndex.UpdateGridViewDisplayIndexModel( this.StrUserID, StrGuidName, LYFZ.DAL.DAL_GridViewDisplayIndex.UpdateGridViewDisplayIndexModel( StrFieldName ), LYFZ.DAL.DAL_GridViewDisplayIndex.StrVersionNumber ) )
{
this.PublicFunctionDataNew( pageIndex, pageSize, ref dictColumns );
}
else
{
if ( LYFZ.DAL.DAL_GridViewDisplayIndex.DeleteGridViewDisplayIndexModel( this.StrUserID, StrGuidName ) )
{
this.PublicFunctionDataNew( pageIndex, pageSize, ref dictColumns );
}
else
{
return null;
}
}
}
if ( (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.MemberCardShowHide) )
{
this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type,会员卡号";
}
this.dgvData.dictShowColumName = dictColumns;
Dictionary dicWhere = new Dictionary();
if ( IsFirstRun && !string.IsNullOrEmpty( LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber ) )
{
string StrWhere = " Where = '" + LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber + "'";
dicWhere.Add( "Ord_SinceOrderNumber", " in ('" + LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber + "') " );
this.cmbTextQuery.Text = LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber;
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhereByDataList( this.cmbtreevStoreName, "Ord_DividedShop", ref dicWhere );
}
else
{
this.GetWhereStr( ref dicWhere );
}
Hashtable htData = new Hashtable();
//DataTable newTable = new DataTable();
//if (this.chkServiceVersion.Checked)
//{
// if (this.StrSortField.Trim().IndexOf("Ordv_DigitalNumber") != -1)
// { this.StrSortField = this.StrSortField.Trim().Replace(",Ordv_DigitalNumber", ""); }
// else if (this.StrSortField.Trim().IndexOf("tb_ErpWeddingService.ID") == -1)
// { this.StrSortField += ",tb_ErpWeddingService.ID"; }
// htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderReportService(dictColumns, StrQueryCondition, intTopCount, this.StrSortField);
//}
//else
//{
// if (this.StrSortField.Trim().IndexOf("tb_ErpWeddingService.ID") != -1)
// { this.StrSortField = this.StrSortField.Trim().Replace(",tb_ErpWeddingService.ID", ""); }
// else if (this.StrSortField.Trim().IndexOf("Ordv_DigitalNumber") == -1)
// { this.StrSortField += ",Ordv_DigitalNumber"; }
// bool IschkWeddingCelebration = this.chkWeddingCelebration.Checked;
// htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderReport(dictColumns, StrQueryCondition, intTopCount, this.StrSortField, IschkWeddingCelebration);
//}
//System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
//stopwatch.Start();
htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderReportNew( dictColumns, pageIndex, pageSize, false, false, dicWhere, this.dgvData, this.StrCurrentClickField, StrSortOrder );
//stopwatch.Stop();
//MessageBoxCustom.Show(stopwatch.Elapsed.ToString_s());
return htData;
}
///
/// 获取要导出的数据
///
/// 要获取的条数
/// 当显示的列标题
///
Hashtable PublicFunctionData( int intTopCount, ref Dictionary dictColumns )
{
string StrGuidName = "";
string StrFieldName = "";
if ( this.chkServiceVersion.Checked )
{
StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0033.ToString().Trim();
this.dgvData.StrValueNullColumn = "订单号,客户区域,客户地址,客户姓名,客户性别,客户电话,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系价格,接单人,备注,录入员,下单日期,会员卡号,客户QQ";
StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系价格,接单人,服务名称,数量,服务状态,服务时间,服务人员1,服务人员2,备注,录入员,下单日期,会员卡号,客户QQ,客户地址";
}
else if ( this.chkWeddingCelebration.Checked )
{
StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0034.ToString().Trim();
this.dgvData.StrValueNullColumn = "订单号,客户区域,客户地址,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态";
StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态,客户地址";
}
else
{
StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0010.ToString().Trim();
this.dgvData.StrValueNullColumn = "订单号,订单类型,客户区域,客户地址,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,套系类别,客户来源,套系名称,套系价格,接单人,订单类别,会员卡号,客户QQ,下单日期,录入员,备注";
StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,拍摄名称,摄影师,化妆师,引导师,拍摄时间,拍照状态,初修师,初修时间,初修状态,选片师,选片时间,选片状态,设计师,设计时间,设计状态,精修师,精修时间,精修状态,看版师,看版时间,看版状态,看版要求,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态,客户地址";
}
this.dgvData.dgvCurrentColumnOriginalSet = StrFieldName;
this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type";
this.dgvData.dgvGuidName = StrGuidName;
this.dgvData.dgvUserEmployeeID = this.StrUserID;
this.dgvData.DataColumns( this.dgvData.dgvCurrentColumnOriginalSet, strHideField: this.dgvData.dgvFixedHideColumn );
dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns( this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet );
if ( LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns( dictColumns ).IndexOf( this.dgvData.dgvFixedHideColumn ) == -1 )
{
if ( LYFZ.DAL.DAL_GridViewDisplayIndex.UpdateGridViewDisplayIndexModel( this.StrUserID, StrGuidName, LYFZ.DAL.DAL_GridViewDisplayIndex.UpdateGridViewDisplayIndexModel( StrFieldName ), LYFZ.DAL.DAL_GridViewDisplayIndex.StrVersionNumber ) )
{
this.PublicFunctionData( intTopCount, ref dictColumns );
}
else
{
if ( LYFZ.DAL.DAL_GridViewDisplayIndex.DeleteGridViewDisplayIndexModel( this.StrUserID, StrGuidName ) )
{
this.PublicFunctionData( intTopCount, ref dictColumns );
}
else
{
return null;
}
}
}
this.dgvData.dictShowColumName = dictColumns;
string StrQueryCondition = "";
if ( IsFirstRun && !string.IsNullOrEmpty( LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber ) )
{
string StrWhere = " Where Ord_SinceOrderNumber = '" + LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber + "'";
this.cmbTextQuery.Text = LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber;
StrQueryCondition = StrWhere + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhere( this.cmbtreevStoreName, "Ord_DividedShop" );
}
else
{
StrQueryCondition = this.GetWhereStr();
}
Hashtable htData = new Hashtable();
//DataTable newTable = new DataTable();
if ( this.chkServiceVersion.Checked )
{
if ( this.StrSortField.Trim().IndexOf( "Ordv_DigitalNumber" ) != -1 )
{
this.StrSortField = this.StrSortField.Trim().Replace( ",Ordv_DigitalNumber", "" );
}
else if ( this.StrSortField.Trim().IndexOf( "tb_ErpWeddingService.ID" ) == -1 )
{
this.StrSortField += ",tb_ErpWeddingService.ID";
}
htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderReportService( dictColumns, StrQueryCondition, intTopCount, this.StrSortField );
}
else
{
if ( this.StrSortField.Trim().IndexOf( "tb_ErpWeddingService.ID" ) != -1 )
{
this.StrSortField = this.StrSortField.Trim().Replace( ",tb_ErpWeddingService.ID", "" );
}
else if ( this.StrSortField.Trim().IndexOf( "Ordv_DigitalNumber" ) == -1 )
{
this.StrSortField += ",Ordv_DigitalNumber";
}
bool IschkWeddingCelebration = this.chkWeddingCelebration.Checked;
htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderReport( dictColumns, StrQueryCondition, intTopCount, this.StrSortField, IschkWeddingCelebration );
}
return htData;
}
DataTable GetExportReportData( int intTopCount, ref Dictionary dictColumns )
{
string StrGuidName = "";
string StrFieldName = "";
if ( this.chkServiceVersion.Checked )
{
StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0033.ToString().Trim();
this.dgvData.StrValueNullColumn = "订单号,客户区域,客户地址,客户姓名,客户性别,客户电话,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系价格,接单人,备注,录入员,下单日期,会员卡号,客户QQ";
StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系价格,接单人,服务名称,数量,服务状态,服务时间,服务人员1,服务人员2,备注,录入员,下单日期,会员卡号,客户QQ,客户地址";
}
else if ( this.chkWeddingCelebration.Checked )
{
StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0034.ToString().Trim();
this.dgvData.StrValueNullColumn = "订单号,客户区域,客户地址,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态";
StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态,客户地址";
}
else
{
StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0010.ToString().Trim();
this.dgvData.StrValueNullColumn = "订单号,订单类型,客户区域,客户地址,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,套系类别,客户来源,套系名称,套系价格,接单人,订单类别,会员卡号,客户QQ,下单日期,录入员,备注";
StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,拍摄名称,摄影师,化妆师,引导师,拍摄时间,拍照状态,初修师,初修时间,初修状态,选片师,选片时间,选片状态,设计师,设计时间,设计状态,精修师,精修时间,精修状态,看版师,看版时间,看版状态,看版要求,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态,客户地址";
}
dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns( this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet );
/*if (LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns(dictColumns).IndexOf(this.dgvData.dgvFixedHideColumn) == -1)
{
if (LYFZ.DAL.DAL_GridViewDisplayIndex.UpdateGridViewDisplayIndexModel(this.StrUserID, StrGuidName, LYFZ.DAL.DAL_GridViewDisplayIndex.UpdateGridViewDisplayIndexModel(StrFieldName), LYFZ.DAL.DAL_GridViewDisplayIndex.StrVersionNumber))
{ this.PublicFunctionData(intTopCount, ref dictColumns); }
else
{
if (LYFZ.DAL.DAL_GridViewDisplayIndex.DeleteGridViewDisplayIndexModel(this.StrUserID, StrGuidName))
{ this.PublicFunctionData(intTopCount, ref dictColumns); }
else
{ return null; }
}
}
this.dgvData.dictShowColumName = dictColumns;*/
string StrQueryCondition = "";
if ( IsFirstRun && !string.IsNullOrEmpty( LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber ) )
{
string StrWhere = " Where Ord_SinceOrderNumber = '" + LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber + "'";
this.cmbTextQuery.Text = LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber;
StrQueryCondition = StrWhere + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhere( this.cmbtreevStoreName, "Ord_DividedShop" );
}
else
{
StrQueryCondition = this.GetWhereStr();
}
DataTable htData = new DataTable();
//DataTable newTable = new DataTable();
if ( this.StrSortField.Trim().IndexOf( "Ordv_DigitalNumber" ) != -1 )
{
this.StrSortField = this.StrSortField.Trim().Replace( ",Ordv_DigitalNumber", "" );
}
htData = LYFZ.ComponentLibrary.DataGridOrderView.GetDataTableOrderPhotographReportService( dictColumns, StrQueryCondition, intTopCount, "Ords_PhotographMaxTime DESC" );
return htData;
}
///
/// 返回要操作的条件
///
///
string GetWhereStr()
{
string StrWhere = " Where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere( this.cmbtreevStoreName, "Ord_DividedShop", ConnectWord: "" );
string StrText = this.cmbTextQuery.Text.Trim().ToLower();
if ( StrText != "" )
{
StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetQueryTextQueryCondition( StrText.Trim() );
}
if ( this.chkIntent.Checked )
{
StrWhere += " and Ord_Class = '0'";
}
else
{
StrWhere += " and Ord_Class = '1'";
//是否显示已取件的订单
if ( this.chkServiceVersion.Checked )
{
if ( this.chkShowCompleteOrder.Checked )
{
StrWhere += " and Ws_Status = '1'";
}
else
{
StrWhere += " and ISNULL(Ws_Status, '0') <> '1'";
} //2017-03-30 6刘工修改
//{ StrWhere += " and Ws_Status <> '1'"; }
}
else
{
if ( this.chkShowCompleteOrder.Checked )
{
StrWhere += " and (Ords_ProductPickupIntStatus = 2 And Ords_ServiceIntStatus = 2)";
}
else
{
StrWhere += " and (Ords_ProductPickupIntStatus in (0,1) or Ords_ServiceIntStatus in (0,1))";
}
}
}
if ( DictData.ContainsKey( "OrdersPerson" ) && DictData["OrdersPerson"].Trim().Length > 0 )
{
StrWhere += " and Ord_OrderPersonName like '%" + DictData["OrdersPerson"].Trim() + "%'";
}
if ( DictData.ContainsKey( "CustomerSource" ) && DictData["CustomerSource"].Trim().Length > 0 )
{
StrWhere += " and Ord_CustomerSource = '" + DictData["CustomerSource"].Trim() + "'";
}
if ( DictData.ContainsKey( "PhotographyCategory" ) && DictData["PhotographyCategory"].Trim().Length > 0 )
{
StrWhere += " and Ord_PhotographyCategory in (" + DictData["PhotographyCategory"].Trim() + ")";
}
if ( DictData.ContainsKey( "SeriesName" ) && DictData["SeriesName"].Trim().Length > 0 )
{
StrWhere += " and Ord_SeriesName = '" + DictData["SeriesName"].Trim() + "'";
}
if ( DictData.ContainsKey( "SeriesAmountStart" ) && DictData["SeriesAmountStart"].Trim().Length > 0 && DictData.ContainsKey( "SeriesAmountEnd" ) && DictData["SeriesAmountEnd"].Trim().Length > 0 )
{
StrWhere += " And (Ord_SeriesPrice between '" + DictData["SeriesAmountStart"].ToString().Trim() + "' And '" + DictData["SeriesAmountEnd"].ToString().Trim() + "')";
}
if ( DictData.ContainsKey( "OrderClass" ) && DictData["OrderClass"].Length > 0 )
{
StrWhere += " and Ord_OrderClass = '" + DictData["OrderClass"].Trim() + "'";
}
if ( DictData.ContainsKey( "QueryDateTimeStart" ) && DictData["QueryDateTimeStart"].Trim().Length > 0 && DictData.ContainsKey( "QueryDateTimeEnd" ) && DictData["QueryDateTimeEnd"].Trim().Length > 0 )
{
StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime( "Ord_CreateDateTime", DictData["QueryDateTimeStart"], DictData["QueryDateTimeEnd"] );
}
if ( DictData.ContainsKey( "PhotographDateTimeStart" ) && DictData["PhotographDateTimeStart"].Trim().Length > 0 && DictData.ContainsKey( "PhotographDateTimeEnd" ) && DictData["PhotographDateTimeEnd"].Trim().Length > 0 )
{
StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime( "Ords_PhotographMaxTime", DictData["PhotographDateTimeStart"], DictData["PhotographDateTimeEnd"] );
}
#region 客户区域;
if ( DictData.ContainsKey( "CustomerArea" ) && DictData["CustomerArea"].Trim().Length > 0 )
{
StrWhere += " and Cus_Region = '" + DictData["CustomerArea"].Trim() + "'";
}
#endregion
if ( this.chkDressVersion.Checked )
{
StrWhere += " And Ord_Type = '" + Convert.ToInt32( LYFZ.EnumPublic.OrderType.婚纱订单 ) + "'";
}
else if ( this.chkKidsVersion.Checked )
{
StrWhere += " And Ord_Type = '" + Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ) + "'";
}
else if ( this.chkPortraitVersion.Checked )
{
StrWhere += " And Ord_Type = '" + Convert.ToInt32( LYFZ.EnumPublic.OrderType.写真订单 ) + "'";
}
else if ( this.chkWeddingCelebration.Checked )
{
StrWhere += " And Ord_Type = '" + Convert.ToInt32( LYFZ.EnumPublic.OrderType.婚庆订单 ) + "'";
}
else if ( this.chkServiceVersion != null && this.chkServiceVersion.Checked )
{
StrWhere += " And Ord_Type = '" + Convert.ToInt32( LYFZ.EnumPublic.OrderType.服务订单 ) + "'";
}
StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, chkServiceVersion: this.chkServiceVersion, chkWeddingCelebration: this.chkWeddingCelebration );
return StrWhere;
}
void GetWhereStr( ref Dictionary dicWhere )
{
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhereByDataList( this.cmbtreevStoreName, "Ord_DividedShop",
ref dicWhere );
string StrText = this.cmbTextQuery.Text.Trim().ToLower();
if ( StrText != "" )
{
if ( !string.IsNullOrEmpty( StrText.Trim() ) )
{
StrText = StrText.Trim().ToLower();
dicWhere.Add( "Cus_Name", StrText.Trim() );
dicWhere.Add( "Ord_SinceOrderNumber", StrText.Trim() );
dicWhere.Add( "Cus_Telephone", StrText.Trim() );
dicWhere.Add( "Cus_Name_py", StrText.Trim() );
/* if (LYFZ.Command.Command_Validate.IsChinese(StrText.Replace("/", "")))
{
dicWhere.Add("Cus_Name", StrText.Trim());
}
else if (LYFZ.Command.Command_Validate.IsNumber(StrText))
{
if (LYFZ.MY_LocalSettings.MyLocalSettings.Ordernumbersearch)
{
//StrWhere = " And (Ord_SinceOrderNumber like '%" + StrText.Trim() + "%' or Cus_Telephone like '%" + StrText.Trim() + "%')";
dicWhere.Add("Ord_SinceOrderNumber", StrText.Trim());
}
else
{
//StrWhere += " And Cus_Telephone like '%" + StrText.Trim() + "%'";
dicWhere.Add("Cus_Telephone", StrText.Trim());
}
}
else if (LYFZ.Command.Command_Validate.IsEnglish(StrText.Replace("/", "")))
{
dicWhere.Add("Cus_Name_py", StrText.Trim());
//StrWhere = " And Cus_Name_py like '%" + StrText.Trim() + "%'";
}
else if (LYFZ.Command.Command_Validate.IsOrderNumber(StrText))
{
dicWhere.Add("Ord_SinceOrderNumber", StrText.Trim());
//StrWhere = " And Ord_SinceOrderNumber like '" + StrText.Trim() + "%'";
}*/
}
}
if ( this.chkIntent.Checked )
{
//StrWhere += " and Ord_Class = '0'";
dicWhere.Add( "Ord_Class", "0" );
if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.IntentionCustomerCompetence, CustomAttributes.OperatingAuthority.Client_ShowAllIntentClient ) )
{
dicWhere.Add( "Ord_OrderPersonNumber", "" + StrUserID + "" );
}
}
else
{
//StrWhere += " and Ord_Class = '1'";
dicWhere.Add( "Ord_Class", "1" );
}
//是否显示已取件的订单
if ( this.chkServiceVersion.Checked )
{
if ( this.chkShowCompleteOrder.Checked )
{
dicWhere.Add( "Ords_ServiceIntStatus", "1" );
//StrWhere += " and Ws_Status = '1'";
}
else
{
dicWhere.Add( "Ords_ServiceIntStatus", "<>1" );
//StrWhere += " and ISNULL(Ws_Status, '0') <> '1'";
} //2017-03-30 6刘工修改
//{ StrWhere += " and Ws_Status <> '1'"; }
}
else
{
if ( this.chkShowCompleteOrder.Checked )
{
dicWhere.Add( "Ords_ProductPickupIntStatus", "2" );
dicWhere.Add( "Ords_ServiceIntStatus", "2" );
//StrWhere += " and (Ords_ProductPickupIntStatus = 2 And Ords_ServiceIntStatus = 2)";
}
else
{
dicWhere.Add( "Ords_ProductPickupIntStatus", " in (0,1)" );
dicWhere.Add( "Ords_ServiceIntStatus", " in (0,1)" );
//StrWhere += " and (Ords_ProductPickupIntStatus in (0,1) or Ords_ServiceIntStatus in (0,1))"; }
}
}
if ( BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.HidePickUpOrder )
{
if ( !this.chkShowCompleteOrder.Checked && string.IsNullOrEmpty( cmbTextQuery.Text ) )
{// 显示未取件的订单,且查询框空时;
if ( dicWhere.ContainsKey( "Ords_ProductPickupIntStatus" ) )
{
dicWhere.Remove( "Ords_ProductPickupIntStatus" );
}
if ( dicWhere.ContainsKey( "Ords_ServiceIntStatus" ) )
{
dicWhere.Remove( "Ords_ServiceIntStatus" );
}
if ( !dicWhere.ContainsKey( "Ords_ProductPickupIntStatus" ) )
{
dicWhere.Add( "Ords_ProductPickupIntStatus", " in (0,1)" );
}
}
else if ( this.chkShowCompleteOrder.Checked )
{// 显示取件Ok的订单;
if ( dicWhere.ContainsKey( "Ords_ProductPickupIntStatus" ) )
{
dicWhere.Remove( "Ords_ProductPickupIntStatus" );
}
if ( dicWhere.ContainsKey( "Ords_ServiceIntStatus" ) )
{
dicWhere.Remove( "Ords_ServiceIntStatus" );
}
if ( !dicWhere.ContainsKey( "Ords_ProductPickupIntStatus" ) )
{
dicWhere.Add( "Ords_ProductPickupIntStatus", " 2" );
}
}
}
if ( DictData.ContainsKey( "OrdersPerson" ) && DictData["OrdersPerson"].Trim().Length > 0 )
{
if ( !this.chkIntent.Checked || LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.IntentionCustomerCompetence, CustomAttributes.OperatingAuthority.Client_ShowAllIntentClient ) )
{
dicWhere.Add( "Ord_OrderPersonName", DictData["OrdersPerson"].Trim() );
}
//StrWhere += " and Ord_OrderPersonName like '%" + DictData["OrdersPerson"].Trim() + "%'";
}
if ( DictData.ContainsKey( "CustomerSource" ) && DictData["CustomerSource"].Trim().Length > 0 )
{
dicWhere.Add( "Ord_CustomerSource", DictData["CustomerSource"].Trim() );
//StrWhere += " and Ord_CustomerSource = '" + DictData["CustomerSource"].Trim() + "'";
}
if ( DictData.ContainsKey( "PhotographyCategory" ) && DictData["PhotographyCategory"].Trim().Length > 0 )
{
dicWhere.Add( "Ord_PhotographyCategory", DictData["PhotographyCategory"].Trim() );
//StrWhere += " and Ord_PhotographyCategory in (" + DictData["PhotographyCategory"].Trim() + ")";
}
if ( DictData.ContainsKey( "SeriesName" ) && DictData["SeriesName"].Trim().Length > 0 )
{
dicWhere.Add( "Ord_SeriesName", DictData["SeriesName"].Trim() );
//StrWhere += " and Ord_SeriesName = '" + DictData["SeriesName"].Trim() + "'";
}
if ( DictData.ContainsKey( "SeriesAmountStart" ) && DictData["SeriesAmountStart"].Trim().Length > 0 && DictData.ContainsKey( "SeriesAmountEnd" ) && DictData["SeriesAmountEnd"].Trim().Length > 0 )
{
dicWhere.Add( "StartSeriesPrice", DictData["SeriesAmountStart"].Trim() );
dicWhere.Add( "EndSeriesPrice", DictData["SeriesAmountEnd"].Trim() );
//StrWhere += " And (Ord_SeriesPrice between '" + DictData["SeriesAmountStart"].ToString().Trim() + "' And '" + DictData["SeriesAmountEnd"].ToString().Trim() + "')";
}
if ( DictData.ContainsKey( "OrderClass" ) && DictData["OrderClass"].Length > 0 )
{
dicWhere.Add( "Ord_OrderClass", DictData["OrderClass"].Trim() );
//StrWhere += " and Ord_OrderClass = '" + DictData["OrderClass"].Trim() + "'";
}
if ( DictData.ContainsKey( "QueryDateTimeStart" ) && DictData["QueryDateTimeStart"].Trim().Length > 0 && DictData.ContainsKey( "QueryDateTimeEnd" ) && DictData["QueryDateTimeEnd"].Trim().Length > 0 )
{
dicWhere.Add( "startdatetime", DictData["QueryDateTimeStart"].Trim() );
dicWhere.Add( "enddatetime", DictData["QueryDateTimeEnd"].Trim() );
//StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ord_CreateDateTime", DictData["QueryDateTimeStart"], DictData["QueryDateTimeEnd"]);
}
if ( DictData.ContainsKey( "PhotographDateTimeStart" ) && DictData["PhotographDateTimeStart"].Trim().Length > 0 && DictData.ContainsKey( "PhotographDateTimeEnd" ) && DictData["PhotographDateTimeEnd"].Trim().Length > 0 )
{
dicWhere.Add( "PhotographStartTime", DictData["PhotographDateTimeStart"].Trim() );
dicWhere.Add( "PhotographEndTime", DictData["PhotographDateTimeEnd"].Trim() );
//StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ord_CreateDateTime", DictData["QueryDateTimeStart"], DictData["QueryDateTimeEnd"]);
}
#region 客户区域;
if ( DictData.ContainsKey( "CustomerArea" ) && DictData["CustomerArea"].Trim().Length > 0 )
{
dicWhere.Add( "Cus_Region", DictData["CustomerArea"].Trim() );
}
#endregion
if ( this.chkDressVersion.Checked )
{
dicWhere.Add( "Ord_Type", Convert.ToInt32( LYFZ.EnumPublic.OrderType.婚纱订单 ).ToString() );
//StrWhere += " And Ord_Type = '" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.婚纱订单) + "'";
}
else if ( this.chkKidsVersion.Checked )
{
dicWhere.Add( "Ord_Type", Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString() );
//StrWhere += " And Ord_Type = '" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.儿童订单) + "'";
}
else if ( this.chkPortraitVersion.Checked )
{
dicWhere.Add( "Ord_Type", Convert.ToInt32( LYFZ.EnumPublic.OrderType.写真订单 ).ToString() );
//StrWhere += " And Ord_Type = '" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.写真订单) + "'";
}
else if ( this.chkWeddingCelebration.Checked )
{
dicWhere.Add( "Ord_Type", Convert.ToInt32( LYFZ.EnumPublic.OrderType.婚庆订单 ).ToString() );
//StrWhere += " And Ord_Type = '" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.婚庆订单) + "'";
}
else if ( this.chkServiceVersion != null && this.chkServiceVersion.Checked )
{
dicWhere.Add( "Ord_Type", Convert.ToInt32( LYFZ.EnumPublic.OrderType.服务订单 ).ToString() );
//StrWhere += " And Ord_Type = '" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.服务订单) + "'";
}
// StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL(this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, chkServiceVersion: this.chkServiceVersion, chkWeddingCelebration: this.chkWeddingCelebration);
//return StrWhere;
}
}
}