KepanFormMain.cs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  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. namespace LYFZ.Software.MainBusiness.DoorCityProcess
  12. {
  13. public partial class KepanFormMain : LYFZ.Software.UI.DoorCityProcess.KepanFormMain
  14. {
  15. LYFZ.BLL.BLL_ErpOrder obll = new BLL.BLL_ErpOrder();
  16. LYFZ.BLL.BLL_ErpKepanLogo kbll = new BLL.BLL_ErpKepanLogo();
  17. public KepanFormMain()
  18. {
  19. this.Shown += KepanFormMain_Shown;
  20. this.Load += KepanFormMain_Load;
  21. this.cmbtreevStoreName.ComboBoxTree_NodeMouseClick += cmbtreevStoreName_ComboBoxTree_NodeMouseClick;
  22. this.cmbQueryText.KeyDown += cmbQueryText_KeyDown;
  23. this.btnQuery.Click += btnQuery_Click;
  24. this.btnFilmSelectionOK.Click += btnFilmSelectionOK_Click;
  25. this.btnCDBurning.Click += btnCDBurning_Click;
  26. this.btnBurnerRecord.Click += btnBurnerRecord_Click;
  27. this.btnClose.Click += btnClose_Click;
  28. this.chkDressVersion.Click += chkDressVersion_Click;
  29. this.chkKidsVersion.Click += chkKidsVersion_Click;
  30. this.chkPortraitVersion.Click += chkPortraitVersion_Click;
  31. this.chkArrears.Click += chkArrears_Click;
  32. this.Resize += KepanFormMain_Resize;
  33. this.dgvData.ColumnHeaderMouseClick += dgvData_ColumnHeaderMouseClick;
  34. this.dgvData.CellMouseDown += dgvData_CellMouseDown;
  35. this.dgvData.CellClick += dgvData_CellClick;
  36. this.dgvData.CellMouseDoubleClick += dgvData_CellMouseDoubleClick;
  37. this.dgvData.MouseDoubleClick += dgvData_MouseDoubleClick;
  38. this.flowLayoutPanel1.Height = 34;
  39. this.ucPagerEx1.EventPaging += ucPagerEx1_EventPaging;
  40. this.chkCompleteOrder.Click += ChkCompleteOrder_Click;
  41. }
  42. private void ChkCompleteOrder_Click( object sender, EventArgs e )
  43. {
  44. this.ucPagerEx1.PageCurrent = 1;
  45. this.ucPagerEx1.Bind();
  46. }
  47. int ucPagerEx1_EventPaging( UCPager.EventPagingArg e )
  48. {
  49. //pageData.PageSize = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReportFormPageSize;
  50. this.ucPagerEx1.PageSize = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReportFormPageSize;
  51. PublicFunctionRows();
  52. return ucPagerEx1.NMax;
  53. }
  54. public void BindPageData( int pageIndx, int pageSize, int totalCount )
  55. {
  56. ucPagerEx1.NMax = totalCount;
  57. ucPagerEx1.CurrentPageCount = (pageSize);
  58. ucPagerEx1.PageCurrent = pageIndx;
  59. }
  60. /// <summary>
  61. /// 是否首次运行
  62. /// </summary>
  63. bool IsFirstRun = true;
  64. /// <summary>
  65. /// 查询条件
  66. /// </summary>
  67. private Dictionary<string, string> DictData = new Dictionary<string, string>();
  68. /// <summary>
  69. /// 员工编号
  70. /// </summary>
  71. string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  72. /// <summary>
  73. /// 窗体加载事件
  74. /// </summary>
  75. /// <param name="sender"></param>
  76. /// <param name="e"></param>
  77. void KepanFormMain_Shown( object sender, EventArgs e )
  78. {
  79. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName( this.cmbtreevStoreName, StrGroupKeyCode: "retailProcess", StrKeyCode: "st011" );
  80. //this.PublicFunctionRows();
  81. this.ucPagerEx1.Bind();
  82. this.IsFirstRun = false;
  83. this.KepanFormMain_Resize( this, null );
  84. }
  85. /// <summary>
  86. /// 窗体加载事件
  87. /// </summary>
  88. /// <param name="sender"></param>
  89. /// <param name="e"></param>
  90. void KepanFormMain_Load( object sender, EventArgs e )
  91. {
  92. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetSystemVersion( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion );
  93. this.panelDressVersion.Visible = this.chkDressVersion.Visible;
  94. this.panelKidsVersion.Visible = this.chkKidsVersion.Visible;
  95. this.panelPortraitVersion.Visible = this.chkPortraitVersion.Visible;
  96. }
  97. /// <summary>
  98. /// 选择分店获取权限
  99. /// </summary>
  100. void PublicFunctionRights()
  101. {
  102. }
  103. /// <summary>
  104. /// 分店选择查询数据
  105. /// </summary>
  106. /// <param name="sender"></param>
  107. /// <param name="e"></param>
  108. void cmbtreevStoreName_ComboBoxTree_NodeMouseClick( object sender, TreeNodeMouseClickEventArgs e )
  109. {
  110. //this.PublicFunctionRows();
  111. this.ucPagerEx1.PageCurrent = 1;
  112. this.ucPagerEx1.Bind();
  113. }
  114. /// <summary>
  115. /// 回车
  116. /// </summary>
  117. /// <param name="sender"></param>
  118. /// <param name="e"></param>
  119. void cmbQueryText_KeyDown( object sender, KeyEventArgs e )
  120. {
  121. if ( e.KeyCode == Keys.Enter )
  122. {
  123. this.btnQuery_Click( this, null );
  124. }
  125. }
  126. /// <summary>
  127. /// 查询
  128. /// </summary>
  129. /// <param name="sender"></param>
  130. /// <param name="e"></param>
  131. void btnQuery_Click( object sender, EventArgs e )
  132. {
  133. this.DictData.Clear();
  134. //this.PublicFunctionRows();
  135. this.ucPagerEx1.PageCurrent = 1;
  136. this.ucPagerEx1.Bind();
  137. }
  138. /// <summary>
  139. /// 选片OK
  140. /// </summary>
  141. /// <param name="sender"></param>
  142. /// <param name="e"></param>
  143. void btnFilmSelectionOK_Click( object sender, EventArgs e )
  144. {
  145. this.DictData.Clear();
  146. this.cmbQueryText.Text = "";
  147. this.DictData["FilmSelectionStatus"] = "OK";
  148. //this.PublicFunctionRows();
  149. this.ucPagerEx1.PageCurrent = 1;
  150. this.ucPagerEx1.Bind();
  151. }
  152. /// <summary>
  153. /// 光盘刻录
  154. /// </summary>
  155. /// <param name="sender"></param>
  156. /// <param name="e"></param>
  157. void btnCDBurning_Click( object sender, EventArgs e )
  158. {
  159. if ( this.dgvData.Rows.Count > 0 )
  160. {
  161. if ( this.dgvData.SelectedRows.Count > 0 )
  162. {
  163. string StrViceNumber = dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  164. if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( StrViceNumber ) )
  165. {
  166. return;
  167. }
  168. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.EngravedCDSmallForm frm = new SetSmallForm.EngravedCDSmallForm();
  169. frm.MainOrderNumber = dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  170. frm.ViceOrderNumber = StrViceNumber;
  171. if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString().Trim() )
  172. {
  173. frm.StrSightsName = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim();
  174. }
  175. else
  176. {
  177. frm.StrSightsName = "";
  178. }
  179. #region 免刻录字段;
  180. if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString().Trim() )
  181. {
  182. object obj;
  183. int nIndex = this.dgvData.CurrentRow.Index;
  184. do
  185. {
  186. obj = this.dgvData.Rows[nIndex].Cells["订单类型"].Value;
  187. if ( obj == null )
  188. --nIndex;
  189. } while ( obj == null );
  190. frm.OrderType = this.dgvData.Rows[nIndex].Cells["订单类型"].Value.ToString().Trim();
  191. frm.CusNames = this.dgvData.Rows[nIndex].Cells["客户姓名"].Value.ToString().Trim();
  192. frm.CusGenders = this.dgvData.Rows[nIndex].Cells["客户性别"].Value.ToString().Trim();
  193. frm.CusPhones = this.dgvData.Rows[nIndex].Cells["客户电话"].Value.ToString().Trim();
  194. }
  195. else
  196. {
  197. frm.OrderType = this.dgvData.CurrentRow.Cells["订单类型"].Value.ToString().Trim();
  198. frm.CusNames = this.dgvData.CurrentRow.Cells["客户姓名"].Value.ToString().Trim();
  199. frm.CusGenders = this.dgvData.CurrentRow.Cells["客户性别"].Value.ToString().Trim();
  200. frm.CusPhones = this.dgvData.CurrentRow.Cells["客户电话"].Value.ToString().Trim();
  201. }
  202. if ( this.dgvData.Columns["百度云信息"] != null )
  203. frm.strBaiduInfo = this.dgvData.CurrentRow.Cells["百度云信息"].Value.ToString().Trim();
  204. #endregion
  205. frm.ShowDialog();
  206. // 更新变更的记录;??没有效果,赋值无效;
  207. if ( this.dgvData.Columns["百度云信息"] != null )
  208. this.dgvData.CurrentRow.Cells["百度云信息"].Value = frm.strBaiduInfo;
  209. if ( this.dgvData.Columns["客片上传状态"] != null )
  210. this.dgvData.CurrentRow.Cells["客片上传状态"].Value = frm.strUploadStatus;
  211. }
  212. }
  213. }
  214. /// <summary>
  215. /// 刻盘数据列表双击事件
  216. /// </summary>
  217. /// <param name="sender"></param>
  218. /// <param name="e"></param>
  219. void dgvData_CellMouseDoubleClick( object sender, DataGridViewCellMouseEventArgs e )
  220. {
  221. if ( this.dgvData.Rows.Count > 0 )
  222. {
  223. if ( e.RowIndex >= 0 && e.ColumnIndex >= 0 )
  224. {
  225. this.btnBurnerRecord_Click( null, null );
  226. }
  227. }
  228. }
  229. /// <summary>
  230. /// 刻录记录
  231. /// </summary>
  232. /// <param name="sender"></param>
  233. /// <param name="e"></param>
  234. void btnBurnerRecord_Click( object sender, EventArgs e )
  235. {
  236. if ( this.dgvData.Rows.Count > 0 )
  237. {
  238. if ( this.dgvData.SelectedRows.Count > 0 )
  239. {
  240. DataTable tbl = kbll.GetList( "kp_OrderNumber='" + dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim() + "'" ).Tables[0];
  241. if ( tbl.Rows.Count > 0 )
  242. {
  243. string message = "";
  244. for ( int i = 0; i < tbl.Rows.Count; i++ )
  245. {
  246. if ( i == 0 )
  247. {
  248. message += tbl.Rows[i]["kp_KepanName"].ToString().Trim() + " " + Convert.ToDateTime( tbl.Rows[i]["kp_KepanTime"] ).ToString( "yyyy-MM-dd" ) + " 选中的照片";
  249. }
  250. else
  251. {
  252. message += "\r\n" + tbl.Rows[i]["kp_KepanName"].ToString().Trim() + " " + Convert.ToDateTime( tbl.Rows[i]["kp_KepanTime"] ).ToString( "yyyy-MM-dd" ) + " 选中的照片";
  253. }
  254. }
  255. MessageBoxCustom.Show( message );
  256. }
  257. else
  258. {
  259. MessageBoxCustom.Show( "没有相关记录" );
  260. }
  261. }
  262. }
  263. }
  264. /// <summary>
  265. /// 关闭
  266. /// </summary>
  267. /// <param name="sender"></param>
  268. /// <param name="e"></param>
  269. void btnClose_Click( object sender, EventArgs e )
  270. {
  271. this.Close();
  272. }
  273. /// <summary>
  274. /// 儿童版
  275. /// </summary>
  276. /// <param name="sender"></param>
  277. /// <param name="e"></param>
  278. void chkKidsVersion_Click( object sender, EventArgs e )
  279. {
  280. if ( this.chkKidsVersion.Checked )
  281. {
  282. this.chkPortraitVersion.Checked = false; this.chkKidsVersion.Checked = true; this.chkDressVersion.Checked = false;
  283. }
  284. this.cmbQueryText.Text = "";
  285. //this.PublicFunctionRows();
  286. this.ucPagerEx1.PageCurrent = 1;
  287. this.ucPagerEx1.Bind();
  288. }
  289. /// <summary>
  290. /// 婚纱版
  291. /// </summary>
  292. /// <param name="sender"></param>
  293. /// <param name="e"></param>
  294. void chkDressVersion_Click( object sender, EventArgs e )
  295. {
  296. if ( this.chkDressVersion.Checked )
  297. {
  298. this.chkPortraitVersion.Checked = false; this.chkDressVersion.Checked = true; this.chkKidsVersion.Checked = false;
  299. }
  300. this.cmbQueryText.Text = "";
  301. //this.PublicFunctionRows();
  302. this.ucPagerEx1.PageCurrent = 1;
  303. this.ucPagerEx1.Bind();
  304. }
  305. /// <summary>
  306. /// 写真版
  307. /// </summary>
  308. /// <param name="sender"></param>
  309. /// <param name="e"></param>
  310. void chkPortraitVersion_Click( object sender, EventArgs e )
  311. {
  312. if ( this.chkPortraitVersion.Checked )
  313. {
  314. this.chkPortraitVersion.Checked = true; this.chkDressVersion.Checked = false; this.chkKidsVersion.Checked = false;
  315. }
  316. this.cmbQueryText.Text = "";
  317. //this.PublicFunctionRows();
  318. this.ucPagerEx1.PageCurrent = 1;
  319. this.ucPagerEx1.Bind();
  320. }
  321. /// <summary>
  322. /// 欠款
  323. /// </summary>
  324. /// <param name="sender"></param>
  325. /// <param name="e"></param>
  326. void chkArrears_Click( object sender, EventArgs e )
  327. {
  328. //this.PublicFunctionRows();
  329. this.ucPagerEx1.PageCurrent = 1;
  330. this.ucPagerEx1.Bind();
  331. }
  332. /// <summary>
  333. /// 窗体大小 发生变化
  334. /// </summary>
  335. /// <param name="sender"></param>
  336. /// <param name="e"></param>
  337. void KepanFormMain_Resize( object sender, EventArgs e )
  338. {
  339. if ( !this.IsFirstRun )
  340. {
  341. switch ( this.panelArrears.Location.Y )
  342. {
  343. case 4: this.flowLayoutPanel1.Height = 36; break;
  344. case 36: this.flowLayoutPanel1.Height = 68; break;
  345. }
  346. }
  347. }
  348. /// <summary>
  349. /// 右键菜单
  350. /// </summary>
  351. /// <param name="sender"></param>
  352. /// <param name="e"></param>
  353. void dgvData_CellMouseDown( object sender, DataGridViewCellMouseEventArgs e )
  354. {
  355. if ( e.Button == MouseButtons.Right )
  356. {
  357. if ( e.RowIndex >= 0 && e.ColumnIndex >= 0 )
  358. {
  359. ToolStripMenuItem item = new ToolStripMenuItem();
  360. Hashtable htData = new Hashtable();
  361. htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
  362. htData["StrViceNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  363. item.Text = "订单备注";
  364. item.Tag = htData;
  365. item.Name = "OrderRemark";
  366. this.dgvData.conMenu.Items.Add( item );
  367. // this.dgvData.conMenu.Show( MousePosition.X, MousePosition.Y );//弹出操作菜单
  368. this.dgvData.conMenu.ItemClicked -= dgvData_DataGridViewConMenu_ItemClicked;
  369. this.dgvData.conMenu.ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
  370. // this.dgvData.conMenu.Show();
  371. if (!this.dgvData.conMenu.Visible)
  372. {
  373. this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
  374. }
  375. }
  376. else
  377. {
  378. this.dgvData.conMenu.Items.Clear();
  379. ToolStripMenuItem item = new ToolStripMenuItem();
  380. item.Text = "设置标题";
  381. item.Tag = "SetColumnShow";
  382. item.Name = "SetColumnShow";
  383. this.dgvData.conMenu.Items.Add( item );
  384. // this.dgvData.conMenu.Show( MousePosition.X, MousePosition.Y );//弹出操作菜单
  385. this.dgvData.conMenu.ItemClicked -= dgvData_DataGridViewConMenu_ItemClicked;
  386. this.dgvData.conMenu.ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
  387. // this.dgvData.conMenu.Show();
  388. if (!this.dgvData.conMenu.Visible)
  389. {
  390. this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
  391. }
  392. }
  393. }
  394. }
  395. /// <summary>
  396. /// 列表单击事件
  397. /// </summary>
  398. /// <param name="sender"></param>
  399. /// <param name="e"></param>
  400. void dgvData_CellClick( object sender, DataGridViewCellEventArgs e )
  401. {
  402. try
  403. {
  404. string StrNumber = this.dgvData.CurrentRow.Cells["订单号"].Value.ToString().Trim();
  405. if ( string.IsNullOrEmpty( StrNumber ) || StrNumber.Trim() == "(取件OK)" )
  406. {
  407. bool IsFind = false;
  408. int i = this.dgvData.CurrentRow.Index;
  409. while ( !IsFind )
  410. {
  411. i = i - 1;
  412. if ( !string.IsNullOrEmpty( this.dgvData.Rows[i].Cells["订单号"].Value.ToString().Trim() ) )
  413. {
  414. StrNumber = this.dgvData.Rows[i].Cells["订单号"].Value.ToString().Trim(); IsFind = true;
  415. }
  416. }
  417. }
  418. LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = StrNumber;
  419. }
  420. catch
  421. {
  422. }
  423. }
  424. /// <summary>
  425. /// 对列表控件双击事件
  426. /// </summary>
  427. /// <param name="sender"></param>
  428. /// <param name="e"></param>
  429. void dgvData_MouseDoubleClick( object sender, MouseEventArgs e )
  430. {
  431. Point hit = this.dgvData.PointToClient( Cursor.Position );
  432. DataGridView.HitTestInfo hitTest = this.dgvData.HitTest( hit.X, hit.Y );
  433. if ( hitTest.RowIndex < 0 && hitTest.ColumnIndex < 0 )
  434. {
  435. if ( !string.IsNullOrEmpty( this.cmbQueryText.Text.Trim() ) )
  436. {
  437. LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = "";
  438. this.cmbQueryText.Text = "";
  439. //this.PublicFunctionRows();
  440. this.ucPagerEx1.PageCurrent = 1;
  441. this.ucPagerEx1.Bind();
  442. }
  443. }
  444. }
  445. /// <summary>
  446. /// 右键菜单选择项事件
  447. /// </summary>
  448. /// <param name="sender"></param>
  449. /// <param name="e"></param>
  450. void dgvData_DataGridViewConMenu_ItemClicked( object sender, ToolStripItemClickedEventArgs e )
  451. {
  452. ToolStripItem item = e.ClickedItem;
  453. if ( item.Name.Trim() == "SetColumnShow" )
  454. {
  455. if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ShowDataGridViewSetColumn( this.dgvData ) )
  456. {
  457. //this.PublicFunctionRows();
  458. this.ucPagerEx1.PageCurrent = 1;
  459. this.ucPagerEx1.Bind();
  460. }
  461. }
  462. else if ( item.Name.ToString().Trim() == "OrderRemark" )
  463. {
  464. Hashtable htData = (Hashtable)item.Tag;
  465. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OrderRemarkRecordAddSuperSmallForm frm = new SuperSmallForm.OrderRemarkRecordAddSuperSmallForm();
  466. frm.StrOrderNumber = htData["StrNumber"].ToString().Trim();
  467. frm.StrOrdViceNumber = htData["StrViceNumber"].ToString().Trim();
  468. frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.相片刻录.ToString().Trim();
  469. frm.ShowDialog();
  470. }
  471. }
  472. /// <summary>
  473. /// 点击列标头排序
  474. /// </summary>
  475. /// <param name="sender"></param>
  476. /// <param name="e"></param>
  477. void dgvData_ColumnHeaderMouseClick( object sender, DataGridViewCellMouseEventArgs e )
  478. {
  479. if ( e.Button == MouseButtons.Left )
  480. {
  481. string StrColumnName = GetOrderByName( this.dgvData.Columns[e.ColumnIndex].Name.Trim() );
  482. if ( StrColumnName == this.StrCurrentClickField || string.IsNullOrEmpty( this.StrCurrentClickField ) )
  483. {
  484. if ( this.StrSortOrder == "ASC" )
  485. {
  486. this.StrSortOrder = "DESC";
  487. }
  488. else
  489. {
  490. this.StrSortOrder = "ASC";
  491. }
  492. }
  493. else
  494. {
  495. this.StrSortOrder = "DESC";
  496. }
  497. if ( this.dgvData.StrValueNullColumn.Trim().IndexOf( StrColumnName ) == -1 || StrColumnName.Trim() == "欠款" || StrColumnName.Trim() == "套系金额" )
  498. {
  499. this.StrSortField = StrColumnName + " " + this.StrSortOrder + ",Ord_CreateDateTime,Ordv_DigitalNumber";
  500. }
  501. else
  502. {
  503. this.StrSortField = "Ord_CreateDateTime " + this.StrSortOrder + ",Ordv_DigitalNumber";
  504. }
  505. this.StrCurrentClickField = StrColumnName;
  506. //this.PublicFunctionRows();
  507. this.ucPagerEx1.PageCurrent = 1;
  508. this.ucPagerEx1.Bind();
  509. }
  510. }
  511. string GetOrderByName( string StrColumnName )
  512. {
  513. switch ( StrColumnName )
  514. {
  515. case "订单号": return "Ord_SinceOrderNumber";
  516. case "客户姓名": return "Cus_Name";
  517. case "客户性别": return "Cus_Sex_cs";
  518. case "客户电话": return "Cus_Telephone";
  519. case "订单类型": return "Ord_Type";
  520. case "接单人": return "Ord_OrderPersonName";
  521. case "套系名称": return "Ord_SeriesName";
  522. case "套系价格": return "Ord_SeriesPrice";
  523. case "加急": return "IsExpedited";
  524. case "加急日期": return "ExpeditedTime";
  525. case "拍摄名称": return "Ordpg_Sights";
  526. case "初修师": return "Ordv_EarlyRepairName";
  527. case "初修日期": return "Ordv_EarlyRepairTime";
  528. case "初修状态": return "Ordv_EarlyRepairStatus";
  529. case "选片状态": return "Ordv_FilmSelectionStatus";
  530. case "精修状态": return "Ordv_RefinementStatus";
  531. case "精修日期": return "Ordv_RefinementTime";
  532. case "设计状态": return "Ordv_DesignerStatus";
  533. case "设计师": return "Ordv_DesignerName";
  534. case "设计日期": return "Ordv_DesignerTime";
  535. case "看版师": return "Ordv_LookDesignName";
  536. case "看版日期": return "Ordv_LookDesignTime";
  537. case "看版状态": return "Ordv_LookDesignStatus";
  538. case "看版要求": return "Ordv_LookDesignClaim";
  539. case "取件状态": return "Ords_ProductPickupIntStatus";
  540. case "会员卡号": return "Mc_CradNumber";
  541. default: return "";
  542. }
  543. }
  544. /// <summary>
  545. /// 当前点击的字段
  546. /// </summary>
  547. string StrCurrentClickField = "";
  548. /// <summary>
  549. /// 排序字段
  550. /// </summary>
  551. string StrSortField = "Ord_CreateDateTime DESC,Ordv_DigitalNumber";
  552. /// <summary>
  553. /// 排序顺序
  554. /// </summary>
  555. string StrSortOrder = "DESC";
  556. /// <summary>
  557. /// 创建行
  558. /// </summary>
  559. void PublicFunctionRows()
  560. {
  561. this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number," +
  562. "Ord_Type," +
  563. "Ordv_ViceNumber," +
  564. "订单号," +
  565. "订单类型," +
  566. "客户姓名," +
  567. "客户性别," +
  568. "客户电话," +
  569. "接单人," +
  570. "套系名称," +
  571. "套系价格," +
  572. "欠款," +
  573. "加急," +
  574. "加急日期," +
  575. "拍摄名称," +
  576. "拍照状态," +
  577. "刻盘次数," +
  578. "初修状态," +
  579. "选片状态," +
  580. "精修状态," +
  581. "设计状态," +
  582. "设计日期," +
  583. "看版状态," +
  584. "看版日期," +
  585. "取件状态," +
  586. "会员卡号," +
  587. "百度云信息," +
  588. "客片上传状态";
  589. string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0006.ToString().Trim();
  590. if ( (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.MemberCardShowHide) )
  591. {
  592. this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type,会员卡号,百度云信息";
  593. }
  594. else
  595. {
  596. this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type,百度云信息";
  597. }
  598. this.dgvData.dgvGuidName = StrGuidName;
  599. this.dgvData.dgvUserEmployeeID = this.StrUserID;
  600. this.dgvData.StrValueNullColumn = "订单号,订单类型,客户姓名,客户性别,客户电话,接单人,套系名称,套系价格,欠款,会员卡号";
  601. this.dgvData.DataColumns( this.dgvData.dgvCurrentColumnOriginalSet, strHideField: this.dgvData.dgvFixedHideColumn );
  602. Dictionary<string, string> dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns( this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet );
  603. this.dgvData.dictShowColumName = dictColumns;
  604. string StrQueryCondition = "";
  605. if ( IsFirstRun && !string.IsNullOrEmpty( LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber ) )
  606. {
  607. string StrWhere = " Where Ord_SinceOrderNumber = '" + LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber + "'" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, StrOrdType: "0,1,2" );
  608. this.cmbQueryText.Text = LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber;
  609. StrQueryCondition = StrWhere + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhere( this.cmbtreevStoreName, "Ord_DividedShop" );
  610. }
  611. else
  612. {
  613. StrQueryCondition = this.GetWhereStr();
  614. }
  615. int intTopCount = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPageSize();
  616. Hashtable htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderKepan( this.dgvData, dictColumns, StrQueryCondition, intTopCount, this.StrSortField, ucPagerEx1.PageCurrent );
  617. this.dataGridViewStatisticsCount1.LocationX = this.dgvData.RowHeadersWidth;
  618. this.dataGridViewStatisticsCount1.CurrenQuantity = Convert.ToInt32( htData["CurrentCount"] );
  619. this.dataGridViewStatisticsCount1.TotalQuantity = Convert.ToInt32( htData["TotalCount"] );
  620. BindPageData( ucPagerEx1.PageCurrent, Convert.ToInt32( htData["CurrentCount"] ), Convert.ToInt32( htData["TotalCount"] ) );
  621. }
  622. /// <summary>
  623. /// 返回要操作的条件
  624. /// </summary>
  625. /// <returns></returns>
  626. string GetWhereStr()
  627. {
  628. string StrWhere = " Where Ord_Class = '1'" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere( this.cmbtreevStoreName, "Ord_DividedShop" );
  629. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetQueryTextQueryCondition( cmbQueryText.Text.Trim() );
  630. if ( chkCompleteOrder.Checked )
  631. {
  632. StrWhere += " and ( (Ords_ServiceIntStatus = 2 or ServiceCount=0 ) and (Ords_ProductPickupIntStatus = 2 or productCount=0 ) and (ServiceCount>0 or productCount>0) ) ";
  633. }
  634. else
  635. {
  636. if ( BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.HidePickUpOrder && !this.chkCompleteOrder.Checked && string.IsNullOrEmpty( this.cmbQueryText.Text ) )
  637. {
  638. StrWhere += " and (Ords_ProductPickupIntStatus in (0,1) and productCount>0 ) ";
  639. }
  640. else
  641. {
  642. StrWhere += " and ( (Ords_ServiceIntStatus in (0,1) and ServiceCount>0 ) or (Ords_ProductPickupIntStatus in (0,1) and productCount>0 ) or ( ServiceCount = 0 and productCount = 0 ) ) ";
  643. }
  644. }
  645. if ( DictData.ContainsKey( "FilmSelectionStatus" ) && DictData["FilmSelectionStatus"].Trim().Length > 0 )
  646. {
  647. StrWhere += " And Ordv_FilmSelectionStatus = '1'";
  648. }
  649. if ( this.chkArrears.Checked )
  650. {
  651. StrWhere += " And (套系金额 + isnull(加挑金额,0) - isnull(收款金额,0)) > 0";
  652. }
  653. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, StrOrdType: "0,1,2" );
  654. return StrWhere;
  655. }
  656. }
  657. }