1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678 |
- 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;
- }
- /// <summary>
- /// 安排任务的任务类型
- /// </summary>
- public string StrClientServiceType = "";
- /// <summary>
- /// 是否首次运行
- /// </summary>
- bool IsFirstRun = true;
- /// <summary>
- /// 查询条件
- /// </summary>
- private Dictionary<string, string> DictData = new Dictionary<string, string>();
- /// <summary>
- /// 员工编号
- /// </summary>
- string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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 );
- }
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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 );
- }
- }
- /// <summary>
- /// 选择分店获取权限
- /// </summary>
- 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 );
- }
- /// <summary>
- /// 分店选择查询数据
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cmbtreevStoreName_ComboBoxTree_NodeMouseClick( object sender, TreeNodeMouseClickEventArgs e )
- {
- this.PublicFunctionRights();
- //this.PublicFunctionRows();
- ucPagerEx1.PageCurrent = 1;
- ucPagerEx1.Bind();
- }
- /// <summary>
- /// 回车
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cmbTextQuery_KeyDown( object sender, KeyEventArgs e )
- {
- if ( e.KeyCode == Keys.Enter )
- {
- this.btnQuery_Click( this, null );
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnQuery_Click( object sender, EventArgs e )
- {
- this.DictData.Clear();
- //this.PublicFunctionRows();
- ucPagerEx1.PageCurrent = 1;
- ucPagerEx1.Bind();
- }
- /// <summary>
- /// 查询条件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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();
- }
- }
- /// <summary>
- /// 婚纱版
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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();
- }
- /// <summary>
- /// 儿童版
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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();
- }
- /// <summary>
- /// 写真版
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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();
- }
- /// <summary>
- /// 婚庆
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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();
- }
- /// <summary>
- /// 服务版
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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();
- }
- /// <summary>
- /// 意向订单
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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();
- }
- /// <summary>
- /// 显示已取订单
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkShowCompleteOrder_Click( object sender, EventArgs e )
- {
- ucPagerEx1.PageCurrent = 1;
- ucPagerEx1.Bind();
- }
- /// <summary>
- /// 预约单
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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( "请选择要操作的订单" );
- }
- }
- }
- /// <summary>
- /// 打开订单
- /// </summary>
- 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();
- }
- }
- /// <summary>
- /// 安排客服
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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.订单意向 );
- }
- }
- }
- /// <summary>
- /// 列表双击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dgvData_CellMouseDoubleClick( object sender, DataGridViewCellMouseEventArgs e )
- {
- if ( this.dgvData.Rows.Count > 0 )
- {
- if ( e.RowIndex != -1 && e.ColumnIndex != -1 )
- {
- this.openOrder();
- }
- }
- }
- /// <summary>
- /// 列表单击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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
- {
- }
- }
- /// <summary>
- /// 对列表控件双击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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();
- }
- }
- }
- /// <summary>
- /// 客户资料
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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();
- }
- }
- }
- }
- }
- /// <summary>
- /// 导出
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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<string, string> dictColumns = new Dictionary<string, string>();
- 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<string, string> dictColumns = new Dictionary<string, string>();
- 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 );
- }
- }
- }
- }
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnDelete_Click( object sender, EventArgs e )
- {
- if ( this.dgvData.Rows.Count > 0 )
- {
- if ( this.dgvData.CurrentRow.Index >= 0 )
- {
- List<CommandInfo> clist = new List<CommandInfo>();
- 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;
- };
- /// <summary>
- /// 打印
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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<ScenicSpot> listScenicSpot = new List<ScenicSpot>();
- 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( "请选择订单" );
- }
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnClose_Click( object sender, EventArgs e )
- {
- this.Close();
- }
- /// <summary>
- /// 窗体大小发生改变事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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;
- }
- }
- }
- /// <summary>
- /// 右键菜单
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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);//弹出操作菜单
- }
- }
- }
- }
- /// <summary>
- /// 右键菜单选择项事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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();
- }
- }
- /// <summary>
- /// 点击列标头排序
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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;
- }
- /// <summary>
- /// 当前点击的字段
- /// </summary>
- string StrCurrentClickField = "";
- /// <summary>
- /// 排序字段
- /// </summary>
- string StrSortField = "Ord_CreateDateTime DESC";
- /// <summary>
- /// 排序顺序
- /// </summary>
- string StrSortOrder = "DESC";
- /// <summary>
- /// 创建行
- /// </summary>
- void PublicFunctionRows()
- {
- // List<double> doubleList = new List<double>();
- //System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
- //stopwatch.Start();
- double lastSecond = 0;
- Dictionary<string, string> dictColumns = new Dictionary<string, string>();
- 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();
- }
-
- /// <summary>
- /// 获取要导出的数据
- /// </summary>
- /// <param name="intTopCount">要获取的条数</param>
- /// <param name="dictColumns">当显示的列标题</param>
- /// <returns></returns>
- Hashtable PublicFunctionDataNew( int pageIndex, int pageSize, ref Dictionary<string, string> 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<string, string> dicWhere = new Dictionary<string, string>();
- 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;
- }
- /// <summary>
- /// 获取要导出的数据
- /// </summary>
- /// <param name="intTopCount">要获取的条数</param>
- /// <param name="dictColumns">当显示的列标题</param>
- /// <returns></returns>
- Hashtable PublicFunctionData( int intTopCount, ref Dictionary<string, string> 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<string, string> 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;
- }
- /// <summary>
- /// 返回要操作的条件
- /// </summary>
- /// <returns></returns>
- 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<string, string> 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;
- }
- }
- }
|