PhotosPrintsFormMain.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  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 PhotosPrintsFormMain : LYFZ.Software.UI.DoorCityProcess.PhotosPrintsFormMain
  14. {
  15. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  16. public PhotosPrintsFormMain()
  17. {
  18. this.Shown += PhotosPrintsFormMain_Shown;
  19. this.Load += PhotosPrintsFormMain_Load;
  20. this.cmbtreevStoreName.ComboBoxTree_NodeMouseClick += cmbtreevStoreName_ComboBoxTree_NodeMouseClick;
  21. this.cmbQueryText.KeyDown += cmbQueryText_KeyDown;
  22. this.btnQuery.Click += btnQuery_Click;
  23. this.btnPhotoPrints.Click += btnPhotoPrints_Click;
  24. this.btnPhotofinishingMonth.Click += btnPhotofinishingMonth_Click;
  25. this.btnClose.Click += btnClose_Click;
  26. this.chkDressVersion.Click += chkDressVersion_Click;
  27. this.chkKidsVersion.Click += chkKidsVersion_Click;
  28. this.chkPortraitVersion.Click += chkPortraitVersion_Click;
  29. this.Resize += PhotosPrintsFormMain_Resize;
  30. this.dgvData.ColumnHeaderMouseClick += dgvData_ColumnHeaderMouseClick;
  31. this.dgvData.CellMouseDown += dgvData_CellMouseDown;
  32. this.dgvData.CellClick += dgvData_CellClick;
  33. this.dgvData.CellMouseDoubleClick += dgvData_CellMouseDoubleClick;
  34. this.dgvData.MouseDoubleClick += dgvData_MouseDoubleClick;
  35. this.btnReworkStatistics.Click += btnReworkStatistics_Click;
  36. this.flowLayoutPanel1.Height = 34;
  37. ///设计为冲印相片
  38. this.cbx_DesignNotPrint.Click += btnDesignNotPrint_Click;
  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. if (cbx_DesignNotPrint.Checked)
  53. {
  54. PublicFunctionRows(" Ordv_DesignerStatus=2 and Opps_PhotoName is null ");
  55. }
  56. else
  57. {
  58. PublicFunctionRows();
  59. }
  60. return ucPagerEx1.NMax;
  61. }
  62. public void BindPageData(int pageIndx, int pageSize, int totalCount)
  63. {
  64. ucPagerEx1.NMax = totalCount;
  65. ucPagerEx1.CurrentPageCount = (pageSize);
  66. ucPagerEx1.PageCurrent = pageIndx;
  67. }
  68. void btnDesignNotPrint_Click(object sender, EventArgs e)
  69. {
  70. //if (cbx_DesignNotPrint.Checked)
  71. //{
  72. // PublicFunctionRows(" Ordv_DesignerStatus=2 and Opps_PhotoName is null ");
  73. //}
  74. //else
  75. //{
  76. // PublicFunctionRows();
  77. //}
  78. this.ucPagerEx1.PageCurrent = 1;
  79. this.ucPagerEx1.Bind();
  80. }
  81. /// <summary>
  82. /// 是否首次运行
  83. /// </summary>
  84. bool IsFirstRun = true;
  85. /// <summary>
  86. /// 查询条件
  87. /// </summary>
  88. private Dictionary<string, string> DictData = new Dictionary<string, string>();
  89. /// <summary>
  90. /// 员工编号
  91. /// </summary>
  92. string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  93. /// <summary>
  94. /// 窗体加载事件
  95. /// </summary>
  96. /// <param name="sender"></param>
  97. /// <param name="e"></param>
  98. void PhotosPrintsFormMain_Shown(object sender, EventArgs e)
  99. {
  100. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName(this.cmbtreevStoreName, StrGroupKeyCode: "retailProcess", StrKeyCode: "st012");
  101. this.PublicFunctionRights();
  102. //this.PublicFunctionRows();
  103. this.PhotosPrintsFormMain_Resize(this, null);
  104. this.ucPagerEx1.Bind();
  105. this.IsFirstRun = false;
  106. bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(VersionControl.VersionFunctionEnum.订单相片冲印);
  107. if(!b)
  108. {
  109. this.Close();
  110. }
  111. }
  112. /// <summary>
  113. /// 窗体加载事件
  114. /// </summary>
  115. /// <param name="sender"></param>
  116. /// <param name="e"></param>
  117. void PhotosPrintsFormMain_Load(object sender, EventArgs e)
  118. {
  119. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetSystemVersion(this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion);
  120. }
  121. /// <summary>
  122. /// 选择分店获取权限
  123. /// </summary>
  124. void PublicFunctionRights()
  125. {
  126. this.btnPhotofinishingMonth.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresPhotosPrints, LYFZ.CustomAttributes.OperatingAuthority.PhotosPrints);
  127. }
  128. /// <summary>
  129. /// 分店选择查询数据
  130. /// </summary>
  131. /// <param name="sender"></param>
  132. /// <param name="e"></param>
  133. void cmbtreevStoreName_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
  134. {
  135. this.PublicFunctionRights();
  136. //this.PublicFunctionRows();
  137. this.ucPagerEx1.PageCurrent = 1;
  138. this.ucPagerEx1.Bind();
  139. }
  140. /// <summary>
  141. /// 回车
  142. /// </summary>
  143. /// <param name="sender"></param>
  144. /// <param name="e"></param>
  145. void cmbQueryText_KeyDown(object sender, KeyEventArgs e)
  146. {
  147. if (e.KeyCode == Keys.Enter)
  148. { this.btnQuery_Click(this, null); }
  149. }
  150. /// <summary>
  151. /// 查询
  152. /// </summary>
  153. /// <param name="sender"></param>
  154. /// <param name="e"></param>
  155. void btnQuery_Click(object sender, EventArgs e)
  156. {
  157. this.DictData.Clear();
  158. //this.PublicFunctionRows();
  159. this.ucPagerEx1.PageCurrent = 1;
  160. this.ucPagerEx1.Bind();
  161. }
  162. /// <summary>
  163. /// 返工统计
  164. /// </summary>
  165. /// <param name="sender"></param>
  166. /// <param name="e"></param>
  167. void btnReworkStatistics_Click(object sender, EventArgs e)
  168. {
  169. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.PhotofinishingReworkStatisticSmallForm frm = new SetSmallForm.PhotofinishingReworkStatisticSmallForm();
  170. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  171. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  172. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  173. frm.ShowDialog();
  174. }
  175. /// <summary>
  176. /// 数据列表双击事件
  177. /// </summary>
  178. /// <param name="sender"></param>
  179. /// <param name="e"></param>
  180. void dgvData_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
  181. {
  182. if (this.dgvData.Rows.Count > 0)
  183. {
  184. if (e.RowIndex != -1 && e.ColumnIndex != -1)
  185. {
  186. if (LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresPhotosPrints, LYFZ.CustomAttributes.OperatingAuthority.PhotosPrints))
  187. { this.btnPhotoPrints_Click(null, null); }
  188. }
  189. }
  190. }
  191. /// <summary>
  192. /// 相片冲印资料
  193. /// </summary>
  194. /// <param name="sender"></param>
  195. /// <param name="e"></param>
  196. void btnPhotoPrints_Click(object sender, EventArgs e)
  197. {
  198. if (this.dgvData.Rows.Count > 0)
  199. {
  200. if (this.dgvData.SelectedRows.Count > 0)
  201. {
  202. string ViceName = "";
  203. if (this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32(LYFZ.EnumPublic.OrderType.儿童订单).ToString().Trim())
  204. {
  205. try { ViceName = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim(); }
  206. catch { }
  207. }
  208. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.PhotofinishingManageSmallForm frm = new SetSmallForm.PhotofinishingManageSmallForm();
  209. Dictionary<string, string> DictDataArray = new Dictionary<string, string>();
  210. frm.EntViceNumber = this.dgvData.Rows[this.dgvData.CurrentRow.Index].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  211. frm.EntOrdNumber = this.dgvData.Rows[this.dgvData.CurrentRow.Index].Cells["Ord_Number"].Value.ToString().Trim();
  212. frm.StrSightsName = ViceName;
  213. frm.ShowDialog();
  214. if (frm.IsSaveed)
  215. {
  216. //this.PublicFunctionRows();
  217. this.ucPagerEx1.PageCurrent = 1;
  218. this.ucPagerEx1.Bind();
  219. }
  220. }
  221. else { MessageBoxCustom.Show("请选择订单"); return; }
  222. }
  223. }
  224. /// <summary>
  225. /// 本月冲印
  226. /// </summary>
  227. /// <param name="sender"></param>
  228. /// <param name="e"></param>
  229. void btnPhotofinishingMonth_Click(object sender, EventArgs e)
  230. {
  231. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.PhotofinishingMonthSmallForm frm = new SetSmallForm.PhotofinishingMonthSmallForm();
  232. frm.ShowDialog();
  233. }
  234. /// <summary>
  235. /// 关闭
  236. /// </summary>
  237. /// <param name="sender"></param>
  238. /// <param name="e"></param>
  239. void btnClose_Click(object sender, EventArgs e)
  240. { this.Close(); }
  241. /// <summary>
  242. /// 儿童版
  243. /// </summary>
  244. /// <param name="sender"></param>
  245. /// <param name="e"></param>
  246. void chkKidsVersion_Click(object sender, EventArgs e)
  247. {
  248. if (this.chkKidsVersion.Checked)
  249. { this.chkPortraitVersion.Checked = false; this.chkKidsVersion.Checked = true; this.chkDressVersion.Checked = false; }
  250. this.cmbQueryText.Text = "";
  251. //this.PublicFunctionRows();
  252. this.ucPagerEx1.PageCurrent = 1;
  253. this.ucPagerEx1.Bind();
  254. }
  255. /// <summary>
  256. /// 婚纱版
  257. /// </summary>
  258. /// <param name="sender"></param>
  259. /// <param name="e"></param>
  260. void chkDressVersion_Click(object sender, EventArgs e)
  261. {
  262. if (this.chkDressVersion.Checked)
  263. { this.chkPortraitVersion.Checked = false; this.chkDressVersion.Checked = true; this.chkKidsVersion.Checked = false; }
  264. this.cmbQueryText.Text = "";
  265. //this.PublicFunctionRows();
  266. this.ucPagerEx1.PageCurrent = 1;
  267. this.ucPagerEx1.Bind();
  268. }
  269. /// <summary>
  270. /// 写真版
  271. /// </summary>
  272. /// <param name="sender"></param>
  273. /// <param name="e"></param>
  274. void chkPortraitVersion_Click(object sender, EventArgs e)
  275. {
  276. if (this.chkPortraitVersion.Checked)
  277. { this.chkPortraitVersion.Checked = true; this.chkDressVersion.Checked = false; this.chkKidsVersion.Checked = false; }
  278. this.cmbQueryText.Text = "";
  279. //this.PublicFunctionRows();
  280. this.ucPagerEx1.PageCurrent = 1;
  281. this.ucPagerEx1.Bind();
  282. }
  283. /// <summary>
  284. /// 窗体大小发生改变事件
  285. /// </summary>
  286. /// <param name="sender"></param>
  287. /// <param name="e"></param>
  288. void PhotosPrintsFormMain_Resize(object sender, EventArgs e)
  289. {
  290. if (!this.IsFirstRun)
  291. {
  292. switch (this.panelPortraitVersion.Location.Y)
  293. {
  294. case 4: this.flowLayoutPanel1.Height = 36; break;
  295. case 36: this.flowLayoutPanel1.Height = 68; break;
  296. }
  297. }
  298. }
  299. /// <summary>
  300. /// 右键菜单
  301. /// </summary>
  302. /// <param name="sender"></param>
  303. /// <param name="e"></param>
  304. void dgvData_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
  305. {
  306. if (e.Button == MouseButtons.Right)
  307. {
  308. if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
  309. {
  310. ToolStripMenuItem item = new ToolStripMenuItem();
  311. Hashtable htData = new Hashtable();
  312. htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
  313. htData["StrViceNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  314. item.Text = "订单备注";
  315. item.Tag = htData;
  316. item.Name = "OrderRemark";
  317. this.dgvData.conMenu.Items.Add(item);
  318. // this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
  319. this.dgvData.conMenu.ItemClicked -= dgvData_DataGridViewConMenu_ItemClicked;
  320. this.dgvData.conMenu.ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
  321. //this.dgvData.conMenu.Show();
  322. if (!this.dgvData.conMenu.Visible)
  323. {
  324. this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
  325. }
  326. }
  327. else
  328. {
  329. this.dgvData.conMenu.Items.Clear();
  330. ToolStripMenuItem item = new ToolStripMenuItem();
  331. item.Text = "设置标题";
  332. item.Tag = "SetColumnShow";
  333. item.Name = "SetColumnShow";
  334. this.dgvData.conMenu.Items.Add(item);
  335. // this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
  336. this.dgvData.conMenu.ItemClicked -= dgvData_DataGridViewConMenu_ItemClicked;
  337. this.dgvData.conMenu.ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
  338. // this.dgvData.conMenu.Show();
  339. if (!this.dgvData.conMenu.Visible)
  340. {
  341. this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
  342. }
  343. }
  344. }
  345. }
  346. /// <summary>
  347. /// 列表单击事件
  348. /// </summary>
  349. /// <param name="sender"></param>
  350. /// <param name="e"></param>
  351. void dgvData_CellClick(object sender, DataGridViewCellEventArgs e)
  352. {
  353. try
  354. {
  355. string StrNumber = this.dgvData.CurrentRow.Cells["订单号"].Value.ToString().Trim();
  356. if (string.IsNullOrEmpty(StrNumber) || StrNumber.Trim() == "(取件OK)")
  357. {
  358. bool IsFind = false;
  359. int i = this.dgvData.CurrentRow.Index;
  360. while (!IsFind)
  361. {
  362. i = i - 1;
  363. if (!string.IsNullOrEmpty(this.dgvData.Rows[i].Cells["订单号"].Value.ToString().Trim()))
  364. { StrNumber = this.dgvData.Rows[i].Cells["订单号"].Value.ToString().Trim(); IsFind = true; }
  365. }
  366. }
  367. LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = StrNumber;
  368. }
  369. catch
  370. { }
  371. }
  372. /// <summary>
  373. /// 对列表控件双击事件
  374. /// </summary>
  375. /// <param name="sender"></param>
  376. /// <param name="e"></param>
  377. void dgvData_MouseDoubleClick(object sender, MouseEventArgs e)
  378. {
  379. Point hit = this.dgvData.PointToClient(Cursor.Position);
  380. DataGridView.HitTestInfo hitTest = this.dgvData.HitTest(hit.X, hit.Y);
  381. if (hitTest.RowIndex < 0 && hitTest.ColumnIndex < 0)
  382. {
  383. if (!string.IsNullOrEmpty(this.cmbQueryText.Text.Trim()))
  384. {
  385. LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = "";
  386. this.cmbQueryText.Text = "";
  387. //this.PublicFunctionRows();
  388. this.ucPagerEx1.PageCurrent = 1;
  389. this.ucPagerEx1.Bind();
  390. }
  391. }
  392. }
  393. /// <summary>
  394. /// 右键菜单选择项事件
  395. /// </summary>
  396. /// <param name="sender"></param>
  397. /// <param name="e"></param>
  398. void dgvData_DataGridViewConMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
  399. {
  400. ToolStripItem item = e.ClickedItem;
  401. if (item.Name.Trim() == "SetColumnShow")
  402. {
  403. if (LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ShowDataGridViewSetColumn(this.dgvData))
  404. {
  405. //this.PublicFunctionRows();
  406. this.ucPagerEx1.PageCurrent = 1;
  407. this.ucPagerEx1.Bind();
  408. }
  409. }
  410. else if (item.Name.ToString().Trim() == "OrderRemark")
  411. {
  412. Hashtable htData = (Hashtable)item.Tag;
  413. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OrderRemarkRecordAddSuperSmallForm frm = new SuperSmallForm.OrderRemarkRecordAddSuperSmallForm();
  414. frm.StrOrderNumber = htData["StrNumber"].ToString().Trim();
  415. frm.StrOrdViceNumber = htData["StrViceNumber"].ToString().Trim();
  416. frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.相片冲印.ToString().Trim();
  417. frm.ShowDialog();
  418. }
  419. }
  420. /// <summary>
  421. /// 点击列标头排序
  422. /// </summary>
  423. /// <param name="sender"></param>
  424. /// <param name="e"></param>
  425. void dgvData_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
  426. {
  427. if (e.Button == MouseButtons.Left)
  428. {
  429. string StrColumnName = GetOrderByName(this.dgvData.Columns[e.ColumnIndex].Name.Trim());
  430. if (StrColumnName == this.StrCurrentClickField || string.IsNullOrEmpty(this.StrCurrentClickField))
  431. {
  432. if (this.StrSortOrder == "ASC")
  433. { this.StrSortOrder = "DESC"; }
  434. else
  435. { this.StrSortOrder = "ASC"; }
  436. }
  437. else
  438. { this.StrSortOrder = "DESC"; }
  439. if (this.dgvData.StrValueNullColumn.Trim().IndexOf(StrColumnName) == -1 || StrColumnName.Trim() == "欠款" || StrColumnName.Trim() == "套系金额")
  440. { this.StrSortField = StrColumnName + " " + this.StrSortOrder + ",Ord_CreateDateTime,Ordv_DigitalNumber,tb_ErpOrderPhotoPrints.ID"; }
  441. else
  442. { this.StrSortField = "Ord_CreateDateTime " + this.StrSortOrder + ",Ordv_DigitalNumber,tb_ErpOrderPhotoPrints.ID"; }
  443. this.StrCurrentClickField = StrColumnName;
  444. //this.PublicFunctionRows();
  445. this.ucPagerEx1.PageCurrent = 1;
  446. this.ucPagerEx1.Bind();
  447. }
  448. }
  449. string GetOrderByName(string StrColumnName)
  450. {
  451. switch (StrColumnName)
  452. {
  453. case "订单号": return "Ord_SinceOrderNumber";
  454. case "客户姓名": return "Cus_Name";
  455. case "客户性别": return "Cus_Sex_cs";
  456. case "客户电话": return "Cus_Telephone";
  457. case "订单类型": return "Ord_Type";
  458. case "接单人": return "Ord_OrderPersonName";
  459. case "套系名称": return "Ord_SeriesName";
  460. case "套系价格": return "Ord_SeriesPrice";
  461. case "加急": return "IsExpedited";
  462. case "加急日期": return "ExpeditedTime";
  463. case "拍摄名称": return "Ordpg_Sights";
  464. case "拍照状态": return "Ordpg_PhotographyStatus";
  465. case "初修师": return "Ordv_EarlyRepairName";
  466. case "初修日期": return "Ordv_EarlyRepairTime";
  467. case "初修状态": return "Ordv_EarlyRepairStatus";
  468. case "选片状态": return "Ordv_FilmSelectionStatus";
  469. case "精修状态": return "Ordv_RefinementStatus";
  470. case "精修日期": return "Ordv_RefinementTime";
  471. case "设计状态": return "Ordv_DesignerStatus";
  472. case "设计师": return "Ordv_DesignerName";
  473. case "设计日期": return "Ordv_DesignerTime";
  474. case "看版师": return "Ordv_LookDesignName";
  475. case "看版日期": return "Ordv_LookDesignTime";
  476. case "看版状态": return "Ordv_LookDesignStatus";
  477. case "看版要求": return "Ordv_LookDesignClaim";
  478. case "取件状态": return "Ords_ProductPickupIntStatus";
  479. case "相片名称": return "Opps_PhotoName";
  480. case "数量": return "Opps_PhotoQuantity";
  481. case "面积": return "Opps_PhotoArea";
  482. case "发出状态": return "Opps_SendVendor";
  483. case "发出日期": return "Opps_SendTime";
  484. case "返工状态": return "Opps_ReworkStatus";
  485. case "返工日期": return "Opps_ReworkTime";
  486. case "完成状态": return "Opps_CompletedStatus";
  487. case "完成日期": return "Opps_CompletedTime";
  488. case "会员卡号": return "Mc_CradNumber";
  489. default: return "";
  490. }
  491. }
  492. /// <summary>
  493. /// 当前点击的字段
  494. /// </summary>
  495. string StrCurrentClickField = "";
  496. /// <summary>
  497. /// 排序字段
  498. /// </summary>
  499. string StrSortField = "Ord_CreateDateTime DESC,Ordv_DigitalNumber,tb_ErpOrderPhotoPrints.ID";
  500. /// <summary>
  501. /// 排序顺序
  502. /// </summary>
  503. string StrSortOrder = "DESC";
  504. /// <summary>
  505. /// 创建行
  506. /// </summary>
  507. void PublicFunctionRows(string sqlWhere ="" )
  508. {
  509. this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number,Ord_Type,Ordv_ViceNumber,订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,加急,加急日期,拍摄名称,拍照状态,设计状态,设计师,设计日期,看版状态,看版师,看版日期,相片名称,数量,面积,发出状态,发出日期,返工状态,返工日期,完成状态,完成日期,取件状态,会员卡号";
  510. string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0007.ToString().Trim();
  511. if ((LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.MemberCardShowHide))
  512. {
  513. this.dgvData.dgvFixedHideColumn = "Ord_Number,Ord_Type,Ordv_ViceNumber,会员卡号";
  514. }
  515. else
  516. {
  517. this.dgvData.dgvFixedHideColumn = "Ord_Number,Ord_Type,Ordv_ViceNumber";
  518. }
  519. this.dgvData.dgvGuidName = StrGuidName;
  520. this.dgvData.dgvUserEmployeeID = this.StrUserID;
  521. this.dgvData.StrValueNullColumn = "订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,会员卡号";
  522. this.dgvData.StrSecondStageNull = "加急,加急日期,拍摄名称,拍照状态,设计状态,设计师,设计日期,看版状态,看版师,看版日期,取件状态";
  523. this.dgvData.DataColumns(this.dgvData.dgvCurrentColumnOriginalSet, strHideField: this.dgvData.dgvFixedHideColumn);
  524. Dictionary<string, string> dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns(this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet);
  525. this.dgvData.dictShowColumName = dictColumns;
  526. string StrQueryCondition = "";
  527. if (IsFirstRun && !string.IsNullOrEmpty(LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber))
  528. {
  529. this.cmbQueryText.Text = LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber;
  530. DataTable dt = orbll.GetView_Custom("tb_ErpOrder", StrWhere: "Ord_SinceOrderNumber = '" + LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber + "' And Ord_Type in ('0','1','2')", ShowColumnName: "ID").Tables[0];
  531. if (dt.Rows.Count <= 0)
  532. { this.dgvData.DataColumns(this.dgvData.dgvCurrentColumnOriginalSet, this.dgvData.dgvFixedHideColumn); return; }
  533. else
  534. {
  535. 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");
  536. StrQueryCondition = StrWhere + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhere(this.cmbtreevStoreName, "Ord_DividedShop");
  537. }
  538. }
  539. else
  540. { StrQueryCondition = this.GetWhereStr(); }
  541. if(!string.IsNullOrEmpty(sqlWhere))
  542. {
  543. if(!string.IsNullOrEmpty(StrQueryCondition))
  544. {
  545. StrQueryCondition += " and " + sqlWhere;
  546. }
  547. else
  548. {
  549. StrQueryCondition += " where " + sqlWhere;
  550. }
  551. }
  552. int intTopCount = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPageSize();
  553. List<string> listColumns = new List<string>(StrSortField.Replace(" DESC", "").Replace(" ASC", "").Split(','));
  554. Hashtable htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderPhotosPrints(this.dgvData, dictColumns, listColumns, StrQueryCondition, intTopCount, this.StrSortField, ucPagerEx1.PageCurrent);
  555. this.dataGridViewStatisticsCount1.LocationX = this.dgvData.RowHeadersWidth;
  556. this.dataGridViewStatisticsCount1.CurrenQuantity = Convert.ToInt32(htData["CurrentCount"]);
  557. this.dataGridViewStatisticsCount1.TotalQuantity = Convert.ToInt32(htData["TotalCount"]);
  558. BindPageData(ucPagerEx1.PageCurrent, Convert.ToInt32(htData["CurrentCount"]), Convert.ToInt32(htData["TotalCount"]));
  559. }
  560. /// <summary>
  561. /// 返回要操作的条件
  562. /// </summary>
  563. /// <returns></returns>
  564. string GetWhereStr()
  565. {
  566. string StrWhere = " Where Ord_Class = '1' " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Ord_DividedShop");
  567. if (chkCompleteOrder.Checked)
  568. {
  569. StrWhere += " and ( (Ords_ServiceIntStatus = 2 or ServiceCount=0 ) and (Ords_ProductPickupIntStatus = 2 or productCount=0 ) and (ServiceCount>0 or productCount>0) ) ";
  570. }
  571. else
  572. {
  573. if (BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.HidePickUpOrder && !this.chkCompleteOrder.Checked && string.IsNullOrEmpty(this.cmbQueryText.Text))
  574. {
  575. StrWhere += " and (Ords_ProductPickupIntStatus in (0,1) and productCount>0 ) ";
  576. }
  577. else
  578. {
  579. 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 ) ) ";
  580. }
  581. }
  582. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetQueryTextQueryCondition(this.cmbQueryText.Text.Trim());
  583. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL(this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, StrOrdType: "0,1,2");
  584. return StrWhere;
  585. }
  586. }
  587. }