OrderReportFormMain.cs 91 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Collections;
  10. using LYFZ.ComponentLibrary;
  11. using LYFZ.Helper;
  12. using LYFZ.Software.MainBusiness.DoorCityProcess;
  13. namespace LYFZ.Software.MainBusiness.CameraControlBook
  14. {
  15. public partial class OrderReportFormMain : LYFZ.Software.UI.CameraControlBook.OrderReportFormMain
  16. {
  17. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  18. LYFZ.BLL.BLL_ErpPayment ptbll = new BLL.BLL_ErpPayment();
  19. LYFZ.BLL.BLL_ErpKepanLogo klbll = new BLL.BLL_ErpKepanLogo();
  20. LYFZ.BLL.BLL_ErpOrderDigital odbll = new BLL.BLL_ErpOrderDigital();
  21. LYFZ.BLL.BLL_ErpOrdersPerson pnbll = new BLL.BLL_ErpOrdersPerson();
  22. LYFZ.BLL.BLL_ErpPlusPickItems pibll = new BLL.BLL_ErpPlusPickItems();
  23. LYFZ.BLL.BLL_ErpTwoSalesOrder tobll = new BLL.BLL_ErpTwoSalesOrder();
  24. LYFZ.BLL.BLL_ErpCustomerGroup ctgpbll = new BLL.BLL_ErpCustomerGroup();
  25. LYFZ.BLL.BLL_ErpWeddingService wsbll = new BLL.BLL_ErpWeddingService();
  26. LYFZ.BLL.BLL_ErpOrderProductLOG lgbll = new BLL.BLL_ErpOrderProductLOG();
  27. LYFZ.BLL.BLL_ErpOrderProductList plbll = new BLL.BLL_ErpOrderProductList();
  28. LYFZ.BLL.BLL_ErpOrderPhotoPrints ppbll = new BLL.BLL_ErpOrderPhotoPrints();
  29. LYFZ.BLL.BLL_ErpOrdersPhotography opbll = new BLL.BLL_ErpOrdersPhotography();
  30. LYFZ.BLL.BLL_ErpOrderDigitalStatus orsbll = new BLL.BLL_ErpOrderDigitalStatus();
  31. LYFZ.BLL.BLL_ErpCustomerGroupMembers ctgmbll = new BLL.BLL_ErpCustomerGroupMembers();
  32. LYFZ.BLL.BLL_ErpPieceCommissionRecords prbll = new BLL.BLL_ErpPieceCommissionRecords();
  33. LYFZ.BLL.BLL_ErpOrderDigitalStatus ordsbll = new BLL.BLL_ErpOrderDigitalStatus();
  34. public OrderReportFormMain()
  35. {
  36. this.Shown += OrderReportFormMain_Shown;
  37. this.Load += OrderReportFormMain_Load;
  38. this.cmbTextQuery.KeyDown += cmbTextQuery_KeyDown;
  39. this.btnQuery.Click += btnQuery_Click;
  40. this.btnConditionQuery.Click += btnConditionQuery_Click;
  41. this.chkDressVersion.Click += chkDressVersion_Click;
  42. this.chkKidsVersion.Click += chkKidsVersion_Click;
  43. this.chkPortraitVersion.Click += chkPortraitVersion_Click;
  44. this.chkServiceVersion.Click += chkServiceVersion_Click;
  45. this.chkIntent.CheckedChanged += chkIntent_CheckedChanged;
  46. this.btnReservation.Click += btnReservation_Click;
  47. this.btnCustomerData.Click += btnCustomerData_Click;
  48. this.btnClientServiceAnPai.Click += btnClientServiceAnPai_Click;
  49. this.btnExport.Click += btnExport_Click;
  50. this.btnDelete.Click += btnDelete_Click;
  51. this.btnPrint.Click += btnPrint_Click;
  52. this.btnClose.Click += btnClose_Click;
  53. this.Resize += OrderReportFormMain_Resize;
  54. this.cmbtreevStoreName.ComboBoxTree_NodeMouseClick += cmbtreevStoreName_ComboBoxTree_NodeMouseClick;
  55. this.chkWeddingCelebration.Click += chkWeddingCelebration_Click;
  56. this.chkShowCompleteOrder.Click += chkShowCompleteOrder_Click;
  57. this.dgvData.CellMouseDoubleClick += dgvData_CellMouseDoubleClick;
  58. this.dgvData.ColumnHeaderMouseClick += dgvData_ColumnHeaderMouseClick;
  59. this.dgvData.CellClick += dgvData_CellClick;
  60. this.dgvData.MouseDoubleClick += dgvData_MouseDoubleClick;
  61. this.dgvData.CellMouseDown += dgvData_CellMouseDown;
  62. this.flowLayoutPanel1.Height = 34;
  63. ucPagerEx1.EventPaging += ucPagerEx1_EventPaging;
  64. }
  65. int ucPagerEx1_EventPaging( UCPager.EventPagingArg e )
  66. {
  67. //pageData.PageSize = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReportFormPageSize;
  68. this.ucPagerEx1.PageSize = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReportFormPageSize;
  69. PublicFunctionRows();
  70. return ucPagerEx1.NMax;
  71. }
  72. /// <summary>
  73. /// 安排任务的任务类型
  74. /// </summary>
  75. public string StrClientServiceType = "";
  76. /// <summary>
  77. /// 是否首次运行
  78. /// </summary>
  79. bool IsFirstRun = true;
  80. /// <summary>
  81. /// 查询条件
  82. /// </summary>
  83. private Dictionary<string, string> DictData = new Dictionary<string, string>();
  84. /// <summary>
  85. /// 员工编号
  86. /// </summary>
  87. string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  88. /// <summary>
  89. /// 窗体加载事件
  90. /// </summary>
  91. /// <param name="sender"></param>
  92. /// <param name="e"></param>
  93. void OrderReportFormMain_Shown( object sender, EventArgs e )
  94. {
  95. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName( this.cmbtreevStoreName, StrKeyCode: "qt002" );
  96. this.PublicFunctionRights();
  97. if ( this.StrClientServiceType.Trim().Length > 0 )
  98. {
  99. this.chkIntent.Checked = true;
  100. }
  101. //this.PublicFunctionRows();
  102. ucPagerEx1.Bind();
  103. this.IsFirstRun = false;
  104. this.OrderReportFormMain_Resize( this, null );
  105. }
  106. /// <summary>
  107. /// 窗体加载事件
  108. /// </summary>
  109. /// <param name="sender"></param>
  110. /// <param name="e"></param>
  111. void OrderReportFormMain_Load( object sender, EventArgs e )
  112. {
  113. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetSystemVersion( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion );
  114. if ( this.dgvData.Columns.Count <= 0 )
  115. {
  116. string strColumn = "订单号,订单类型,客户区域,客户姓名,客户电话,客户性别,客户来源,套系类别,套系名称,套系价格,接单人,拍摄名称,拍照状态,摄影师,拍摄时间,化妆师,初修师,初修时间,初修状态,选片师,选片时间,选片状态,设计师,设计时间,设计状态,精修师,精修时间,精修状态,看版师,看版时间,看版状态,看版要求,取件状态,取件日期,备注,录入员,下单日期";
  117. this.dgvData.DataColumns( strColumn, LYFZ.Software.MainBusiness.CommonLogical.CacheData.StrOrderReportHideField );
  118. }
  119. }
  120. /// <summary>
  121. /// 选择分店获取权限
  122. /// </summary>
  123. void PublicFunctionRights()
  124. {
  125. this.btnPrint.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresOPenSingle", LYFZ.CustomAttributes.OperatingAuthority.Print );
  126. this.btnExport.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "OrderReport", LYFZ.CustomAttributes.OperatingAuthority.DataExport );
  127. this.btnDelete.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "OrderReport", LYFZ.CustomAttributes.OperatingAuthority.Delete );
  128. this.chkIntent.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "OrderReport", LYFZ.CustomAttributes.OperatingAuthority.OrderIntent );
  129. }
  130. /// <summary>
  131. /// 分店选择查询数据
  132. /// </summary>
  133. /// <param name="sender"></param>
  134. /// <param name="e"></param>
  135. void cmbtreevStoreName_ComboBoxTree_NodeMouseClick( object sender, TreeNodeMouseClickEventArgs e )
  136. {
  137. this.PublicFunctionRights();
  138. //this.PublicFunctionRows();
  139. ucPagerEx1.PageCurrent = 1;
  140. ucPagerEx1.Bind();
  141. }
  142. /// <summary>
  143. /// 回车
  144. /// </summary>
  145. /// <param name="sender"></param>
  146. /// <param name="e"></param>
  147. void cmbTextQuery_KeyDown( object sender, KeyEventArgs e )
  148. {
  149. if ( e.KeyCode == Keys.Enter )
  150. {
  151. this.btnQuery_Click( this, null );
  152. }
  153. }
  154. /// <summary>
  155. /// 查询
  156. /// </summary>
  157. /// <param name="sender"></param>
  158. /// <param name="e"></param>
  159. void btnQuery_Click( object sender, EventArgs e )
  160. {
  161. this.DictData.Clear();
  162. //this.PublicFunctionRows();
  163. ucPagerEx1.PageCurrent = 1;
  164. ucPagerEx1.Bind();
  165. }
  166. /// <summary>
  167. /// 查询条件
  168. /// </summary>
  169. /// <param name="sender"></param>
  170. /// <param name="e"></param>
  171. void btnConditionQuery_Click( object sender, EventArgs e )
  172. {
  173. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ConditionQuerySamllForm frm = new DoorCityProcess.SetSmallForm.ConditionQuerySamllForm();
  174. frm.IsShowBootDivision = !this.chkServiceVersion.Checked;
  175. frm.LoadType = "订单报表";
  176. frm.ShowDialog();
  177. if ( frm.DictDataArray.Count > 0 )
  178. {
  179. this.cmbTextQuery.Text = "";
  180. this.DictData.Clear();
  181. this.DictData = frm.DictDataArray;
  182. //this.PublicFunctionRows();
  183. ucPagerEx1.PageCurrent = 1;
  184. ucPagerEx1.Bind();
  185. }
  186. }
  187. /// <summary>
  188. /// 婚纱版
  189. /// </summary>
  190. /// <param name="sender"></param>
  191. /// <param name="e"></param>
  192. void chkDressVersion_Click( object sender, EventArgs e )
  193. {
  194. if ( this.chkDressVersion.Checked )
  195. {
  196. this.panelShowCompleteOrder.Visible = true;
  197. this.btnCustomerData.Visible = true;
  198. this.chkPortraitVersion.Checked = false;
  199. this.chkKidsVersion.Checked = false;
  200. this.chkServiceVersion.Checked = false;
  201. this.chkWeddingCelebration.Checked = false;
  202. }
  203. this.cmbTextQuery.Text = "";
  204. //this.PublicFunctionRows();
  205. ucPagerEx1.PageCurrent = 1;
  206. ucPagerEx1.Bind();
  207. }
  208. /// <summary>
  209. /// 儿童版
  210. /// </summary>
  211. /// <param name="sender"></param>
  212. /// <param name="e"></param>
  213. void chkKidsVersion_Click( object sender, EventArgs e )
  214. {
  215. if ( this.chkKidsVersion.Checked )
  216. {
  217. this.panelShowCompleteOrder.Visible = true;
  218. this.btnCustomerData.Visible = true;
  219. this.chkPortraitVersion.Checked = false;
  220. this.chkDressVersion.Checked = false;
  221. this.chkServiceVersion.Checked = false;
  222. this.chkWeddingCelebration.Checked = false;
  223. }
  224. this.cmbTextQuery.Text = "";
  225. //this.PublicFunctionRows();
  226. ucPagerEx1.PageCurrent = 1;
  227. ucPagerEx1.Bind();
  228. }
  229. /// <summary>
  230. /// 写真版
  231. /// </summary>
  232. /// <param name="sender"></param>
  233. /// <param name="e"></param>
  234. void chkPortraitVersion_Click( object sender, EventArgs e )
  235. {
  236. if ( this.chkPortraitVersion.Checked )
  237. {
  238. this.panelShowCompleteOrder.Visible = true;
  239. this.btnCustomerData.Visible = true;
  240. this.chkKidsVersion.Checked = false;
  241. this.chkDressVersion.Checked = false;
  242. this.chkServiceVersion.Checked = false;
  243. this.chkWeddingCelebration.Checked = false;
  244. }
  245. this.cmbTextQuery.Text = "";
  246. //this.PublicFunctionRows();
  247. ucPagerEx1.PageCurrent = 1;
  248. ucPagerEx1.Bind();
  249. }
  250. /// <summary>
  251. /// 婚庆
  252. /// </summary>
  253. /// <param name="sender"></param>
  254. /// <param name="e"></param>
  255. void chkWeddingCelebration_Click( object sender, EventArgs e )
  256. {
  257. if ( this.chkWeddingCelebration.Checked )
  258. {
  259. this.panelShowCompleteOrder.Visible = true;
  260. this.btnCustomerData.Visible = true;
  261. this.chkPortraitVersion.Checked = false;
  262. this.chkKidsVersion.Checked = false;
  263. this.chkDressVersion.Checked = false;
  264. this.chkServiceVersion.Checked = false;
  265. }
  266. this.cmbTextQuery.Text = "";
  267. //this.PublicFunctionRows();
  268. ucPagerEx1.PageCurrent = 1;
  269. ucPagerEx1.Bind();
  270. }
  271. /// <summary>
  272. /// 服务版
  273. /// </summary>
  274. /// <param name="sender"></param>
  275. /// <param name="e"></param>
  276. void chkServiceVersion_Click( object sender, EventArgs e )
  277. {
  278. this.chkShowCompleteOrder.Checked = false;
  279. if ( this.chkServiceVersion.Checked )
  280. {
  281. this.panelShowCompleteOrder.Visible = true;
  282. this.btnCustomerData.Visible = false;
  283. this.chkPortraitVersion.Checked = false;
  284. this.chkKidsVersion.Checked = false;
  285. this.chkDressVersion.Checked = false;
  286. this.chkWeddingCelebration.Checked = false;
  287. }
  288. this.cmbTextQuery.Text = "";
  289. //this.PublicFunctionRows();
  290. ucPagerEx1.PageCurrent = 1;
  291. ucPagerEx1.Bind();
  292. }
  293. /// <summary>
  294. /// 意向订单
  295. /// </summary>
  296. /// <param name="sender"></param>
  297. /// <param name="e"></param>
  298. void chkIntent_CheckedChanged( object sender, EventArgs e )
  299. {
  300. this.cmbTextQuery.Text = "";
  301. this.btnClientServiceAnPai.Visible = this.chkIntent.Checked;
  302. if ( this.chkIntent.Checked )
  303. {
  304. this.chkShowCompleteOrder.Checked = false;
  305. this.chkShowCompleteOrder.Enabled = false;
  306. }
  307. else
  308. {
  309. this.chkShowCompleteOrder.Enabled = true;
  310. }
  311. //this.PublicFunctionRows();
  312. ucPagerEx1.PageCurrent = 1;
  313. ucPagerEx1.Bind();
  314. }
  315. /// <summary>
  316. /// 显示已取订单
  317. /// </summary>
  318. /// <param name="sender"></param>
  319. /// <param name="e"></param>
  320. void chkShowCompleteOrder_Click( object sender, EventArgs e )
  321. {
  322. ucPagerEx1.PageCurrent = 1;
  323. ucPagerEx1.Bind();
  324. }
  325. /// <summary>
  326. /// 预约单
  327. /// </summary>
  328. /// <param name="sender"></param>
  329. /// <param name="e"></param>
  330. void btnReservation_Click( object sender, EventArgs e )
  331. {
  332. if ( this.dgvData.Rows.Count > 0 )
  333. {
  334. if ( this.dgvData.CurrentRow != null )
  335. {
  336. if ( this.dgvData.CurrentRow.Index >= 0 )
  337. {
  338. string OrdNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  339. frmContractManagement frmCManagement = new frmContractManagement();
  340. frmCManagement.OrdNumber = OrdNumber;
  341. frmCManagement.ShowDialog();
  342. }
  343. }
  344. else
  345. {
  346. MessageBoxCustom.Show( "请选择要操作的订单" );
  347. }
  348. }
  349. }
  350. /// <summary>
  351. /// 打开订单
  352. /// </summary>
  353. void openOrder()
  354. {
  355. if ( this.dgvData.Rows.Count > 0 )
  356. {
  357. if ( this.dgvData.CurrentRow != null )
  358. {
  359. if ( this.dgvData.CurrentRow.Index >= 0 )
  360. {
  361. Point p = this.Parent.PointToScreen( new Point( 0, 0 ) );
  362. p.Y += 2;
  363. string OrdNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  364. string OrdType = this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim();
  365. //DataTable dt = orbll.GetView_Custom("tb_ErpOrder", StrWhere: "Ord_Number = '" + OrdNumber + "'", ShowColumnName: "Ord_Type").Tables[0];
  366. EnumPublic.OrderType orderType = (LYFZ.EnumPublic.OrderType)Enum.Parse( typeof( LYFZ.EnumPublic.OrderType ), OrdType.Trim() );
  367. //#if DEBUG
  368. OpenNewOrder( orderType, OrdNumber );
  369. //#else
  370. //LYFZ.Software.MainBusiness.DoorCityProcess.OnSingleFormMain01 frm = new DoorCityProcess.OnSingleFormMain01();
  371. //frm.OrdType = orderType;
  372. //frm.IsUpdateOrderLoad = true;
  373. //frm.StrNumber = OrdNumber;
  374. //frm.IsShowUcNavigationTool = false;
  375. //frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  376. //frm.Location = p;
  377. //frm.Size = new Size(this.Width - 4, this.Height - 5);
  378. //frm.ShowDialog();
  379. //if (frm.IsSaveed)
  380. //{
  381. // ucPagerEx1.PageCurrent = 1;
  382. // ucPagerEx1.Bind();
  383. //}
  384. // #endif
  385. }
  386. }
  387. else { MessageBoxCustom.Show( "请选择要操作的订单" ); }
  388. }
  389. }
  390. void OpenNewOrder( EnumPublic.OrderType orderType, string _OrderNumber )
  391. {
  392. frmNewOrder newOrder = new frmNewOrder();
  393. newOrder.OrderNumber = _OrderNumber;
  394. newOrder.IsShowUcNavigationTool = false;
  395. newOrder.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  396. newOrder.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  397. newOrder.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
  398. newOrder.OrderType = orderType;
  399. newOrder.ShowDialog();
  400. if ( newOrder.IsSaveData )
  401. {
  402. ucPagerEx1.PageCurrent = 1;
  403. ucPagerEx1.Bind();
  404. }
  405. }
  406. /// <summary>
  407. /// 安排客服
  408. /// </summary>
  409. /// <param name="sender"></param>
  410. /// <param name="e"></param>
  411. void btnClientServiceAnPai_Click( object sender, EventArgs e )
  412. {
  413. if ( this.dgvData.SelectedRows.Count > 0 )
  414. {
  415. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm frm = new DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm();
  416. frm.ShowDialog();
  417. if ( frm.IsSaveed )
  418. {
  419. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ClientServiceAnPai( this.dgvData, LYFZ.EnumPublic.ClientServiceTaskType.意向跟踪, frm.model, LYFZ.EnumPublic.ClientServiceTaskItem.订单意向 );
  420. }
  421. }
  422. }
  423. /// <summary>
  424. /// 列表双击事件
  425. /// </summary>
  426. /// <param name="sender"></param>
  427. /// <param name="e"></param>
  428. void dgvData_CellMouseDoubleClick( object sender, DataGridViewCellMouseEventArgs e )
  429. {
  430. if ( this.dgvData.Rows.Count > 0 )
  431. {
  432. if ( e.RowIndex != -1 && e.ColumnIndex != -1 )
  433. {
  434. this.openOrder();
  435. }
  436. }
  437. }
  438. /// <summary>
  439. /// 列表单击事件
  440. /// </summary>
  441. /// <param name="sender"></param>
  442. /// <param name="e"></param>
  443. void dgvData_CellClick( object sender, DataGridViewCellEventArgs e )
  444. {
  445. try
  446. {
  447. string StrNumber = this.dgvData.CurrentRow.Cells["订单号"].Value.ToString().Trim();
  448. if ( string.IsNullOrEmpty( StrNumber ) || StrNumber.Trim() == "(取件OK)" )
  449. {
  450. bool IsFind = false;
  451. int i = this.dgvData.CurrentRow.Index;
  452. while ( !IsFind )
  453. {
  454. i = i - 1;
  455. if ( !string.IsNullOrEmpty( this.dgvData.Rows[i].Cells["订单号"].Value.ToString().Trim() ) )
  456. {
  457. StrNumber = this.dgvData.Rows[i].Cells["订单号"].Value.ToString().Trim(); IsFind = true;
  458. }
  459. }
  460. }
  461. LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = StrNumber;
  462. }
  463. catch
  464. {
  465. }
  466. }
  467. /// <summary>
  468. /// 对列表控件双击事件
  469. /// </summary>
  470. /// <param name="sender"></param>
  471. /// <param name="e"></param>
  472. void dgvData_MouseDoubleClick( object sender, MouseEventArgs e )
  473. {
  474. Point hit = this.dgvData.PointToClient( Cursor.Position );
  475. DataGridView.HitTestInfo hitTest = this.dgvData.HitTest( hit.X, hit.Y );
  476. if ( hitTest.RowIndex < 0 && hitTest.ColumnIndex < 0 )
  477. {
  478. if ( !string.IsNullOrEmpty( this.cmbTextQuery.Text.Trim() ) )
  479. {
  480. LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = "";
  481. this.cmbTextQuery.Text = "";
  482. //this.PublicFunctionRows();
  483. ucPagerEx1.Bind();
  484. }
  485. }
  486. }
  487. /// <summary>
  488. /// 客户资料
  489. /// </summary>
  490. /// <param name="sender"></param>
  491. /// <param name="e"></param>
  492. void btnCustomerData_Click( object sender, EventArgs e )
  493. {
  494. if ( this.dgvData.Rows.Count > 0 )
  495. {
  496. if ( this.dgvData.CurrentRow.Index >= 0 )
  497. {
  498. string OrdNumber = this.dgvData.Rows[this.dgvData.CurrentRow.Index].Cells["Ord_Number"].Value.ToString().Trim();
  499. if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( EnumPublic.OrderType.儿童订单 ).ToString().Trim() )
  500. {
  501. LYFZ.Software.MainBusiness.Customers.FrmOldCustomerRecordBaby frm = new Customers.FrmOldCustomerRecordBaby();
  502. frm.Theorderno = OrdNumber;
  503. frm.ShowDialog();
  504. if ( frm.IsSaved )
  505. {
  506. //this.PublicFunctionRows();
  507. ucPagerEx1.Bind();
  508. }
  509. }
  510. else
  511. {
  512. LYFZ.Software.MainBusiness.Customers.FrmOldCustomerRecord frm = new Customers.FrmOldCustomerRecord();
  513. frm.Theorderno = OrdNumber;
  514. frm.ShowDialog();
  515. if ( frm.IsSaved )
  516. {
  517. //this.PublicFunctionRows();
  518. ucPagerEx1.Bind();
  519. }
  520. }
  521. }
  522. }
  523. }
  524. /// <summary>
  525. /// 导出
  526. /// </summary>
  527. /// <param name="sender"></param>
  528. /// <param name="e"></param>
  529. void btnExport_Click( object sender, EventArgs e )
  530. {
  531. if ( this.dgvData.Rows.Count > 0 )
  532. {
  533. if ( this.dgvData.CurrentRow.Index >= 0 )
  534. {
  535. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.OrderReportExportOptionsSuperSmallForm frm = new SuperSmallForm.OrderReportExportOptionsSuperSmallForm();
  536. frm.ShowDialog();
  537. if ( frm.IsSaveed )
  538. {
  539. try
  540. {
  541. if ( !frm.isExportPhotograph )
  542. {
  543. if ( frm.IsExportCurrent )
  544. {
  545. this.dgvData.ExportDataTable( StrFileName: "订单报表" );
  546. }
  547. else
  548. {
  549. Dictionary<string, string> dictColumns = new Dictionary<string, string>();
  550. Hashtable htData = this.PublicFunctionData( -1, ref dictColumns );
  551. DataTable newTable = (DataTable)htData["DataTable"];
  552. SaveFileDialog saveFile = new SaveFileDialog();
  553. saveFile.FileName = "订单报表";
  554. saveFile.Title = "导出数据报表文件";
  555. saveFile.Filter = "EXECL文件(*.xls) |*.xls |文本文件(*.txt) |*.txt |所有文件(*.*) |*.*";
  556. saveFile.FilterIndex = 1;
  557. DialogResult drst = saveFile.ShowDialog();
  558. if ( drst == DialogResult.No || drst == DialogResult.Cancel || drst == DialogResult.No || drst == DialogResult.Abort )
  559. {
  560. return;
  561. }
  562. newTable.Columns.Remove( "Ord_Number" );
  563. newTable.Columns.Remove( "Ordv_ViceNumber" );
  564. newTable.Columns.Remove( "Ord_Type" );
  565. LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod( delegate ( object obj, System.ComponentModel.BackgroundWorker backgroundWorker )
  566. {
  567. try
  568. {
  569. if ( LYFZ.WinAPI.CustomPublicMethod.DataGridViewToExcel( saveFile.FileName.Trim(), newTable, null, backgroundWorker ) )
  570. {
  571. MessageBoxCustom.Show( "数据导出成功!" );
  572. }
  573. else
  574. {
  575. MessageBoxCustom.Show( "数据导出失败!" );
  576. }
  577. }
  578. catch ( Exception ex )
  579. {
  580. MessageBoxCustom.Show( String.Format( "导出数据出错:{0}", ex.Message ) );
  581. }
  582. } );
  583. //if ( LYFZ.Command.Command_ExportExcel.DataTable2Sheet(saveFile.FileName.Trim(), newTable, "Sheet1", IsCoveredExistingFile: true))
  584. //{ MessageBoxCustom.Show("导出成功!"); }
  585. //else
  586. //{ MessageBoxCustom.Show("导出失败!"); }
  587. }
  588. }
  589. else
  590. {
  591. Dictionary<string, string> dictColumns = new Dictionary<string, string>();
  592. DataTable newTable = GetExportReportData( 100, ref dictColumns );
  593. SaveFileDialog saveFile = new SaveFileDialog();
  594. saveFile.FileName = "订单报表";
  595. saveFile.Title = "导出数据报表文件";
  596. saveFile.Filter = "EXECL文件(*.xls) |*.xls |文本文件(*.txt) |*.txt |所有文件(*.*) |*.*";
  597. saveFile.FilterIndex = 1;
  598. DialogResult drst = saveFile.ShowDialog();
  599. if ( drst == DialogResult.No || drst == DialogResult.Cancel || drst == DialogResult.No || drst == DialogResult.Abort )
  600. {
  601. return;
  602. }
  603. newTable.Columns.Remove( "Ord_Number" );
  604. newTable.Columns.Remove( "Ordv_ViceNumber" );
  605. newTable.Columns.Remove( "Ord_Type" );
  606. LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod( delegate ( object obj, System.ComponentModel.BackgroundWorker backgroundWorker )
  607. {
  608. try
  609. {
  610. if ( LYFZ.WinAPI.CustomPublicMethod.DataGridViewToExcel( saveFile.FileName.Trim(), newTable, null, backgroundWorker ) )
  611. {
  612. MessageBoxCustom.Show( "数据导出成功!" );
  613. }
  614. else
  615. {
  616. MessageBoxCustom.Show( "数据导出失败!" );
  617. }
  618. }
  619. catch ( Exception ex )
  620. {
  621. MessageBoxCustom.Show( String.Format( "导出数据出错:{0}", ex.Message ) );
  622. }
  623. } );
  624. //if (LYFZ.Command.Command_ExportExcel.DataTable2Sheet(saveFile.FileName.Trim(), newTable, "Sheet1", IsCoveredExistingFile: true))
  625. //{ MessageBoxCustom.Show("导出成功!"); }
  626. //else
  627. //{ MessageBoxCustom.Show("导出失败!"); }
  628. }
  629. }
  630. catch ( Exception ex )
  631. {
  632. MessageBoxCustom.Show( "导出失败:" + ex.Message );
  633. }
  634. }
  635. }
  636. }
  637. }
  638. /// <summary>
  639. /// 删除
  640. /// </summary>
  641. /// <param name="sender"></param>
  642. /// <param name="e"></param>
  643. void btnDelete_Click( object sender, EventArgs e )
  644. {
  645. if ( this.dgvData.Rows.Count > 0 )
  646. {
  647. if ( this.dgvData.CurrentRow.Index >= 0 )
  648. {
  649. List<CommandInfo> clist = new List<CommandInfo>();
  650. string Ord_Number = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString();
  651. string Ordv_ViceNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString();
  652. 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];
  653. DateTime strTime = SDateTime.Now;
  654. if ( tbl.Rows.Count > 0 )
  655. {
  656. string Ordv_TypeString = Enum.Parse( typeof( LYFZ.EnumPublic.OrderType ), this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() ).ToString().Trim();
  657. string StrCustomerGroup = "";
  658. //if (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Account.ToLower() != LYFZ.AuthorizeUserName.AdministratorsName)
  659. //{
  660. if ( Convert.ToDecimal( tbl.Rows[0]["Ord_OrderArrears"] ) < Convert.ToDecimal( tbl.Rows[0]["Ord_SeriesPrice"] ) )
  661. {
  662. MessageBoxCustom.Show( "此订单已有付款记录,不能删除订单!" ); return;
  663. }
  664. //}
  665. if ( Ordv_ViceNumber != "" )
  666. {
  667. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Account.ToLower() != LYFZ.AuthorizeUserName.AdministratorsName )
  668. {
  669. DataTable tbl2 = orbll.GetView_Custom( "tb_ErpOrdersPhotography", StrWhere: "Ordpg_ViceNumber = '" + Ordv_ViceNumber + "' and Ordpg_PhotographyStatus= '1'", ShowColumnName: "Ordpg_PhotographyStatus" ).Tables[0];
  670. if ( tbl2.Rows.Count > 0 )
  671. {
  672. MessageBoxCustom.Show( "此订单已有景点已拍照OK,不能删除订单!" ); return;
  673. }
  674. }
  675. clist.Add( klbll.GetDeleteCommandInfo( "kp_OrderNumber", "=", Ordv_ViceNumber ) );//刻盘记录表
  676. clist.Add( ppbll.GetDeleteCommandInfo( "Opps_OrderNumber", "=", Ordv_ViceNumber ) );//相片冲印表
  677. clist.Add( plbll.GetDeleteCommandInfo( "OPlist_ViceNumber", "=", Ordv_ViceNumber ) );//订单商品表
  678. clist.Add( opbll.GetDeleteCommandInfo( "Ordpg_ViceNumber", "=", Ordv_ViceNumber ) );//拍摄景点表
  679. clist.Add( odbll.GetDeleteCommandInfo( "Ordv_ViceNumber", "=", Ordv_ViceNumber ) );//副订单
  680. clist.Add( ordsbll.GetDeleteCommandInfo( "Ords_ViceNumber", "=", Ordv_ViceNumber ) );//副订单
  681. }
  682. DataTable tbl3 = orbll.GetView_Custom( "tb_ErpOrderDigital", StrWhere: "Ordv_Number = '" + Ord_Number + "'", ShowColumnName: "Ordv_ViceNumber" ).Tables[0];
  683. if ( tbl3.Rows.Count == 1 )
  684. {
  685. clist.Add( lgbll.GetDeleteCommandInfo( "Ordplg_OrderNumber", "=", Ord_Number ) );//订单商品操作记录表
  686. clist.Add( plbll.GetDeleteCommandInfo( "OPlist_OrderNumber", "=", Ord_Number ) );//订单商品表
  687. clist.Add( wsbll.GetDeleteCommandInfo( "Ws_Number", "=", Ord_Number ) );//订单服务表
  688. clist.Add( pnbll.GetDeleteCommandInfo( "OrdPe_OrderNumber", "=", Ord_Number ) );//订单人表
  689. clist.Add( ptbll.GetDeleteCommandInfo( "Pay_OrdNumber", "=", Ord_Number ) );//订单收款
  690. clist.Add( pibll.GetDeleteCommandInfo( "Plu_OrdNumber", "=", Ord_Number ) );//收款商品表
  691. clist.Add( prbll.GetDeleteCommandInfo( "Pcr_OrderNumber", "=", Ord_Number ) );//计件提成记录
  692. clist.Add( tobll.GetDeleteCommandInfo( "Tsorder_Number", "=", Ord_Number ) );//二销订单
  693. clist.Add( orbll.GetDeleteCommandInfo( "Ord_Number", "=", Ord_Number ) );//主订单
  694. LYFZ.Model.Model_ErpCustomerGroup modelClient = ctgpbll.GetModel( "GP_OrderNumber", Ord_Number );
  695. StrCustomerGroup = modelClient.GP_CustomerGroupID;
  696. clist.Add( ctgpbll.GetDeleteCommandInfo( "ID", "=", modelClient.ID ) );
  697. clist.Add( ctgmbll.GetDeleteCommandInfo( "GM_CustomerGroupID", "=", modelClient.GP_CustomerGroupID ) );
  698. }
  699. else if ( tbl.Rows[0]["Ord_Class"].ToString().Trim() == "0" )
  700. {
  701. if ( tbl.Rows.Count == 1 )
  702. {
  703. clist.Add( orbll.GetDeleteCommandInfo( "Ord_Number", "=", Ord_Number ) );
  704. }//主订单
  705. LYFZ.Model.Model_ErpCustomerGroup modelClient = ctgpbll.GetModel( "GP_OrderNumber", Ord_Number );
  706. clist.Add( ctgpbll.GetDeleteCommandInfo( "ID", "=", modelClient.ID ) );
  707. clist.Add( ctgmbll.GetDeleteCommandInfo( "GM_CustomerGroupID", "=", modelClient.GP_CustomerGroupID ) );
  708. }
  709. string StrUserName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
  710. string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  711. string StrUserIP = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.User_IP;
  712. string StrContent = "[删除订单] 主订单号为:" + Ord_Number + ",订单类型:" + Ordv_TypeString + ",数码订单号为:" + Ordv_ViceNumber;
  713. clist.Add( new LYFZ.BLL.BLL_ErpSystemLogs().GetAddCommandInfo( LYFZ.BLL.BLL_ErpSystemLogs.GetWriteLogModel( LYFZ.EnumPublic.SystemLogsType.删除订单, StrContent, StrUserID, StrUserName, StrUserIP ) ) );
  714. clist.Add( new BLL.BLL_ErpACVBSYS().GetAddCommandInfo( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetModelLog( LYFZ.EnumPublic.SystemLogsType.删除订单.ToString(), StrContent, "", strTime ) ) );
  715. if ( clist.Count > 0 )
  716. {
  717. if ( MessageBoxCustom.Show( "警告!此单相关资料将全部被删除?您确定吗?", "警告提示", MessageBoxButtons.YesNo ) == DialogResult.Yes )
  718. {
  719. if ( LYFZ.BLL.BaseBllOperate.ExecuteSqlTran( clist ) > 0 )
  720. {
  721. MessageBoxCustom.Show( "订单删除成功" );
  722. //this.dgvData.Rows.RemoveAt(this.dgvData.CurrentRow.Index);
  723. //更新客户组成员表
  724. if ( !string.IsNullOrEmpty( StrCustomerGroup ) )
  725. {
  726. LYFZ.DAL.DAL_ErpCustomer.UpdateAggregationCustomer( StrCustomerGroup );
  727. }
  728. else
  729. {
  730. LYFZ.DAL.DAL_ErpCustomer.UpdateAggregationCustomer( Ord_Number );
  731. }
  732. // this.PublicFunctionRows();
  733. ucPagerEx1.Bind();
  734. return;
  735. }
  736. else
  737. {
  738. MessageBoxCustom.Show( "订单删除失败" ); return;
  739. }
  740. }
  741. }
  742. }
  743. }
  744. else
  745. {
  746. MessageBoxCustom.Show( "请选择你要删除的订单!" );
  747. }
  748. }
  749. }
  750. public struct ScenicSpot
  751. {
  752. // 景点名称或成长次名称;
  753. public string strScenicName;
  754. // 副订单号,既儿童成长次单号;
  755. public string strViceNumber;
  756. // 景点或成长的选片状态;
  757. public string strSelectPhotoStatus;
  758. };
  759. /// <summary>
  760. /// 打印
  761. /// </summary>
  762. /// <param name="sender"></param>
  763. /// <param name="e"></param>
  764. void btnPrint_Click( object sender, EventArgs e )
  765. {
  766. if ( this.dgvData.Rows.Count > 0 )
  767. {
  768. if ( this.dgvData.CurrentRow != null )
  769. {
  770. if ( this.dgvData.CurrentRow.Index >= 0 )
  771. {
  772. #if IGNORE
  773. Hashtable htData = new Hashtable();
  774. // 订单号;
  775. htData["strNumber"] = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  776. // 订单类型;
  777. htData["strOrdType"] = Enum.Parse(typeof(LYFZ.EnumPublic.OrderType), this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim()).ToString().Trim();
  778. LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.订单预约单, htData);
  779. #else
  780. if ( Enum.Parse( typeof( LYFZ.EnumPublic.OrderType ), this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() ).ToString().Trim() == "儿童订单" )
  781. { // 儿童版,弹出对话框,选择要打印的次数;
  782. Hashtable htData = new Hashtable();
  783. // 订单号;
  784. htData["strNumber"] = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  785. // 订单类型;
  786. htData["strOrdType"] = Enum.Parse( typeof( LYFZ.EnumPublic.OrderType ), this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() ).ToString().Trim();
  787. // 当前订单号;
  788. List<ScenicSpot> listScenicSpot = new List<ScenicSpot>();
  789. string strOrderNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  790. int nIndex = this.dgvData.CurrentRow.Index;
  791. while ( --nIndex > -1 )
  792. {
  793. if ( strOrderNumber == this.dgvData.Rows[nIndex].Cells["Ord_Number"].Value.ToString().Trim() )
  794. {
  795. listScenicSpot.Add( new ScenicSpot
  796. {
  797. strScenicName = this.dgvData.Rows[nIndex].Cells["拍摄名称"].Value.ToString().Trim(),
  798. strViceNumber = this.dgvData.Rows[nIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim(),
  799. strSelectPhotoStatus = this.dgvData.Rows[nIndex].Cells["选片状态"].Value.ToString().Trim()
  800. } );
  801. }
  802. else
  803. {
  804. break;
  805. }
  806. }
  807. nIndex = this.dgvData.CurrentRow.Index;
  808. listScenicSpot.Add( new ScenicSpot
  809. {
  810. strScenicName = this.dgvData.Rows[nIndex].Cells["拍摄名称"].Value.ToString().Trim(),
  811. strViceNumber = this.dgvData.Rows[nIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim(),
  812. strSelectPhotoStatus = this.dgvData.Rows[nIndex].Cells["选片状态"].Value.ToString().Trim()
  813. } );
  814. while ( ++nIndex < this.dgvData.Rows.Count )
  815. {
  816. if ( strOrderNumber == this.dgvData.Rows[nIndex].Cells["Ord_Number"].Value.ToString().Trim() )
  817. {
  818. listScenicSpot.Add( new ScenicSpot
  819. {
  820. strScenicName = this.dgvData.Rows[nIndex].Cells["拍摄名称"].Value.ToString().Trim(),
  821. strViceNumber = this.dgvData.Rows[nIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim(),
  822. strSelectPhotoStatus = this.dgvData.Rows[nIndex].Cells["选片状态"].Value.ToString().Trim()
  823. } );
  824. }
  825. else
  826. {
  827. break;
  828. }
  829. }
  830. // 弹出选择框;
  831. frmChooseScenicToPrint dlg = new frmChooseScenicToPrint( LYFZ.EnumPublic.PrintTypeEnum.订单预约单, htData, listScenicSpot, false );
  832. dlg.ShowDialog();
  833. }
  834. else
  835. {// 非儿童订单;
  836. Hashtable htData = new Hashtable();
  837. // 订单号;
  838. htData["strNumber"] = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  839. // 订单类型;
  840. htData["strOrdType"] = Enum.Parse( typeof( LYFZ.EnumPublic.OrderType ), this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() ).ToString().Trim();
  841. LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat( LYFZ.EnumPublic.PrintTypeEnum.订单预约单, htData, null, false );
  842. }
  843. #endif
  844. return;
  845. }
  846. }
  847. MessageBoxCustom.Show( "请选择订单" );
  848. }
  849. }
  850. /// <summary>
  851. /// 关闭
  852. /// </summary>
  853. /// <param name="sender"></param>
  854. /// <param name="e"></param>
  855. void btnClose_Click( object sender, EventArgs e )
  856. {
  857. this.Close();
  858. }
  859. /// <summary>
  860. /// 窗体大小发生改变事件
  861. /// </summary>
  862. /// <param name="sender"></param>
  863. /// <param name="e"></param>
  864. void OrderReportFormMain_Resize( object sender, EventArgs e )
  865. {
  866. if ( !this.IsFirstRun )
  867. {
  868. switch ( this.panelShowCompleteOrder.Location.Y )
  869. {
  870. case 4:
  871. this.flowLayoutPanel1.Height = 37;
  872. break;
  873. case 36:
  874. this.flowLayoutPanel1.Height = 68;
  875. break;
  876. case 68:
  877. this.flowLayoutPanel1.Height = 98;
  878. break;
  879. }
  880. }
  881. }
  882. /// <summary>
  883. /// 右键菜单
  884. /// </summary>
  885. /// <param name="sender"></param>
  886. /// <param name="e"></param>
  887. void dgvData_CellMouseDown( object sender, DataGridViewCellMouseEventArgs e )
  888. {
  889. if ( e.Button == MouseButtons.Right )
  890. {
  891. if ( e.RowIndex >= 0 && e.ColumnIndex >= 0 )
  892. {
  893. ToolStripMenuItem item = new ToolStripMenuItem();
  894. Hashtable htData = new Hashtable();
  895. htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
  896. htData["StrViceNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  897. item.Text = "订单备注";
  898. item.Tag = htData;
  899. item.Name = "OrderRemark";
  900. this.dgvData.conMenu.Items.Add( item );
  901. // this.dgvData.conMenu.Show( MousePosition.X, MousePosition.Y );//弹出操作菜单
  902. this.dgvData.conMenu.ItemClicked -= dgvData_DataGridViewConMenu_ItemClicked;
  903. this.dgvData.conMenu.ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
  904. //this.dgvData.conMenu.Show();
  905. if (!this.dgvData.conMenu.Visible)
  906. {
  907. this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
  908. }
  909. }
  910. else
  911. {
  912. this.dgvData.conMenu.Items.Clear();
  913. ToolStripMenuItem item = new ToolStripMenuItem();
  914. item.Text = "设置标题";
  915. item.Tag = "SetColumnShow";
  916. item.Name = "SetColumnShow";
  917. this.dgvData.conMenu.Items.Add( item );
  918. // this.dgvData.conMenu.Show( MousePosition.X, MousePosition.Y );//弹出操作菜单
  919. this.dgvData.conMenu.ItemClicked -= dgvData_DataGridViewConMenu_ItemClicked;
  920. this.dgvData.conMenu.ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
  921. // this.dgvData.conMenu.Show();
  922. if (!this.dgvData.conMenu.Visible)
  923. {
  924. this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
  925. }
  926. }
  927. }
  928. }
  929. /// <summary>
  930. /// 右键菜单选择项事件
  931. /// </summary>
  932. /// <param name="sender"></param>
  933. /// <param name="e"></param>
  934. void dgvData_DataGridViewConMenu_ItemClicked( object sender, ToolStripItemClickedEventArgs e )
  935. {
  936. ToolStripItem item = e.ClickedItem;
  937. if ( item.Name.Trim() == "SetColumnShow" )
  938. {
  939. if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ShowDataGridViewSetColumn( this.dgvData ) )
  940. {
  941. //this.PublicFunctionRows();
  942. ucPagerEx1.Bind();
  943. }
  944. }
  945. else if ( item.Name.ToString().Trim() == "OrderRemark" )
  946. {
  947. Hashtable htData = (Hashtable)item.Tag;
  948. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OrderRemarkRecordAddSuperSmallForm frm = new DoorCityProcess.SuperSmallForm.OrderRemarkRecordAddSuperSmallForm();
  949. frm.StrOrderNumber = htData["StrNumber"].ToString().Trim();
  950. frm.StrOrdViceNumber = htData["StrViceNumber"].ToString().Trim();
  951. frm.StrOrdModuleName = "";
  952. frm.ShowDialog();
  953. }
  954. }
  955. /// <summary>
  956. /// 点击列标头排序
  957. /// </summary>
  958. /// <param name="sender"></param>
  959. /// <param name="e"></param>
  960. void dgvData_ColumnHeaderMouseClick( object sender, DataGridViewCellMouseEventArgs e )
  961. {
  962. if ( e.Button == MouseButtons.Left )
  963. {
  964. string StrColumnName = this.dgvData.Columns[e.ColumnIndex].Name.Trim();
  965. if ( StrColumnName == this.StrCurrentClickField || this.dgvData.StrValueNullColumn.Trim().IndexOf( StrColumnName ) != -1 || string.IsNullOrEmpty( this.StrCurrentClickField ) )
  966. {
  967. if ( this.StrSortOrder == "ASC" )
  968. {
  969. this.StrSortOrder = "DESC";
  970. }
  971. else
  972. {
  973. this.StrSortOrder = "ASC";
  974. }
  975. }
  976. else
  977. {
  978. this.StrSortOrder = "DESC";
  979. }
  980. if ( this.dgvData.StrValueNullColumn.Trim().IndexOf( StrColumnName ) == -1 || StrColumnName.Trim() == "套系金额" )
  981. {
  982. this.StrSortField = StrColumnName + " " + this.StrSortOrder + ",Ord_CreateDateTime";
  983. }
  984. else
  985. {
  986. this.StrSortField = "Ord_CreateDateTime " + this.StrSortOrder;
  987. }
  988. this.StrCurrentClickField = StrColumnName;
  989. //this.PublicFunctionRows();
  990. ucPagerEx1.Bind();
  991. }
  992. }
  993. public void BindPageData( int pageIndx, int pageSize, int totalCount )
  994. {
  995. ucPagerEx1.NMax = totalCount;
  996. ucPagerEx1.CurrentPageCount = (pageSize);
  997. ucPagerEx1.PageCurrent = pageIndx;
  998. }
  999. /// <summary>
  1000. /// 当前点击的字段
  1001. /// </summary>
  1002. string StrCurrentClickField = "";
  1003. /// <summary>
  1004. /// 排序字段
  1005. /// </summary>
  1006. string StrSortField = "Ord_CreateDateTime DESC";
  1007. /// <summary>
  1008. /// 排序顺序
  1009. /// </summary>
  1010. string StrSortOrder = "DESC";
  1011. /// <summary>
  1012. /// 创建行
  1013. /// </summary>
  1014. void PublicFunctionRows()
  1015. {
  1016. // List<double> doubleList = new List<double>();
  1017. //System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
  1018. //stopwatch.Start();
  1019. double lastSecond = 0;
  1020. Dictionary<string, string> dictColumns = new Dictionary<string, string>();
  1021. int intTopCount = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPageSize();
  1022. //System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
  1023. //stopwatch.Start();
  1024. Hashtable htData = this.PublicFunctionDataNew( ucPagerEx1.PageCurrent, ucPagerEx1.PageSize, ref dictColumns );//this.PublicFunctionData(intTopCount, ref dictColumns);
  1025. //lastSecond = stopwatch.Elapsed.TotalSeconds;
  1026. //stopwatch.Stop();
  1027. new System.Threading.Thread( new System.Threading.ParameterizedThreadStart( SetDataGridViewPage ) ).Start( htData );
  1028. //this.dgvData.DataColumns(string.Join(",", dictColumns.Keys.ToArray()), strHideField: this.dgvData.dgvFixedHideColumn);
  1029. if ( dgvData.Columns.Contains( "客户姓名" ) )
  1030. {
  1031. this.dgvData.Columns["客户姓名"].Frozen = true;
  1032. }
  1033. //stopwatch.Stop();
  1034. //MessageBoxCustom.Show(stopwatch.Elapsed.ToString());
  1035. }
  1036. void SetDataGridViewPage( object _htData )
  1037. {
  1038. Hashtable htData = (Hashtable)_htData;
  1039. if ( !string.IsNullOrEmpty( htData["PageSql"].ToString() ) )
  1040. {
  1041. try
  1042. {
  1043. //(htData["PageSql"].ToString())
  1044. DataTable dtCount = orbll.DAL.GetViewDataSetByCustomer(htData["PageSql"].ToString()).Tables[0];
  1045. htData["CurrentCount"] =
  1046. Convert.ToInt32((Convert.ToInt32(dtCount.Rows[0][0]) - (ucPagerEx1.PageCurrent) * ucPagerEx1.PageSize) > ucPagerEx1.PageSize ?
  1047. ucPagerEx1.PageSize :
  1048. (Convert.ToInt32(dtCount.Rows[0][0]) - (ucPagerEx1.PageCurrent) * ucPagerEx1.PageSize));
  1049. BindPageData(ucPagerEx1.PageCurrent, Convert.ToInt32(htData["CurrentCount"]), Convert.ToInt32(dtCount.Rows[0][0]));
  1050. this.dataGridViewStatisticsCount1.LocationX = this.dgvData.RowHeadersWidth;
  1051. this.dataGridViewStatisticsCount1.CurrenQuantity = Convert.ToInt32(htData["CurrentCount"]);
  1052. this.dataGridViewStatisticsCount1.TotalQuantity = Convert.ToInt32(dtCount.Rows[0][0]);
  1053. ucPagerEx1.SetPageControlData(Convert.ToInt32(htData["TotalPage"]));
  1054. }
  1055. catch {
  1056. }
  1057. }
  1058. //ucPagerEx1.Bind();
  1059. }
  1060. /// <summary>
  1061. /// 获取要导出的数据
  1062. /// </summary>
  1063. /// <param name="intTopCount">要获取的条数</param>
  1064. /// <param name="dictColumns">当显示的列标题</param>
  1065. /// <returns></returns>
  1066. Hashtable PublicFunctionDataNew( int pageIndex, int pageSize, ref Dictionary<string, string> dictColumns )
  1067. {
  1068. string StrGuidName = "";
  1069. string StrFieldName = "";
  1070. if ( this.chkServiceVersion.Checked )
  1071. {
  1072. StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0033.ToString().Trim();
  1073. this.dgvData.StrValueNullColumn = "订单号,客户区域,客户地址,客户姓名,客户性别,客户电话,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系价格,接单人,备注,录入员,下单日期,会员卡号,客户QQ";
  1074. StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系价格,接单人,服务名称,数量,服务状态,服务时间,服务人员1,服务人员2,备注,录入员,下单日期,会员卡号,客户QQ,客户地址";
  1075. }
  1076. else if ( this.chkWeddingCelebration.Checked )
  1077. {
  1078. StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0034.ToString().Trim();
  1079. this.dgvData.StrValueNullColumn = "订单号,客户区域,客户地址,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态";
  1080. StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态,客户地址";
  1081. }
  1082. else
  1083. {
  1084. StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0010.ToString().Trim();
  1085. this.dgvData.StrValueNullColumn = "订单号,订单类型,客户区域,客户地址,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,套系类别,客户来源,套系名称,套系价格,接单人,订单类别,会员卡号,客户QQ,下单日期,录入员,备注";
  1086. StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,拍摄名称,摄影师,化妆师,引导师,拍摄时间,拍照状态,初修师,初修时间,初修状态,选片师,选片时间,选片状态,设计师,设计时间,设计状态,精修师,精修时间,精修状态,看版师,看版时间,看版状态,看版要求,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态,客户地址";
  1087. }
  1088. this.dgvData.dgvCurrentColumnOriginalSet = StrFieldName;
  1089. this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type";
  1090. this.dgvData.dgvGuidName = StrGuidName;
  1091. this.dgvData.dgvUserEmployeeID = this.StrUserID;
  1092. this.dgvData.DataColumns( this.dgvData.dgvCurrentColumnOriginalSet, strHideField: this.dgvData.dgvFixedHideColumn );
  1093. dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns( this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet );
  1094. if ( LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns( dictColumns ).IndexOf( this.dgvData.dgvFixedHideColumn ) == -1 )
  1095. {
  1096. if ( LYFZ.DAL.DAL_GridViewDisplayIndex.UpdateGridViewDisplayIndexModel( this.StrUserID, StrGuidName, LYFZ.DAL.DAL_GridViewDisplayIndex.UpdateGridViewDisplayIndexModel( StrFieldName ), LYFZ.DAL.DAL_GridViewDisplayIndex.StrVersionNumber ) )
  1097. {
  1098. this.PublicFunctionDataNew( pageIndex, pageSize, ref dictColumns );
  1099. }
  1100. else
  1101. {
  1102. if ( LYFZ.DAL.DAL_GridViewDisplayIndex.DeleteGridViewDisplayIndexModel( this.StrUserID, StrGuidName ) )
  1103. {
  1104. this.PublicFunctionDataNew( pageIndex, pageSize, ref dictColumns );
  1105. }
  1106. else
  1107. {
  1108. return null;
  1109. }
  1110. }
  1111. }
  1112. if ( (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.MemberCardShowHide) )
  1113. {
  1114. this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type,会员卡号";
  1115. }
  1116. this.dgvData.dictShowColumName = dictColumns;
  1117. Dictionary<string, string> dicWhere = new Dictionary<string, string>();
  1118. if ( IsFirstRun && !string.IsNullOrEmpty( LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber ) )
  1119. {
  1120. string StrWhere = " Where = '" + LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber + "'";
  1121. dicWhere.Add( "Ord_SinceOrderNumber", " in ('" + LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber + "') " );
  1122. this.cmbTextQuery.Text = LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber;
  1123. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhereByDataList( this.cmbtreevStoreName, "Ord_DividedShop", ref dicWhere );
  1124. }
  1125. else
  1126. {
  1127. this.GetWhereStr( ref dicWhere );
  1128. }
  1129. Hashtable htData = new Hashtable();
  1130. //DataTable newTable = new DataTable();
  1131. //if (this.chkServiceVersion.Checked)
  1132. //{
  1133. // if (this.StrSortField.Trim().IndexOf("Ordv_DigitalNumber") != -1)
  1134. // { this.StrSortField = this.StrSortField.Trim().Replace(",Ordv_DigitalNumber", ""); }
  1135. // else if (this.StrSortField.Trim().IndexOf("tb_ErpWeddingService.ID") == -1)
  1136. // { this.StrSortField += ",tb_ErpWeddingService.ID"; }
  1137. // htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderReportService(dictColumns, StrQueryCondition, intTopCount, this.StrSortField);
  1138. //}
  1139. //else
  1140. //{
  1141. // if (this.StrSortField.Trim().IndexOf("tb_ErpWeddingService.ID") != -1)
  1142. // { this.StrSortField = this.StrSortField.Trim().Replace(",tb_ErpWeddingService.ID", ""); }
  1143. // else if (this.StrSortField.Trim().IndexOf("Ordv_DigitalNumber") == -1)
  1144. // { this.StrSortField += ",Ordv_DigitalNumber"; }
  1145. // bool IschkWeddingCelebration = this.chkWeddingCelebration.Checked;
  1146. // htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderReport(dictColumns, StrQueryCondition, intTopCount, this.StrSortField, IschkWeddingCelebration);
  1147. //}
  1148. //System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
  1149. //stopwatch.Start();
  1150. htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderReportNew( dictColumns, pageIndex, pageSize, false, false, dicWhere, this.dgvData, this.StrCurrentClickField, StrSortOrder );
  1151. //stopwatch.Stop();
  1152. //MessageBoxCustom.Show(stopwatch.Elapsed.ToString_s());
  1153. return htData;
  1154. }
  1155. /// <summary>
  1156. /// 获取要导出的数据
  1157. /// </summary>
  1158. /// <param name="intTopCount">要获取的条数</param>
  1159. /// <param name="dictColumns">当显示的列标题</param>
  1160. /// <returns></returns>
  1161. Hashtable PublicFunctionData( int intTopCount, ref Dictionary<string, string> dictColumns )
  1162. {
  1163. string StrGuidName = "";
  1164. string StrFieldName = "";
  1165. if ( this.chkServiceVersion.Checked )
  1166. {
  1167. StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0033.ToString().Trim();
  1168. this.dgvData.StrValueNullColumn = "订单号,客户区域,客户地址,客户姓名,客户性别,客户电话,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系价格,接单人,备注,录入员,下单日期,会员卡号,客户QQ";
  1169. StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系价格,接单人,服务名称,数量,服务状态,服务时间,服务人员1,服务人员2,备注,录入员,下单日期,会员卡号,客户QQ,客户地址";
  1170. }
  1171. else if ( this.chkWeddingCelebration.Checked )
  1172. {
  1173. StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0034.ToString().Trim();
  1174. this.dgvData.StrValueNullColumn = "订单号,客户区域,客户地址,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态";
  1175. StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态,客户地址";
  1176. }
  1177. else
  1178. {
  1179. StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0010.ToString().Trim();
  1180. this.dgvData.StrValueNullColumn = "订单号,订单类型,客户区域,客户地址,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,套系类别,客户来源,套系名称,套系价格,接单人,订单类别,会员卡号,客户QQ,下单日期,录入员,备注";
  1181. StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,拍摄名称,摄影师,化妆师,引导师,拍摄时间,拍照状态,初修师,初修时间,初修状态,选片师,选片时间,选片状态,设计师,设计时间,设计状态,精修师,精修时间,精修状态,看版师,看版时间,看版状态,看版要求,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态,客户地址";
  1182. }
  1183. this.dgvData.dgvCurrentColumnOriginalSet = StrFieldName;
  1184. this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type";
  1185. this.dgvData.dgvGuidName = StrGuidName;
  1186. this.dgvData.dgvUserEmployeeID = this.StrUserID;
  1187. this.dgvData.DataColumns( this.dgvData.dgvCurrentColumnOriginalSet, strHideField: this.dgvData.dgvFixedHideColumn );
  1188. dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns( this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet );
  1189. if ( LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns( dictColumns ).IndexOf( this.dgvData.dgvFixedHideColumn ) == -1 )
  1190. {
  1191. if ( LYFZ.DAL.DAL_GridViewDisplayIndex.UpdateGridViewDisplayIndexModel( this.StrUserID, StrGuidName, LYFZ.DAL.DAL_GridViewDisplayIndex.UpdateGridViewDisplayIndexModel( StrFieldName ), LYFZ.DAL.DAL_GridViewDisplayIndex.StrVersionNumber ) )
  1192. {
  1193. this.PublicFunctionData( intTopCount, ref dictColumns );
  1194. }
  1195. else
  1196. {
  1197. if ( LYFZ.DAL.DAL_GridViewDisplayIndex.DeleteGridViewDisplayIndexModel( this.StrUserID, StrGuidName ) )
  1198. {
  1199. this.PublicFunctionData( intTopCount, ref dictColumns );
  1200. }
  1201. else
  1202. {
  1203. return null;
  1204. }
  1205. }
  1206. }
  1207. this.dgvData.dictShowColumName = dictColumns;
  1208. string StrQueryCondition = "";
  1209. if ( IsFirstRun && !string.IsNullOrEmpty( LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber ) )
  1210. {
  1211. string StrWhere = " Where Ord_SinceOrderNumber = '" + LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber + "'";
  1212. this.cmbTextQuery.Text = LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber;
  1213. StrQueryCondition = StrWhere + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhere( this.cmbtreevStoreName, "Ord_DividedShop" );
  1214. }
  1215. else
  1216. {
  1217. StrQueryCondition = this.GetWhereStr();
  1218. }
  1219. Hashtable htData = new Hashtable();
  1220. //DataTable newTable = new DataTable();
  1221. if ( this.chkServiceVersion.Checked )
  1222. {
  1223. if ( this.StrSortField.Trim().IndexOf( "Ordv_DigitalNumber" ) != -1 )
  1224. {
  1225. this.StrSortField = this.StrSortField.Trim().Replace( ",Ordv_DigitalNumber", "" );
  1226. }
  1227. else if ( this.StrSortField.Trim().IndexOf( "tb_ErpWeddingService.ID" ) == -1 )
  1228. {
  1229. this.StrSortField += ",tb_ErpWeddingService.ID";
  1230. }
  1231. htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderReportService( dictColumns, StrQueryCondition, intTopCount, this.StrSortField );
  1232. }
  1233. else
  1234. {
  1235. if ( this.StrSortField.Trim().IndexOf( "tb_ErpWeddingService.ID" ) != -1 )
  1236. {
  1237. this.StrSortField = this.StrSortField.Trim().Replace( ",tb_ErpWeddingService.ID", "" );
  1238. }
  1239. else if ( this.StrSortField.Trim().IndexOf( "Ordv_DigitalNumber" ) == -1 )
  1240. {
  1241. this.StrSortField += ",Ordv_DigitalNumber";
  1242. }
  1243. bool IschkWeddingCelebration = this.chkWeddingCelebration.Checked;
  1244. htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderReport( dictColumns, StrQueryCondition, intTopCount, this.StrSortField, IschkWeddingCelebration );
  1245. }
  1246. return htData;
  1247. }
  1248. DataTable GetExportReportData( int intTopCount, ref Dictionary<string, string> dictColumns )
  1249. {
  1250. string StrGuidName = "";
  1251. string StrFieldName = "";
  1252. if ( this.chkServiceVersion.Checked )
  1253. {
  1254. StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0033.ToString().Trim();
  1255. this.dgvData.StrValueNullColumn = "订单号,客户区域,客户地址,客户姓名,客户性别,客户电话,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系价格,接单人,备注,录入员,下单日期,会员卡号,客户QQ";
  1256. StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系价格,接单人,服务名称,数量,服务状态,服务时间,服务人员1,服务人员2,备注,录入员,下单日期,会员卡号,客户QQ,客户地址";
  1257. }
  1258. else if ( this.chkWeddingCelebration.Checked )
  1259. {
  1260. StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0034.ToString().Trim();
  1261. this.dgvData.StrValueNullColumn = "订单号,客户区域,客户地址,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态";
  1262. StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态,客户地址";
  1263. }
  1264. else
  1265. {
  1266. StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0010.ToString().Trim();
  1267. this.dgvData.StrValueNullColumn = "订单号,订单类型,客户区域,客户地址,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,套系类别,客户来源,套系名称,套系价格,接单人,订单类别,会员卡号,客户QQ,下单日期,录入员,备注";
  1268. StrFieldName = "Ord_Number,Ordv_ViceNumber,Ord_Type,订单号,客户区域,客户姓名,客户性别,客户电话,年龄,婚期,宝宝生日,订单类型,订单类别,客户来源,套系类别,套系名称,接单人,拍摄名称,摄影师,化妆师,引导师,拍摄时间,拍照状态,初修师,初修时间,初修状态,选片师,选片时间,选片状态,设计师,设计时间,设计状态,精修师,精修时间,精修状态,看版师,看版时间,看版状态,看版要求,取件状态,取件日期,备注,录入员,套系价格,下单日期,会员卡号,客户QQ,服务状态,客户地址";
  1269. }
  1270. dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns( this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet );
  1271. /*if (LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns(dictColumns).IndexOf(this.dgvData.dgvFixedHideColumn) == -1)
  1272. {
  1273. if (LYFZ.DAL.DAL_GridViewDisplayIndex.UpdateGridViewDisplayIndexModel(this.StrUserID, StrGuidName, LYFZ.DAL.DAL_GridViewDisplayIndex.UpdateGridViewDisplayIndexModel(StrFieldName), LYFZ.DAL.DAL_GridViewDisplayIndex.StrVersionNumber))
  1274. { this.PublicFunctionData(intTopCount, ref dictColumns); }
  1275. else
  1276. {
  1277. if (LYFZ.DAL.DAL_GridViewDisplayIndex.DeleteGridViewDisplayIndexModel(this.StrUserID, StrGuidName))
  1278. { this.PublicFunctionData(intTopCount, ref dictColumns); }
  1279. else
  1280. { return null; }
  1281. }
  1282. }
  1283. this.dgvData.dictShowColumName = dictColumns;*/
  1284. string StrQueryCondition = "";
  1285. if ( IsFirstRun && !string.IsNullOrEmpty( LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber ) )
  1286. {
  1287. string StrWhere = " Where Ord_SinceOrderNumber = '" + LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber + "'";
  1288. this.cmbTextQuery.Text = LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber;
  1289. StrQueryCondition = StrWhere + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhere( this.cmbtreevStoreName, "Ord_DividedShop" );
  1290. }
  1291. else
  1292. {
  1293. StrQueryCondition = this.GetWhereStr();
  1294. }
  1295. DataTable htData = new DataTable();
  1296. //DataTable newTable = new DataTable();
  1297. if ( this.StrSortField.Trim().IndexOf( "Ordv_DigitalNumber" ) != -1 )
  1298. {
  1299. this.StrSortField = this.StrSortField.Trim().Replace( ",Ordv_DigitalNumber", "" );
  1300. }
  1301. htData = LYFZ.ComponentLibrary.DataGridOrderView.GetDataTableOrderPhotographReportService( dictColumns, StrQueryCondition, intTopCount, "Ords_PhotographMaxTime DESC" );
  1302. return htData;
  1303. }
  1304. /// <summary>
  1305. /// 返回要操作的条件
  1306. /// </summary>
  1307. /// <returns></returns>
  1308. string GetWhereStr()
  1309. {
  1310. string StrWhere = " Where " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere( this.cmbtreevStoreName, "Ord_DividedShop", ConnectWord: "" );
  1311. string StrText = this.cmbTextQuery.Text.Trim().ToLower();
  1312. if ( StrText != "" )
  1313. {
  1314. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetQueryTextQueryCondition( StrText.Trim() );
  1315. }
  1316. if ( this.chkIntent.Checked )
  1317. {
  1318. StrWhere += " and Ord_Class = '0'";
  1319. }
  1320. else
  1321. {
  1322. StrWhere += " and Ord_Class = '1'";
  1323. //是否显示已取件的订单
  1324. if ( this.chkServiceVersion.Checked )
  1325. {
  1326. if ( this.chkShowCompleteOrder.Checked )
  1327. {
  1328. StrWhere += " and Ws_Status = '1'";
  1329. }
  1330. else
  1331. {
  1332. StrWhere += " and ISNULL(Ws_Status, '0') <> '1'";
  1333. } //2017-03-30 6刘工修改
  1334. //{ StrWhere += " and Ws_Status <> '1'"; }
  1335. }
  1336. else
  1337. {
  1338. if ( this.chkShowCompleteOrder.Checked )
  1339. {
  1340. StrWhere += " and (Ords_ProductPickupIntStatus = 2 And Ords_ServiceIntStatus = 2)";
  1341. }
  1342. else
  1343. {
  1344. StrWhere += " and (Ords_ProductPickupIntStatus in (0,1) or Ords_ServiceIntStatus in (0,1))";
  1345. }
  1346. }
  1347. }
  1348. if ( DictData.ContainsKey( "OrdersPerson" ) && DictData["OrdersPerson"].Trim().Length > 0 )
  1349. {
  1350. StrWhere += " and Ord_OrderPersonName like '%" + DictData["OrdersPerson"].Trim() + "%'";
  1351. }
  1352. if ( DictData.ContainsKey( "CustomerSource" ) && DictData["CustomerSource"].Trim().Length > 0 )
  1353. {
  1354. StrWhere += " and Ord_CustomerSource = '" + DictData["CustomerSource"].Trim() + "'";
  1355. }
  1356. if ( DictData.ContainsKey( "PhotographyCategory" ) && DictData["PhotographyCategory"].Trim().Length > 0 )
  1357. {
  1358. StrWhere += " and Ord_PhotographyCategory in (" + DictData["PhotographyCategory"].Trim() + ")";
  1359. }
  1360. if ( DictData.ContainsKey( "SeriesName" ) && DictData["SeriesName"].Trim().Length > 0 )
  1361. {
  1362. StrWhere += " and Ord_SeriesName = '" + DictData["SeriesName"].Trim() + "'";
  1363. }
  1364. if ( DictData.ContainsKey( "SeriesAmountStart" ) && DictData["SeriesAmountStart"].Trim().Length > 0 && DictData.ContainsKey( "SeriesAmountEnd" ) && DictData["SeriesAmountEnd"].Trim().Length > 0 )
  1365. {
  1366. StrWhere += " And (Ord_SeriesPrice between '" + DictData["SeriesAmountStart"].ToString().Trim() + "' And '" + DictData["SeriesAmountEnd"].ToString().Trim() + "')";
  1367. }
  1368. if ( DictData.ContainsKey( "OrderClass" ) && DictData["OrderClass"].Length > 0 )
  1369. {
  1370. StrWhere += " and Ord_OrderClass = '" + DictData["OrderClass"].Trim() + "'";
  1371. }
  1372. if ( DictData.ContainsKey( "QueryDateTimeStart" ) && DictData["QueryDateTimeStart"].Trim().Length > 0 && DictData.ContainsKey( "QueryDateTimeEnd" ) && DictData["QueryDateTimeEnd"].Trim().Length > 0 )
  1373. {
  1374. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime( "Ord_CreateDateTime", DictData["QueryDateTimeStart"], DictData["QueryDateTimeEnd"] );
  1375. }
  1376. if ( DictData.ContainsKey( "PhotographDateTimeStart" ) && DictData["PhotographDateTimeStart"].Trim().Length > 0 && DictData.ContainsKey( "PhotographDateTimeEnd" ) && DictData["PhotographDateTimeEnd"].Trim().Length > 0 )
  1377. {
  1378. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime( "Ords_PhotographMaxTime", DictData["PhotographDateTimeStart"], DictData["PhotographDateTimeEnd"] );
  1379. }
  1380. #region 客户区域;
  1381. if ( DictData.ContainsKey( "CustomerArea" ) && DictData["CustomerArea"].Trim().Length > 0 )
  1382. {
  1383. StrWhere += " and Cus_Region = '" + DictData["CustomerArea"].Trim() + "'";
  1384. }
  1385. #endregion
  1386. if ( this.chkDressVersion.Checked )
  1387. {
  1388. StrWhere += " And Ord_Type = '" + Convert.ToInt32( LYFZ.EnumPublic.OrderType.婚纱订单 ) + "'";
  1389. }
  1390. else if ( this.chkKidsVersion.Checked )
  1391. {
  1392. StrWhere += " And Ord_Type = '" + Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ) + "'";
  1393. }
  1394. else if ( this.chkPortraitVersion.Checked )
  1395. {
  1396. StrWhere += " And Ord_Type = '" + Convert.ToInt32( LYFZ.EnumPublic.OrderType.写真订单 ) + "'";
  1397. }
  1398. else if ( this.chkWeddingCelebration.Checked )
  1399. {
  1400. StrWhere += " And Ord_Type = '" + Convert.ToInt32( LYFZ.EnumPublic.OrderType.婚庆订单 ) + "'";
  1401. }
  1402. else if ( this.chkServiceVersion != null && this.chkServiceVersion.Checked )
  1403. {
  1404. StrWhere += " And Ord_Type = '" + Convert.ToInt32( LYFZ.EnumPublic.OrderType.服务订单 ) + "'";
  1405. }
  1406. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, chkServiceVersion: this.chkServiceVersion, chkWeddingCelebration: this.chkWeddingCelebration );
  1407. return StrWhere;
  1408. }
  1409. void GetWhereStr( ref Dictionary<string, string> dicWhere )
  1410. {
  1411. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhereByDataList( this.cmbtreevStoreName, "Ord_DividedShop",
  1412. ref dicWhere );
  1413. string StrText = this.cmbTextQuery.Text.Trim().ToLower();
  1414. if ( StrText != "" )
  1415. {
  1416. if ( !string.IsNullOrEmpty( StrText.Trim() ) )
  1417. {
  1418. StrText = StrText.Trim().ToLower();
  1419. dicWhere.Add( "Cus_Name", StrText.Trim() );
  1420. dicWhere.Add( "Ord_SinceOrderNumber", StrText.Trim() );
  1421. dicWhere.Add( "Cus_Telephone", StrText.Trim() );
  1422. dicWhere.Add( "Cus_Name_py", StrText.Trim() );
  1423. /* if (LYFZ.Command.Command_Validate.IsChinese(StrText.Replace("/", "")))
  1424. {
  1425. dicWhere.Add("Cus_Name", StrText.Trim());
  1426. }
  1427. else if (LYFZ.Command.Command_Validate.IsNumber(StrText))
  1428. {
  1429. if (LYFZ.MY_LocalSettings.MyLocalSettings.Ordernumbersearch)
  1430. {
  1431. //StrWhere = " And (Ord_SinceOrderNumber like '%" + StrText.Trim() + "%' or Cus_Telephone like '%" + StrText.Trim() + "%')";
  1432. dicWhere.Add("Ord_SinceOrderNumber", StrText.Trim());
  1433. }
  1434. else
  1435. {
  1436. //StrWhere += " And Cus_Telephone like '%" + StrText.Trim() + "%'";
  1437. dicWhere.Add("Cus_Telephone", StrText.Trim());
  1438. }
  1439. }
  1440. else if (LYFZ.Command.Command_Validate.IsEnglish(StrText.Replace("/", "")))
  1441. {
  1442. dicWhere.Add("Cus_Name_py", StrText.Trim());
  1443. //StrWhere = " And Cus_Name_py like '%" + StrText.Trim() + "%'";
  1444. }
  1445. else if (LYFZ.Command.Command_Validate.IsOrderNumber(StrText))
  1446. {
  1447. dicWhere.Add("Ord_SinceOrderNumber", StrText.Trim());
  1448. //StrWhere = " And Ord_SinceOrderNumber like '" + StrText.Trim() + "%'";
  1449. }*/
  1450. }
  1451. }
  1452. if ( this.chkIntent.Checked )
  1453. {
  1454. //StrWhere += " and Ord_Class = '0'";
  1455. dicWhere.Add( "Ord_Class", "0" );
  1456. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.IntentionCustomerCompetence, CustomAttributes.OperatingAuthority.Client_ShowAllIntentClient ) )
  1457. {
  1458. dicWhere.Add( "Ord_OrderPersonNumber", "" + StrUserID + "" );
  1459. }
  1460. }
  1461. else
  1462. {
  1463. //StrWhere += " and Ord_Class = '1'";
  1464. dicWhere.Add( "Ord_Class", "1" );
  1465. }
  1466. //是否显示已取件的订单
  1467. if ( this.chkServiceVersion.Checked )
  1468. {
  1469. if ( this.chkShowCompleteOrder.Checked )
  1470. {
  1471. dicWhere.Add( "Ords_ServiceIntStatus", "1" );
  1472. //StrWhere += " and Ws_Status = '1'";
  1473. }
  1474. else
  1475. {
  1476. dicWhere.Add( "Ords_ServiceIntStatus", "<>1" );
  1477. //StrWhere += " and ISNULL(Ws_Status, '0') <> '1'";
  1478. } //2017-03-30 6刘工修改
  1479. //{ StrWhere += " and Ws_Status <> '1'"; }
  1480. }
  1481. else
  1482. {
  1483. if ( this.chkShowCompleteOrder.Checked )
  1484. {
  1485. dicWhere.Add( "Ords_ProductPickupIntStatus", "2" );
  1486. dicWhere.Add( "Ords_ServiceIntStatus", "2" );
  1487. //StrWhere += " and (Ords_ProductPickupIntStatus = 2 And Ords_ServiceIntStatus = 2)";
  1488. }
  1489. else
  1490. {
  1491. dicWhere.Add( "Ords_ProductPickupIntStatus", " in (0,1)" );
  1492. dicWhere.Add( "Ords_ServiceIntStatus", " in (0,1)" );
  1493. //StrWhere += " and (Ords_ProductPickupIntStatus in (0,1) or Ords_ServiceIntStatus in (0,1))"; }
  1494. }
  1495. }
  1496. if ( BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.HidePickUpOrder )
  1497. {
  1498. if ( !this.chkShowCompleteOrder.Checked && string.IsNullOrEmpty( cmbTextQuery.Text ) )
  1499. {// 显示未取件的订单,且查询框空时;
  1500. if ( dicWhere.ContainsKey( "Ords_ProductPickupIntStatus" ) )
  1501. {
  1502. dicWhere.Remove( "Ords_ProductPickupIntStatus" );
  1503. }
  1504. if ( dicWhere.ContainsKey( "Ords_ServiceIntStatus" ) )
  1505. {
  1506. dicWhere.Remove( "Ords_ServiceIntStatus" );
  1507. }
  1508. if ( !dicWhere.ContainsKey( "Ords_ProductPickupIntStatus" ) )
  1509. {
  1510. dicWhere.Add( "Ords_ProductPickupIntStatus", " in (0,1)" );
  1511. }
  1512. }
  1513. else if ( this.chkShowCompleteOrder.Checked )
  1514. {// 显示取件Ok的订单;
  1515. if ( dicWhere.ContainsKey( "Ords_ProductPickupIntStatus" ) )
  1516. {
  1517. dicWhere.Remove( "Ords_ProductPickupIntStatus" );
  1518. }
  1519. if ( dicWhere.ContainsKey( "Ords_ServiceIntStatus" ) )
  1520. {
  1521. dicWhere.Remove( "Ords_ServiceIntStatus" );
  1522. }
  1523. if ( !dicWhere.ContainsKey( "Ords_ProductPickupIntStatus" ) )
  1524. {
  1525. dicWhere.Add( "Ords_ProductPickupIntStatus", " 2" );
  1526. }
  1527. }
  1528. }
  1529. if ( DictData.ContainsKey( "OrdersPerson" ) && DictData["OrdersPerson"].Trim().Length > 0 )
  1530. {
  1531. if ( !this.chkIntent.Checked || LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.IntentionCustomerCompetence, CustomAttributes.OperatingAuthority.Client_ShowAllIntentClient ) )
  1532. {
  1533. dicWhere.Add( "Ord_OrderPersonName", DictData["OrdersPerson"].Trim() );
  1534. }
  1535. //StrWhere += " and Ord_OrderPersonName like '%" + DictData["OrdersPerson"].Trim() + "%'";
  1536. }
  1537. if ( DictData.ContainsKey( "CustomerSource" ) && DictData["CustomerSource"].Trim().Length > 0 )
  1538. {
  1539. dicWhere.Add( "Ord_CustomerSource", DictData["CustomerSource"].Trim() );
  1540. //StrWhere += " and Ord_CustomerSource = '" + DictData["CustomerSource"].Trim() + "'";
  1541. }
  1542. if ( DictData.ContainsKey( "PhotographyCategory" ) && DictData["PhotographyCategory"].Trim().Length > 0 )
  1543. {
  1544. dicWhere.Add( "Ord_PhotographyCategory", DictData["PhotographyCategory"].Trim() );
  1545. //StrWhere += " and Ord_PhotographyCategory in (" + DictData["PhotographyCategory"].Trim() + ")";
  1546. }
  1547. if ( DictData.ContainsKey( "SeriesName" ) && DictData["SeriesName"].Trim().Length > 0 )
  1548. {
  1549. dicWhere.Add( "Ord_SeriesName", DictData["SeriesName"].Trim() );
  1550. //StrWhere += " and Ord_SeriesName = '" + DictData["SeriesName"].Trim() + "'";
  1551. }
  1552. if ( DictData.ContainsKey( "SeriesAmountStart" ) && DictData["SeriesAmountStart"].Trim().Length > 0 && DictData.ContainsKey( "SeriesAmountEnd" ) && DictData["SeriesAmountEnd"].Trim().Length > 0 )
  1553. {
  1554. dicWhere.Add( "StartSeriesPrice", DictData["SeriesAmountStart"].Trim() );
  1555. dicWhere.Add( "EndSeriesPrice", DictData["SeriesAmountEnd"].Trim() );
  1556. //StrWhere += " And (Ord_SeriesPrice between '" + DictData["SeriesAmountStart"].ToString().Trim() + "' And '" + DictData["SeriesAmountEnd"].ToString().Trim() + "')";
  1557. }
  1558. if ( DictData.ContainsKey( "OrderClass" ) && DictData["OrderClass"].Length > 0 )
  1559. {
  1560. dicWhere.Add( "Ord_OrderClass", DictData["OrderClass"].Trim() );
  1561. //StrWhere += " and Ord_OrderClass = '" + DictData["OrderClass"].Trim() + "'";
  1562. }
  1563. if ( DictData.ContainsKey( "QueryDateTimeStart" ) && DictData["QueryDateTimeStart"].Trim().Length > 0 && DictData.ContainsKey( "QueryDateTimeEnd" ) && DictData["QueryDateTimeEnd"].Trim().Length > 0 )
  1564. {
  1565. dicWhere.Add( "startdatetime", DictData["QueryDateTimeStart"].Trim() );
  1566. dicWhere.Add( "enddatetime", DictData["QueryDateTimeEnd"].Trim() );
  1567. //StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ord_CreateDateTime", DictData["QueryDateTimeStart"], DictData["QueryDateTimeEnd"]);
  1568. }
  1569. if ( DictData.ContainsKey( "PhotographDateTimeStart" ) && DictData["PhotographDateTimeStart"].Trim().Length > 0 && DictData.ContainsKey( "PhotographDateTimeEnd" ) && DictData["PhotographDateTimeEnd"].Trim().Length > 0 )
  1570. {
  1571. dicWhere.Add( "PhotographStartTime", DictData["PhotographDateTimeStart"].Trim() );
  1572. dicWhere.Add( "PhotographEndTime", DictData["PhotographDateTimeEnd"].Trim() );
  1573. //StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ord_CreateDateTime", DictData["QueryDateTimeStart"], DictData["QueryDateTimeEnd"]);
  1574. }
  1575. #region 客户区域;
  1576. if ( DictData.ContainsKey( "CustomerArea" ) && DictData["CustomerArea"].Trim().Length > 0 )
  1577. {
  1578. dicWhere.Add( "Cus_Region", DictData["CustomerArea"].Trim() );
  1579. }
  1580. #endregion
  1581. if ( this.chkDressVersion.Checked )
  1582. {
  1583. dicWhere.Add( "Ord_Type", Convert.ToInt32( LYFZ.EnumPublic.OrderType.婚纱订单 ).ToString() );
  1584. //StrWhere += " And Ord_Type = '" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.婚纱订单) + "'";
  1585. }
  1586. else if ( this.chkKidsVersion.Checked )
  1587. {
  1588. dicWhere.Add( "Ord_Type", Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString() );
  1589. //StrWhere += " And Ord_Type = '" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.儿童订单) + "'";
  1590. }
  1591. else if ( this.chkPortraitVersion.Checked )
  1592. {
  1593. dicWhere.Add( "Ord_Type", Convert.ToInt32( LYFZ.EnumPublic.OrderType.写真订单 ).ToString() );
  1594. //StrWhere += " And Ord_Type = '" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.写真订单) + "'";
  1595. }
  1596. else if ( this.chkWeddingCelebration.Checked )
  1597. {
  1598. dicWhere.Add( "Ord_Type", Convert.ToInt32( LYFZ.EnumPublic.OrderType.婚庆订单 ).ToString() );
  1599. //StrWhere += " And Ord_Type = '" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.婚庆订单) + "'";
  1600. }
  1601. else if ( this.chkServiceVersion != null && this.chkServiceVersion.Checked )
  1602. {
  1603. dicWhere.Add( "Ord_Type", Convert.ToInt32( LYFZ.EnumPublic.OrderType.服务订单 ).ToString() );
  1604. //StrWhere += " And Ord_Type = '" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.服务订单) + "'";
  1605. }
  1606. // StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL(this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, chkServiceVersion: this.chkServiceVersion, chkWeddingCelebration: this.chkWeddingCelebration);
  1607. //return StrWhere;
  1608. }
  1609. }
  1610. }