RepairPieceFormMain.cs 69 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465
  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 System.IO;
  11. using LYFZ.ComponentLibrary;
  12. using LYFZ.Helper;
  13. using LYFZ.Model;
  14. using System.Diagnostics;
  15. namespace LYFZ.Software.MainBusiness.DoorCityProcess
  16. {
  17. public partial class RepairPieceFormMain : LYFZ.Software.UI.DoorCityProcess.RepairPieceFormMain
  18. {
  19. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  20. LYFZ.BLL.BLL_ErpOrderDigital dbll = new BLL.BLL_ErpOrderDigital();
  21. LYFZ.BLL.BLL_ErpSystemLogs slogbll = new BLL.BLL_ErpSystemLogs();
  22. LYFZ.BLL.BLL_ErpOrderDigital orvbll = new BLL.BLL_ErpOrderDigital();
  23. LYFZ.BLL.BLL_ErpOrderDigitalStatus orsbll = new BLL.BLL_ErpOrderDigitalStatus();
  24. #region 2017-03-18 杨云奕 添加 获取门店配置的ftp情况
  25. BLL.BaseBLL.BaseBLL_FTPServiceUserAccount ftpbll = new BLL.BaseBLL.BaseBLL_FTPServiceUserAccount();
  26. DataSet ftpData;
  27. #endregion
  28. #region OSS云传片
  29. bool useOss = false;
  30. List<AliyunOssLibrary.Model.SimplifyBranch> listbranch = null;
  31. #endregion
  32. #region 2017-03-18 杨云奕 添加 如果有定义ftp则将上传功能显示
  33. /// <summary>
  34. /// 右键添加上传功能
  35. /// </summary>
  36. /// <param name="orNumber"></param>
  37. void BindContextMenu( DataGridViewRow dataGridViewRow )
  38. {
  39. #region 获取OSS信息;
  40. //if (LYFZ.Network.OssOperation.OssProcess.GetOssBranchList(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.TcpClient.Client, out this.listbranch, ref this.useOss))
  41. if ( LYFZ.Network.OssOperation.OssProcess.GetOssStatus( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.TcpClient.Client, ref this.useOss ) )
  42. {
  43. if ( this.useOss )
  44. {
  45. Network.OssOperation.OssProcess.GetOssBranchList( out this.listbranch, ref this.useOss );
  46. }
  47. }
  48. #endregion
  49. if ( this.useOss )
  50. {
  51. ToolStripMenuItem item = new ToolStripMenuItem();
  52. item.Text = "上传订单:" + dataGridViewRow.Cells["Ord_Number"].Value.ToString();
  53. item.Name = "UpFtp";
  54. item.Tag = dataGridViewRow;
  55. item.Click += item_Click;
  56. this.dgvData.conMenu.Items.Add( item );
  57. }
  58. else
  59. {
  60. if ( ftpData.Tables[0].Rows.Count > 0 )
  61. {
  62. ToolStripMenuItem item = new ToolStripMenuItem();
  63. item.Text = "上传订单:" + dataGridViewRow.Cells["Ord_Number"].Value.ToString();
  64. item.Name = "UpFtp";
  65. item.Tag = dataGridViewRow;
  66. item.Click += item_Click;
  67. //ToolStripMenuItem[] subItem = new ToolStripMenuItem[ftpData.Tables[0].Rows.Count];
  68. //for (int i = 0; i < ftpData.Tables[0].Rows.Count; i++)
  69. //{
  70. // DataRow dr = ftpData.Tables[0].Rows[i];
  71. // subItem[i] = new ToolStripMenuItem();
  72. // subItem[i].Text = "至" + dr["Company_Name"].ToString() + "(" + dr["FTP_Name"].ToString() + ")账户";
  73. // dataGridViewRow.Tag = dr;
  74. // subItem[i].Tag = dataGridViewRow;
  75. // subItem[i].Click += ToolStripMenuItem_Click;
  76. //}
  77. //item
  78. this.dgvData.conMenu.Items.AddRange( new ToolStripItem[] { item } );
  79. //List<ToolStripItem> dropDownList = new List<ToolStripItem>();
  80. //for (int i = 0; i < subItem.Length; i++)
  81. //{
  82. // dropDownList.Add(subItem[i]);
  83. //}
  84. //item.DropDownItems.AddRange(dropDownList.ToArray());
  85. }
  86. }
  87. }
  88. void item_Click( object sender, EventArgs e )
  89. {
  90. FTPUpFileForm ftpForm = new FTPUpFileForm();
  91. if ( this.useOss )
  92. {
  93. ftpForm.Text = "云传片";
  94. ftpForm.UseOss = true;
  95. ftpForm.ListBranch = this.listbranch;
  96. }
  97. DataGridViewRow dgvr = (DataGridViewRow)((ToolStripMenuItem)sender).Tag;
  98. LYFZ.BLL.BLL_ErpOrdersPhotography pbll = new BLL.BLL_ErpOrdersPhotography();
  99. //拍摄景点
  100. DataTable tbl = pbll.GetList( "Ordpg_Number='" + dgvr.Cells["Ord_Number"].Value.ToString() + "'" ).Tables[0];
  101. string _Type = dgvr.Cells["Ord_Type"].Value.ToString();
  102. string LoadType = "初修";
  103. string signName = "";
  104. string SightsName = "";
  105. if ( _Type == "1" )
  106. {
  107. if ( tbl.Rows.Count > 0 )
  108. {
  109. for ( int i = 0; i < tbl.Rows.Count; i++ )
  110. {
  111. SightsName += tbl.Rows[i]["Ordpg_Sights"].ToString() + ",";
  112. }
  113. }
  114. signName = SightsName.TrimEnd( ',' );
  115. }
  116. else if ( _Type != "1" )
  117. {
  118. if ( tbl.Rows.Count > 0 )
  119. {
  120. for ( int i = 0; i < tbl.Rows.Count; i++ )
  121. {
  122. SightsName += tbl.Rows[i]["Ordpg_Sights"].ToString() + (LoadType == "原片" ? "," : ",");
  123. }
  124. }
  125. signName = SightsName.TrimEnd( ',' );
  126. }
  127. else
  128. {
  129. signName = dgvr.Cells["拍摄名称"].Value.ToString();
  130. }
  131. string[] str = signName.Split( ',' );
  132. foreach ( var item in str )
  133. {
  134. CheckBoxEx cb = new CheckBoxEx();
  135. cb.Text = item;
  136. ftpForm.AddCheckBoxModel( cb );
  137. cb.Checked = true;
  138. }
  139. ftpForm.BindData( dgvr.Cells["Ord_Number"].Value.ToString(), dgvr.Cells["Ordv_ViceNumber"].Value.ToString(),
  140. _Type, "初修", "" );
  141. ftpForm.AddCheckBoxByFtpInfo( null );
  142. if ( ftpForm.ShowDialog() == System.Windows.Forms.DialogResult.OK )
  143. {
  144. }
  145. //throw new NotImplementedException();
  146. }
  147. /// <summary>
  148. /// 上传项点击事件
  149. /// </summary>
  150. /// <param name="sender"></param>
  151. /// <param name="e"></param>
  152. void ToolStripMenuItem_Click( object sender, EventArgs e )
  153. {
  154. FTPUpFileForm ftpForm = new FTPUpFileForm();
  155. DataGridViewRow dataRow = (DataGridViewRow)((ToolStripMenuItem)sender).Tag;
  156. bool findR = false;
  157. for ( int i = 0; i < this.dgvData.Rows.Count; i++ )
  158. {
  159. DataGridViewRow dgvr = this.dgvData.Rows[i];
  160. if ( this.dgvData.Rows[i].Cells["Ord_Number"].Value.ToString() == dataRow.Cells["Ord_Number"].Value.ToString() )
  161. {
  162. findR = true;
  163. }
  164. else
  165. {
  166. if ( findR )
  167. {
  168. break;
  169. }
  170. }
  171. if ( findR )
  172. {
  173. ftpForm.AddCheckBoxModel( new CheckBoxEx()
  174. {
  175. Text = this.dgvData.Rows[i].Cells["拍摄名称"].Value.ToString(),
  176. Tag = dataRow,
  177. Checked = (dataRow.Cells["拍摄名称"].Value.ToString() == this.dgvData.Rows[i].Cells["拍摄名称"].Value.ToString())
  178. } );
  179. }
  180. }
  181. DataRow dr = ((DataRow)dataRow.Tag);
  182. ftpForm.BindData( dataRow, "初修", dr["Company_Name"].ToString() + "(" + dr["FTP_Name"].ToString() + ")账户" );
  183. if ( ftpForm.ShowDialog() == System.Windows.Forms.DialogResult.OK )
  184. {
  185. }
  186. }
  187. #endregion
  188. #region 设置版本权隐藏字段
  189. string versionHideString = "";
  190. #endregion
  191. public RepairPieceFormMain()
  192. {
  193. this.Shown += RepairPieceFormMain_Shown;
  194. this.Load += RepairPieceFormMain_Load;
  195. this.cmbtreevStoreName.ComboBoxTree_NodeMouseClick += cmbtreevStoreName_ComboBoxTree_NodeMouseClick;
  196. this.cmbQueryText.KeyDown += cmbQueryText_KeyDown;
  197. this.btnQuery.Click += btnQuery_Click;
  198. this.btnExportRepairedPiece.Click += btnExportRepairedPiece_Click;
  199. this.btnSeparatedPhoto.Click += btnSeparatedPhoto_Click;
  200. this.btnHasShotNoRepair.Click += btnHasShotNoRepair_Click;
  201. this.btnConditionQuery.Click += btnConditionQuery_Click;
  202. this.btnExportingZOOM.Click += btnExportingZOOM_Click;
  203. this.btnImportRepairedPiece.Click += btnImportRepairedPiece_Click;
  204. this.btnViewRepairedPiece.Click += btnViewRepairedPiece_Click;
  205. this.btnOutSendRepairPiece.Click += btnOutSendRepairPiece_Click;
  206. this.btnClose.Click += btnClose_Click;
  207. this.chkDressVersion.Click += chkDressVersion_Click;
  208. this.chkKidsVersion.Click += chkKidsVersion_Click;
  209. this.chkPortraitVersion.Click += chkPortraitVersion_Click;
  210. this.Resize += RepairPieceFormMain_Resize;
  211. this.dgvData.CellMouseDoubleClick += dgvData_CellMouseDoubleClick;
  212. this.dgvData.CellMouseDown += dgvData_CellMouseDown;
  213. this.dgvData.CellClick += dgvData_CellClick;
  214. this.dgvData.MouseDoubleClick += dgvData_MouseDoubleClick;
  215. this.dgvData.ColumnHeaderMouseClick += dgvData_ColumnHeaderMouseClick;
  216. if ( !BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.IsEnablePhotoStyle )
  217. {
  218. this.btnSeparatedPhoto.Visible = false;
  219. }
  220. this.flowLayoutPanel1.Height = 34;
  221. ///获取门店ftp账户
  222. ftpData = ftpbll.GetList2( "" );
  223. ucPagerEx1.EventPaging += ucPagerEx1_EventPaging;
  224. chkCompleteOrder.Click += ChkCompleteOrder_Click;
  225. this.btn_CusOssUpload.Click += Btn_CusOssUpload_Click;
  226. this.btn_CusOssUpload.Visible = false;
  227. this.btn_Repair.Click += Btn_Repair_Click;
  228. }
  229. private void Btn_Repair_Click(object sender, EventArgs e)
  230. {
  231. SuperSmallForm.RefinedRepairOutStatistics frmBll = new SuperSmallForm.RefinedRepairOutStatistics();
  232. frmBll.frmType = "初修";
  233. frmBll.ShowDialog();
  234. }
  235. /// <summary>
  236. /// 客照云传;
  237. /// </summary>
  238. /// <param name="sender"></param>
  239. /// <param name="e"></param>
  240. private void Btn_CusOssUpload_Click( object sender, EventArgs e )
  241. {
  242. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  243. {
  244. backgroundWorker.ReportProgress( 0, "正在上传中,请稍等..." );
  245. // 选中行;
  246. if ( this.dgvData.SelectedRows.Count == 0 )
  247. {
  248. MessageBoxCustom.Show( "请选择要上传的客照" );
  249. return;
  250. }
  251. if ( !OssTask.frmOssTask.IsExistsEnterpriseID() )
  252. {
  253. MessageBoxCustom.Show( "未注册企业ID,请联系服务商注册" );
  254. return;
  255. }
  256. // 选择os type;
  257. /*OssTask.frmChooseOsType dlg = new OssTask.frmChooseOsType();
  258. if ( DialogResult.OK != dlg.ShowDialog() )
  259. {
  260. return;
  261. }*/
  262. // 选择第一行;
  263. DataGridViewRow row = this.dgvData.SelectedRows[0];
  264. // 订单号;
  265. string strOrderNumber = row.Cells["Ord_Number"].Value.ToString();
  266. // 订单类型;
  267. string strOrderType = row.Cells["订单类型"].Value.ToString();
  268. // 副订单号;
  269. string strViceOrderNumber = row.Cells["Ordv_ViceNumber"].Value.ToString();
  270. // 客户姓名;
  271. string strCusNames = row.Cells["客户姓名"].Value.ToString();
  272. // 客户性别;
  273. string strCusGenders = row.Cells["客户性别"].Value.ToString();
  274. // 客户电话;
  275. string strCusPhones = row.Cells["客户电话"].Value.ToString();
  276. // 相片类型;
  277. string strPhotosType = "初修";
  278. // 拍摄名称;
  279. string strScenery = "";
  280. if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString().Trim() )
  281. {
  282. try
  283. {
  284. strScenery = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim();
  285. }
  286. catch { }
  287. }
  288. // 上传的相片;
  289. List<string> listPhotos = null;
  290. if ( !LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.UseBaiduShareUrl )
  291. {
  292. BLL.SelectPhotoHandling photoHandling = new BLL.SelectPhotoHandling( orbll.GetModel( "Ord_Number", strOrderNumber ), dbll.GetModel( "Ordv_ViceNumber", strViceOrderNumber ) );
  293. listPhotos = photoHandling.GetSpecifyTypePhotoList( Model.Model_ErpOrder.DirectoryType.EarlyRetouch, BLL.SelectPhotoHandling.PhotoType.Original, strScenery );
  294. // 生成任务;
  295. if ( listPhotos == null || listPhotos.Count == 0 )
  296. {
  297. MessageBoxCustom.Show( "该订单没有相片,不生成任务" );
  298. return;
  299. }
  300. }
  301. /*if ( LYFZ.Software.MainBusiness.OssTask.frmOssTask.GenerateOssTaskEx(
  302. dlg.cb_baidu.Checked ? 2 : -1,
  303. dlg.dtp_expire.Value.ToString( "yyyy-MM-dd 00:00:00" ),
  304. Convert.ToInt32( dlg.dup_times.SelectedItem ),
  305. strOrderNumber, strOrderType, strCusNames, strCusGenders, strCusPhones, strPhotosType, strScenery, listPhotos ) )
  306. {
  307. MessageBoxCustom.Show( "任务生成成功!" );
  308. }*/
  309. OssTask.JsonOssTask jsonOssTask = LYFZ.Software.MainBusiness.OssTask.frmOssTask.GenerateOssTask(
  310. //dlg.cb_baidu.Checked ? 2 : -1,
  311. LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.UseBaiduShareUrl ? 2 : -1,
  312. //dlg.dtp_expire.Value.ToString( "yyyy-MM-dd 00:00:00" ),
  313. DateTime.Now.AddMonths( 1 ).ToString( "yyyy-MM-dd 00:00:00" ),
  314. //Convert.ToInt32( dlg.dup_times.SelectedItem ),
  315. 1,
  316. strOrderNumber, "子订单号", strOrderType, strCusNames, strCusGenders, strCusPhones, strPhotosType, strScenery, listPhotos );
  317. if ( jsonOssTask != null )
  318. {
  319. // 如果任务列表空,加载任务;
  320. //if ( OssTask.frmOssTask.IsTaskListNullOrEmpty() )
  321. /*{
  322. // 从服务器加载文件数据;
  323. List<string> listJson;
  324. if ( LYFZ.Network.PlatinumClientProcess.GetOssTaskInfoFromSvr( out listJson ) )
  325. {
  326. OssTask.frmOssTask.LoadOssTask2( listJson );
  327. }
  328. }*/
  329. // 是否存在;
  330. //if ( OssTask.frmOssTask.IsTaskExists( jsonOssTask ) )
  331. string strJson;
  332. if ( LYFZ.Network.PlatinumClientProcess.IsOssTaskInfoExists( jsonOssTask.TaskID, out strJson ) )
  333. {// 任务已存在;
  334. MessageBoxCustom.Show( "任务已存在, 若要重新上传, 请到服务端删除任务再上传!" );
  335. }
  336. else
  337. {// 新增任务;
  338. if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.UseBaiduShareUrl )
  339. {
  340. LYFZ.Software.MainBusiness.OssTask.frmBaiduShareUrl frm = new OssTask.frmBaiduShareUrl();
  341. frm.ShowDialog();
  342. if ( frm.DialogResult == DialogResult.OK )
  343. {
  344. jsonOssTask.BaiduExtrCode = frm.tx_code.Text;
  345. jsonOssTask.BaiduShareUrl = frm.tx_url.Text;
  346. OssTask.frmOssTask.SendBaiduShare2WebSrv( jsonOssTask );
  347. }
  348. else
  349. {
  350. return;
  351. }
  352. }
  353. else
  354. {
  355. if ( OssTask.frmOssTask.SendOssTask2Svr( jsonOssTask ) )
  356. {
  357. OssTask.frmOssTask.PushTask( jsonOssTask );
  358. MessageBoxCustom.Show( "任务生成成功!" );
  359. }
  360. else
  361. {
  362. MessageBoxCustom.Show( "任务生成失败!" );
  363. }
  364. }
  365. }
  366. }
  367. } );
  368. }
  369. private void ChkCompleteOrder_Click( object sender, EventArgs e )
  370. {
  371. this.ucPagerEx1.PageCurrent = 1;
  372. ucPagerEx1.Bind();
  373. }
  374. int ucPagerEx1_EventPaging( UCPager.EventPagingArg e )
  375. {
  376. //pageData.PageSize = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReportFormPageSize;
  377. this.ucPagerEx1.PageSize = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReportFormPageSize;
  378. PublicFunctionRows();
  379. return ucPagerEx1.NMax;
  380. }
  381. public void BindPageData( int pageIndx, int pageSize, int totalCount )
  382. {
  383. ucPagerEx1.NMax = totalCount;
  384. ucPagerEx1.CurrentPageCount = (pageSize);
  385. ucPagerEx1.PageCurrent = pageIndx;
  386. }
  387. /// <summary>
  388. /// 订单号(用于开单处跳转过来)
  389. /// </summary>
  390. public string StrOrdNumber = "";
  391. /// <summary>
  392. /// 是否首次运行
  393. /// </summary>
  394. bool IsFirstRun = true;
  395. /// <summary>
  396. /// 查询条件
  397. /// </summary>
  398. private Dictionary<string, string> DictData = new Dictionary<string, string>();
  399. /// <summary>
  400. /// 员工编号
  401. /// </summary>
  402. string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  403. /// <summary>
  404. /// 员工姓名
  405. /// </summary>
  406. string StrUserName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
  407. /// <summary>
  408. /// 窗体加载
  409. /// </summary>
  410. /// <param name="sender"></param>
  411. /// <param name="e"></param>
  412. void RepairPieceFormMain_Shown( object sender, EventArgs e )
  413. {
  414. ///重拍功能的的版本权限
  415. List<Control> hideControl = new List<Control>();
  416. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  417. hideControl.Add( this.btnSeparatedPhoto );
  418. bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  419. LYFZ.Software.MainBusiness.VersionControl.VersionFunctionEnum.订单修片分片,
  420. hideControl, null, null );
  421. hideControl = new List<Control>();
  422. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  423. hideControl.Add( this.btnOutSendRepairPiece );
  424. b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  425. LYFZ.Software.MainBusiness.VersionControl.VersionFunctionEnum.订单修片外发修片,
  426. hideControl, null, null );
  427. if ( !b )
  428. {
  429. versionHideString = ",初修是否外发";
  430. }
  431. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName( this.cmbtreevStoreName, StrGroupKeyCode: "retailProcess", StrKeyCode: "st007" );
  432. this.PublicFunctionRights();
  433. //this.PublicFunctionRows();
  434. ucPagerEx1.Bind();
  435. this.IsFirstRun = false;
  436. this.RepairPieceFormMain_Resize( null, null );
  437. }
  438. /// <summary>
  439. /// 窗体加载事件
  440. /// </summary>
  441. /// <param name="sender"></param>
  442. /// <param name="e"></param>
  443. void RepairPieceFormMain_Load( object sender, EventArgs e )
  444. {
  445. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetSystemVersion( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion );
  446. this.cmbQueryText.Text = this.StrOrdNumber;
  447. }
  448. /// <summary>
  449. /// 选择分店获取权限
  450. /// </summary>
  451. void PublicFunctionRights()
  452. {
  453. this.btnExportingZOOM.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresPhotograph", LYFZ.CustomAttributes.OperatingAuthority.PhotoExport );
  454. this.btnImportRepairedPiece.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresRepairPiece", LYFZ.CustomAttributes.OperatingAuthority.PhotoImport );
  455. this.btnExportRepairedPiece.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresRepairPiece", LYFZ.CustomAttributes.OperatingAuthority.PhotoExport );
  456. this.btnViewRepairedPiece.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresRepairPiece", LYFZ.CustomAttributes.OperatingAuthority.PhotoView );
  457. this.btnSeparatedPhoto.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresRepairPiece", LYFZ.CustomAttributes.OperatingAuthority.RepairPieceSeparatePhoto );
  458. this.btnOutSendRepairPiece.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresPhotograph", LYFZ.CustomAttributes.OperatingAuthority.PhotoExport );
  459. }
  460. /// <summary>
  461. /// 分店选择查询数据
  462. /// </summary>
  463. /// <param name="sender"></param>
  464. /// <param name="e"></param>
  465. void cmbtreevStoreName_ComboBoxTree_NodeMouseClick( object sender, TreeNodeMouseClickEventArgs e )
  466. {
  467. this.PublicFunctionRights();
  468. //this.PublicFunctionRows();
  469. this.ucPagerEx1.PageCurrent = 1;
  470. ucPagerEx1.Bind();
  471. }
  472. /// <summary>
  473. /// 回车
  474. /// </summary>
  475. /// <param name="sender"></param>
  476. /// <param name="e"></param>
  477. void cmbQueryText_KeyDown( object sender, KeyEventArgs e )
  478. {
  479. if ( e.KeyCode == Keys.Enter )
  480. {
  481. this.btnQuery_Click( this, null );
  482. }
  483. }
  484. /// <summary>
  485. /// 查询
  486. /// </summary>
  487. /// <param name="sender"></param>
  488. /// <param name="e"></param>
  489. void btnQuery_Click( object sender, EventArgs e )
  490. {
  491. this.DictData.Clear();
  492. //this.PublicFunctionRows();
  493. this.ucPagerEx1.PageCurrent = 1;
  494. ucPagerEx1.Bind();
  495. }
  496. /// <summary>
  497. /// 已拍未修
  498. /// </summary>
  499. /// <param name="sender"></param>
  500. /// <param name="e"></param>
  501. void btnHasShotNoRepair_Click( object sender, EventArgs e )
  502. {
  503. this.DictData.Clear();
  504. this.DictData["PhotographyStatus"] = "OK";
  505. this.DictData["EarlyRepairStatus"] = "0";// "未修,修片中";
  506. //this.PublicFunctionRows();
  507. this.ucPagerEx1.PageCurrent = 1;
  508. ucPagerEx1.Bind();
  509. }
  510. /// <summary>
  511. /// 条件查询
  512. /// </summary>
  513. /// <param name="sender"></param>
  514. /// <param name="e"></param>
  515. void btnConditionQuery_Click( object sender, EventArgs e )
  516. {
  517. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ConditionQuerySamllForm frm = new SetSmallForm.ConditionQuerySamllForm();
  518. frm.LoadType = "修片";
  519. frm.ShowDialog();
  520. if ( frm.DictDataArray.Count > 0 )
  521. {
  522. this.DictData.Clear();
  523. Dictionary<string, string> DictDataArray = frm.DictDataArray;
  524. //初修人
  525. if ( DictDataArray.ContainsKey( "EarlyRepairName" ) && DictDataArray["EarlyRepairName"].Length > 0 )
  526. {
  527. this.DictData["EarlyRepairName"] = DictDataArray["EarlyRepairName"].Trim();
  528. }
  529. //初修开始时间
  530. if ( DictDataArray.ContainsKey( "QueryDateTimeStart" ) && DictDataArray["QueryDateTimeStart"].Length > 0 )
  531. {
  532. this.DictData["QueryDateTimeStart"] = DictDataArray["QueryDateTimeStart"].Trim();
  533. }
  534. //初修结束时间
  535. if ( DictDataArray.ContainsKey( "QueryDateTimeEnd" ) && DictDataArray["QueryDateTimeEnd"].Length > 0 )
  536. {
  537. this.DictData["QueryDateTimeEnd"] = DictDataArray["QueryDateTimeEnd"].Trim();
  538. }
  539. //this.PublicFunctionRows();
  540. this.ucPagerEx1.PageCurrent = 1;
  541. ucPagerEx1.Bind();
  542. }
  543. }
  544. /// <summary>
  545. /// 导出原片
  546. /// </summary>
  547. /// <param name="sender"></param>
  548. /// <param name="e"></param>
  549. void btnExportingZOOM_Click( object sender, EventArgs e )
  550. {
  551. if ( this.dgvData.Rows.Count > 0 )
  552. {
  553. if ( this.dgvData.SelectedRows.Count > 0 )
  554. {
  555. string StrSightsName = "";
  556. string ViceOrderNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  557. if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString().Trim() )
  558. {
  559. if ( this.dgvData.Columns["拍摄名称"] != null )
  560. {
  561. StrSightsName = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim();
  562. }
  563. }
  564. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ExportOriginalPiece( this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(), ViceOrderNumber, StrSightsName );
  565. }
  566. else
  567. {
  568. MessageBoxCustom.Show( "请选择订单" ); return;
  569. }
  570. }
  571. }
  572. /// <summary>
  573. /// 导入修好的片
  574. /// </summary>
  575. /// <param name="sender"></param>
  576. /// <param name="e"></param>
  577. void btnImportRepairedPiece_Click( object sender, EventArgs e )
  578. {
  579. if ( this.dgvData.Rows.Count > 0 )
  580. {
  581. if ( this.dgvData.SelectedRows.Count > 0 )
  582. {
  583. string SightsName = "";
  584. if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString().Trim() )
  585. {
  586. if ( this.dgvData.Columns["拍摄名称"] != null )
  587. {
  588. SightsName = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim();
  589. }
  590. }
  591. if ( this.dgvData.CurrentRow.Cells["取件状态"].Value.ToString().Trim() == "OK" )
  592. {
  593. MessageBoxCustom.Show( "已取件,不能导片!" );
  594. }
  595. LYFZ.Model.Model_ErpOrderDigital _modelDigital = null;
  596. if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ImportRepairPiece(
  597. this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(),
  598. this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(),
  599. SightsName,ref _modelDigital,
  600. this.dgvData.CurrentRow.Cells["取件状态"].Value.ToString().Trim() ) )
  601. {
  602. if(_modelDigital!=null)
  603. {
  604. //初修师,初修日期,初修是否外发,初修状态,
  605. this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修师"] = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
  606. this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修日期"] = LYFZ.BLL.OtherCommonModel.DateTimeToString(_modelDigital.Ordv_EarlyRepairTime);
  607. if (!string.IsNullOrEmpty(this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修状态"].ToString_s()))
  608. {
  609. this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修状态"] = Enum.ToObject(typeof(LYFZ.EnumPublic.EarlyRepairStatusEnum),
  610. Convert.ToInt32(this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修状态"])).ToString();
  611. }
  612. else
  613. {
  614. this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修状态"] = "";
  615. }
  616. if (this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修是否外发"].ToString_s() == "已发")
  617. {
  618. this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修是否外发"] = "已外发";
  619. }
  620. else if (this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修是否外发"].ToString_s() == "已回")
  621. {
  622. this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修是否外发"] = "外发已回";
  623. }
  624. else
  625. {
  626. this.dgvData._dataTable.Rows[this.dgvData.CurrentRow.Index]["初修是否外发"] = "";
  627. }
  628. }
  629. //this.PublicFunctionRows();
  630. //this.ucPagerEx1.PageCurrent = 1;
  631. //ucPagerEx1.Bind();
  632. }
  633. }
  634. else
  635. {
  636. MessageBoxCustom.Show( "请选择订单" ); return;
  637. }
  638. }
  639. }
  640. /// <summary>
  641. /// 查看修好的片
  642. /// </summary>
  643. /// <param name="sender"></param>
  644. /// <param name="e"></param>
  645. void btnViewRepairedPiece_Click( object sender, EventArgs e )
  646. {
  647. if ( this.dgvData.Rows.Count > 0 )
  648. {
  649. if ( this.dgvData.SelectedRows.Count > 0 )
  650. {
  651. string MainOrderNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();//主订单号
  652. string ViceOrderNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//数码编号
  653. string SightsName = "";
  654. if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString().Trim() )
  655. {
  656. try { SightsName = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim(); }
  657. catch { }
  658. }
  659. if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( ViceOrderNumber ) )
  660. {
  661. return;
  662. }
  663. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.CustomerPhotosViewSmallForm frm = new SetSmallForm.CustomerPhotosViewSmallForm();
  664. frm.LoadType = "初修片";
  665. frm.MainOrderNumber = MainOrderNumber;
  666. frm.ViceOrderNumber = ViceOrderNumber;
  667. frm.DirType = Model.Model_ErpOrder.DirectoryType.EarlyRetouch;
  668. frm.StrSightsName = SightsName;
  669. frm.Show();
  670. }
  671. else { MessageBoxCustom.Show( "请选择订单" ); return; }
  672. }
  673. }
  674. /// <summary>
  675. /// 导出修好的片
  676. /// </summary>
  677. /// <param name="sender"></param>
  678. /// <param name="e"></param>
  679. void btnExportRepairedPiece_Click( object sender, EventArgs e )
  680. {
  681. if ( this.dgvData.Rows.Count > 0 )
  682. {
  683. if ( this.dgvData.SelectedRows.Count > 0 )
  684. {
  685. try
  686. {
  687. string ViceOrderNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//数码编号
  688. LYFZ.Model.Model_ErpOrder ord_model = orbll.GetModel( "Ord_Number", this.dgvData.CurrentRow.Cells["Ord_Number"].Value );
  689. LYFZ.Model.Model_ErpOrderDigital vmodel = orvbll.GetModel( "Ordv_ViceNumber", ViceOrderNumber );//
  690. LYFZ.BLL.SelectPhotoHandling sPh = new BLL.SelectPhotoHandling( ord_model, vmodel );
  691. string ViceName = "";
  692. if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString().Trim() )
  693. {
  694. try
  695. {
  696. ViceName = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim();
  697. }
  698. catch { }
  699. }
  700. /* List<string> sPhotoList = sPh.GetSpecifyTypePhotoList( Model.Model_ErpOrder.DirectoryType.EarlyRetouch, BLL.SelectPhotoHandling.PhotoType.Original, ViceName );
  701. if (sPhotoList.Count == 0)
  702. {
  703. MessageBoxCustom.Show("此单未导片"); return;
  704. }*/
  705. if (!LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword(ViceOrderNumber))
  706. {
  707. return;
  708. }
  709. /* List<string> pathExt = new List<string>();
  710. foreach(string path in sPhotoList)
  711. {
  712. string ext = Path.GetExtension(path);
  713. if(pathExt.IndexOf(ext)==-1)
  714. {
  715. pathExt.Add(ext);
  716. }
  717. }
  718. frmSelectFileType frmSelectFile = new frmSelectFileType(pathExt);
  719. frmSelectFile.ShowDialog();
  720. pathExt = frmSelectFile.fileTypes;
  721. List<string> pathList = new List<string>();
  722. foreach (string path in sPhotoList)
  723. {
  724. string ext = Path.GetExtension(path);
  725. if (pathExt.IndexOf(ext) != -1)
  726. {
  727. pathList.Add(path);
  728. }
  729. }
  730. sPhotoList = pathList;
  731. */
  732. //显示对话框
  733. if ( fbd.ShowDialog() == DialogResult.OK )
  734. {
  735. bool IsImp = false;
  736. LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  737. {
  738. LYFZ.PhotoSelectSystem.PhotoImportExport pe = new PhotoSelectSystem.PhotoImportExport( ord_model, vmodel );
  739. IsImp = pe.ExportEarlyRetouchFilm( fbd.SelectedPath.ToString().Trim(), backgroundWorker );
  740. }, width: 500 );
  741. if ( !IsImp )
  742. {
  743. return;
  744. }
  745. else { MessageBoxCustom.Show( "导出完毕" ); return; }
  746. }
  747. }
  748. catch { MessageBoxCustom.Show( "导片出错" ); }
  749. }
  750. else { MessageBoxCustom.Show( "请选择订单" ); return; }
  751. }
  752. }
  753. /// <summary>
  754. /// 分片
  755. /// </summary>
  756. /// <param name="sender"></param>
  757. /// <param name="e"></param>
  758. void btnSeparatedPhoto_Click( object sender, EventArgs e )
  759. {
  760. if ( this.dgvData.Rows.Count > 0 )
  761. {
  762. if ( this.dgvData.SelectedRows.Count > 0 )
  763. {
  764. string ViceOrderNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//数码编号
  765. if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( ViceOrderNumber ) )
  766. {
  767. return;
  768. }
  769. LYFZ.Model.Model_ErpOrder model = orbll.GetModel( "Ord_Number", this.dgvData.CurrentRow.Cells["Ord_Number"].Value );
  770. LYFZ.Model.Model_ErpOrderDigital vmodel = orvbll.GetModel( "Ordv_ViceNumber", ViceOrderNumber );//
  771. LYFZ.PhotoSelectSystem.PhotoCategory frm = new PhotoSelectSystem.PhotoCategory( model, vmodel );
  772. if ( !frm.IsDisposed )
  773. {
  774. frm.ShowDialog();
  775. }
  776. }
  777. }
  778. else { MessageBoxCustom.Show( "请选择订单" ); }
  779. }
  780. /// <summary>
  781. /// 外发初修
  782. /// </summary>
  783. /// <param name="sender"></param>
  784. /// <param name="e"></param>
  785. void btnOutSendRepairPiece_Click( object sender, EventArgs e )
  786. {
  787. if ( this.dgvData.Rows.Count > 0 )
  788. {
  789. if ( this.dgvData.SelectedRows.Count > 0 )
  790. {
  791. string StrOrdViceNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  792. if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( StrOrdViceNumber ) )
  793. {
  794. return;
  795. }
  796. if ( MessageBoxCustom.Show( "你确定要外发初修片吗?", "温馨提示", MessageBoxButtons.YesNo ) == DialogResult.Yes )
  797. {
  798. string StrOrdNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  799. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.ChooseNameSuperSmallForm frm = new SuperSmallForm.ChooseNameSuperSmallForm();
  800. frm.StrOrdNumber = StrOrdNumber;
  801. frm.StrOrdViceNumber = StrOrdViceNumber;
  802. frm.orderProcess = EnumPublic.OrderProcessEnum.初修;
  803. frm.ShowDialog();
  804. if ( frm.IsSaveed )
  805. {
  806. DateTime strTime = SDateTime.Now;
  807. List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
  808. DataTable dt = orbll.GetView_Custom( "tb_ErpOrderDigitalStatus", StrWhere: "Ords_OrdNumber = '" + StrOrdNumber + "' And Ords_ViceNumber = '" + StrOrdViceNumber + "'", ShowColumnName: "*" ).Tables[0];
  809. LYFZ.Model.Model_ErpOrderDigitalStatus modelStatus = null;
  810. if ( dt.Rows.Count > 0 )
  811. {
  812. modelStatus = orsbll.DataRowToModel( dt.Rows[0] );
  813. modelStatus.Ords_OutSendEarlyRepairName = this.StrUserID;
  814. modelStatus.Ords_OutSendEarlyRepairStatus = "已发";
  815. modelStatus.Ords_OutSendEarlyRepairTime = strTime;
  816. modelStatus.Ords_OutSendEarlyRepairVendor = frm.htData["StrVendor"].ToString().Trim();
  817. modelStatus.Ords_OutSendEarlyRepairVendorQQ = frm.htData["StrQQ"].ToString().Trim();
  818. clist.Add( orsbll.GetUpdateCommandInfo( modelStatus ) );
  819. }
  820. if ( clist.Count > 0 )
  821. {
  822. if ( LYFZ.BLL.BaseBllOperate.ExecuteSqlTran( clist ) > 0 )
  823. {
  824. if ( Convert.ToBoolean( frm.htData["StrIsOutSend"] ) && frm.htData["StrQQ"].ToString().Trim().Length > 0 )
  825. {
  826. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.QQCall( frm.htData["StrQQ"].ToString().Trim() );
  827. }
  828. }
  829. else
  830. {
  831. MessageBoxCustom.Show( "操作选择供应商发出失败!" );
  832. }
  833. }
  834. else
  835. {
  836. MessageBoxCustom.Show( "外发失败,可能数码状态表不存在!" );
  837. }
  838. }
  839. }
  840. }
  841. }
  842. }
  843. /// <summary>
  844. /// 关闭
  845. /// </summary>
  846. /// <param name="sender"></param>
  847. /// <param name="e"></param>
  848. void btnClose_Click( object sender, EventArgs e )
  849. {
  850. this.Close();
  851. }
  852. /// <summary>
  853. /// 儿童版
  854. /// </summary>
  855. /// <param name="sender"></param>
  856. /// <param name="e"></param>
  857. void chkKidsVersion_Click( object sender, EventArgs e )
  858. {
  859. if ( this.chkKidsVersion.Checked )
  860. {
  861. this.chkPortraitVersion.Checked = false; this.chkKidsVersion.Checked = true; this.chkDressVersion.Checked = false;
  862. }
  863. this.cmbQueryText.Text = "";
  864. //this.PublicFunctionRows();
  865. this.ucPagerEx1.PageCurrent = 1;
  866. ucPagerEx1.Bind();
  867. }
  868. /// <summary>
  869. /// 婚纱版
  870. /// </summary>
  871. /// <param name="sender"></param>
  872. /// <param name="e"></param>
  873. void chkDressVersion_Click( object sender, EventArgs e )
  874. {
  875. if ( this.chkDressVersion.Checked )
  876. {
  877. this.chkPortraitVersion.Checked = false; this.chkDressVersion.Checked = true; this.chkKidsVersion.Checked = false;
  878. }
  879. this.cmbQueryText.Text = "";
  880. //this.PublicFunctionRows();
  881. this.ucPagerEx1.PageCurrent = 1;
  882. ucPagerEx1.Bind();
  883. }
  884. /// <summary>
  885. /// 写真版
  886. /// </summary>
  887. /// <param name="sender"></param>
  888. /// <param name="e"></param>
  889. void chkPortraitVersion_Click( object sender, EventArgs e )
  890. {
  891. if ( this.chkPortraitVersion.Checked )
  892. {
  893. this.chkPortraitVersion.Checked = true; this.chkDressVersion.Checked = false; this.chkKidsVersion.Checked = false;
  894. }
  895. this.cmbQueryText.Text = "";
  896. //this.PublicFunctionRows();
  897. this.ucPagerEx1.PageCurrent = 1;
  898. ucPagerEx1.Bind();
  899. }
  900. /// <summary>
  901. /// 窗体大小发生改变事件
  902. /// </summary>
  903. /// <param name="sender"></param>
  904. /// <param name="e"></param>
  905. void RepairPieceFormMain_Resize( object sender, EventArgs e )
  906. {
  907. if ( !this.IsFirstRun )
  908. {
  909. switch ( this.panelPortraitVersion.Location.Y )
  910. {
  911. case 4: this.flowLayoutPanel1.Height = 36; break;
  912. case 36: this.flowLayoutPanel1.Height = 68; break;
  913. }
  914. }
  915. }
  916. /// <summary>
  917. /// 双击列表查看相片
  918. /// </summary>
  919. /// <param name="sender"></param>
  920. /// <param name="e"></param>
  921. void dgvData_CellMouseDoubleClick( object sender, DataGridViewCellMouseEventArgs e )
  922. {
  923. if ( this.dgvData.Rows.Count > 0 )
  924. {
  925. if ( e.RowIndex >= 0 && e.ColumnIndex >= 0 )
  926. {
  927. if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresRepairPiece", LYFZ.CustomAttributes.OperatingAuthority.PhotoView ) )
  928. {
  929. this.btnViewRepairedPiece_Click( this, null );
  930. }
  931. }
  932. }
  933. }
  934. /// <summary>
  935. /// 点击事件
  936. /// </summary>
  937. /// <param name="sender"></param>
  938. /// <param name="e"></param>
  939. void dgvData_CellMouseDown( object sender, DataGridViewCellMouseEventArgs e )
  940. {
  941. if ( e.Button == MouseButtons.Right )
  942. {
  943. if ( e.RowIndex >= 0 && e.ColumnIndex >= 0 )
  944. {
  945. if ( this.dgvData.Rows.Count > 0 )
  946. {
  947. bool IsFind = false;
  948. Hashtable htData = null;
  949. ToolStripMenuItem item = null;
  950. if ( this.dgvData.Columns[e.ColumnIndex].Name.Trim() == "初修状态" )
  951. {
  952. if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresRepairPiece", LYFZ.CustomAttributes.OperatingAuthority.ProcessStatusReset ) )
  953. {
  954. this.dgvData.conMenu.Items.Clear();
  955. htData = new Hashtable();
  956. htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
  957. htData["StrStatusName"] = this.dgvData.Columns[e.ColumnIndex].Name.Trim() + ":";
  958. htData["StrStatusType"] = "1";
  959. htData["StrViceNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  960. //弹出操作菜单
  961. item = new ToolStripMenuItem();
  962. item.Text = "重置" + this.dgvData.Columns[e.ColumnIndex].Name.Trim();
  963. item.Tag = htData;
  964. item.Name = "ResetStatus";
  965. this.dgvData.conMenu.Items.Add( item );
  966. IsFind = true;
  967. }
  968. }
  969. else if ( this.dgvData.Columns[e.ColumnIndex].Name.Trim() == "初修日期" && this.dgvData.Rows[e.RowIndex].Cells["初修日期"].Value.ToString().Trim() != "" )
  970. {
  971. if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresRepairPiece", LYFZ.CustomAttributes.OperatingAuthority.ProcessDateReset ) )
  972. {
  973. this.dgvData.conMenu.Items.Clear();
  974. htData = new Hashtable();
  975. htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
  976. htData["StrViceNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  977. htData["StrOldDate"] = this.dgvData.Rows[e.RowIndex].Cells["初修日期"].Value.ToString().Trim();
  978. item = new ToolStripMenuItem();
  979. item.Text = "重置" + this.dgvData.Columns[e.ColumnIndex].Name.Trim();
  980. item.Tag = htData;
  981. item.Name = "ResetDate";
  982. this.dgvData.conMenu.Items.Add( item );
  983. IsFind = true;
  984. }
  985. }
  986. item = new ToolStripMenuItem();
  987. htData = new Hashtable();
  988. htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
  989. htData["StrViceNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  990. item.Text = "订单备注";
  991. item.Tag = htData;
  992. item.Name = "OrderRemark";
  993. this.dgvData.conMenu.Items.Add( item );
  994. IsFind = true;
  995. if ( IsFind )
  996. {
  997. // this.dgvData.conMenu.Show( MousePosition.X, MousePosition.Y );//弹出操作菜单
  998. this.dgvData.conMenu.ItemClicked -= dgvData_DataGridViewConMenu_ItemClicked;
  999. this.dgvData.conMenu.ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
  1000. // this.dgvData.conMenu.Show();
  1001. if (!this.dgvData.conMenu.Visible)
  1002. {
  1003. this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
  1004. }
  1005. }
  1006. if ( htData != null )
  1007. {
  1008. BindContextMenu( this.dgvData.Rows[e.RowIndex] );
  1009. }
  1010. }
  1011. }
  1012. else
  1013. {
  1014. this.dgvData.conMenu.Items.Clear();
  1015. ToolStripMenuItem item = new ToolStripMenuItem();
  1016. item.Text = "设置标题";
  1017. item.Tag = "SetColumnShow";
  1018. item.Name = "SetColumnShow";
  1019. this.dgvData.conMenu.Items.Add( item );
  1020. // this.dgvData.conMenu.Show( MousePosition.X, MousePosition.Y );//弹出操作菜单
  1021. this.dgvData.conMenu.ItemClicked -= dgvData_DataGridViewConMenu_ItemClicked;
  1022. this.dgvData.conMenu.ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
  1023. // this.dgvData.conMenu.Show();
  1024. if (!this.dgvData.conMenu.Visible)
  1025. {
  1026. this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
  1027. }
  1028. }
  1029. }
  1030. }
  1031. /// <summary>
  1032. /// 列表单击事件
  1033. /// </summary>
  1034. /// <param name="sender"></param>
  1035. /// <param name="e"></param>
  1036. void dgvData_CellClick( object sender, DataGridViewCellEventArgs e )
  1037. {
  1038. try
  1039. {
  1040. string StrNumber = this.dgvData.CurrentRow.Cells["订单号"].Value.ToString().Trim();
  1041. if ( string.IsNullOrEmpty( StrNumber ) || StrNumber.Trim() == "(取件OK)" )
  1042. {
  1043. bool IsFind = false;
  1044. int i = this.dgvData.CurrentRow.Index;
  1045. while ( !IsFind )
  1046. {
  1047. i = i - 1;
  1048. if ( !string.IsNullOrEmpty( this.dgvData.Rows[i].Cells["订单号"].Value.ToString().Trim() ) )
  1049. {
  1050. StrNumber = this.dgvData.Rows[i].Cells["订单号"].Value.ToString().Trim(); IsFind = true;
  1051. }
  1052. }
  1053. }
  1054. LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = StrNumber;
  1055. }
  1056. catch
  1057. {
  1058. }
  1059. }
  1060. /// <summary>
  1061. /// 对列表控件双击事件
  1062. /// </summary>
  1063. /// <param name="sender"></param>
  1064. /// <param name="e"></param>
  1065. void dgvData_MouseDoubleClick( object sender, MouseEventArgs e )
  1066. {
  1067. Point hit = this.dgvData.PointToClient( Cursor.Position );
  1068. DataGridView.HitTestInfo hitTest = this.dgvData.HitTest( hit.X, hit.Y );
  1069. if ( hitTest.RowIndex < 0 && hitTest.ColumnIndex < 0 )
  1070. {
  1071. if ( !string.IsNullOrEmpty( this.cmbQueryText.Text.Trim() ) )
  1072. {
  1073. LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = "";
  1074. this.cmbQueryText.Text = "";
  1075. //this.PublicFunctionRows();
  1076. this.ucPagerEx1.PageCurrent = 1;
  1077. ucPagerEx1.Bind();
  1078. }
  1079. }
  1080. }
  1081. /// <summary>
  1082. /// 右键菜单选择项事件
  1083. /// </summary>
  1084. /// <param name="sender"></param>
  1085. /// <param name="e"></param>
  1086. void dgvData_DataGridViewConMenu_ItemClicked( object sender, ToolStripItemClickedEventArgs e )
  1087. {
  1088. ToolStripItem item = e.ClickedItem;
  1089. if ( item.Name.Trim() == "SetColumnShow" )
  1090. {
  1091. if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ShowDataGridViewSetColumn( this.dgvData ) )
  1092. {
  1093. //this.PublicFunctionRows();
  1094. this.ucPagerEx1.PageCurrent = 1;
  1095. ucPagerEx1.Bind();
  1096. }
  1097. }
  1098. else if ( item.Name.ToString().Trim() == "OrderRemark" )
  1099. {
  1100. Hashtable htData = (Hashtable)item.Tag;
  1101. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OrderRemarkRecordAddSuperSmallForm frm = new SuperSmallForm.OrderRemarkRecordAddSuperSmallForm();
  1102. frm.StrOrderNumber = htData["StrNumber"].ToString().Trim();
  1103. frm.StrOrdViceNumber = htData["StrViceNumber"].ToString().Trim();
  1104. frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.订单初修.ToString().Trim();
  1105. frm.ShowDialog();
  1106. }
  1107. else if ( item.Name.ToString().Trim() == "ResetStatus" )
  1108. {
  1109. Hashtable htData = (Hashtable)item.Tag;
  1110. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.OrderStatusResetSmallForm frm = new SetSmallForm.OrderStatusResetSmallForm();
  1111. frm.StrNumber = htData["StrNumber"].ToString();
  1112. frm.StrStatusName = htData["StrStatusName"].ToString();
  1113. frm.StrStatusType = htData["StrStatusType"].ToString();
  1114. frm.StrViceNumber = htData["StrViceNumber"].ToString();
  1115. frm.ShowDialog();
  1116. if ( frm.IsSaveed )
  1117. {
  1118. //PublicFunctionRows();
  1119. this.ucPagerEx1.PageCurrent = 1;
  1120. ucPagerEx1.Bind();
  1121. }
  1122. }
  1123. else if ( item.Name.ToString().Trim() == "ResetDate" )
  1124. {
  1125. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.GetDateSuperSmallForm frm = new CameraControlBook.SuperSmallForm.GetDateSuperSmallForm();
  1126. frm.IsValueNull = false;
  1127. frm.ShowDialog();
  1128. if ( frm.IsOK )
  1129. {
  1130. if ( MessageBoxCustom.Show( "您确定要重置初修日期吗?", "温馨提示", MessageBoxButtons.YesNo ) == DialogResult.Yes )
  1131. {
  1132. DateTime strTime = SDateTime.Now;
  1133. Hashtable htData = (Hashtable)item.Tag;
  1134. List<Helper.CommandInfo> clist = new List<CommandInfo>();
  1135. LYFZ.Model.Model_ErpOrderDigital model = orvbll.GetModel( "Ordv_ViceNumber", htData["StrViceNumber"] );
  1136. model.Ordv_EarlyRepairTime = Convert.ToDateTime( frm.StrValue );
  1137. model.Ordv_UpdateDateTime = strTime;
  1138. model.Ordv_UpdateName = this.StrUserID;
  1139. clist.Add( orvbll.GetUpdateCommandInfo( model ) );
  1140. string StrContent = "[重置初修日期] 数码编号为:" + htData["StrViceNumber"] + ",的初修日期由" + htData["StrOldDate"] + "改为" + frm.StrValue;
  1141. clist.Add( slogbll.GetAddCommandInfo( LYFZ.BLL.BLL_ErpSystemLogs.GetWriteLogModel( LYFZ.EnumPublic.SystemLogsType.订单流程重置, StrContent, this.StrUserID, StrUserName, LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.User_IP ) ) );
  1142. if ( clist.Count > 0 )
  1143. {
  1144. if ( LYFZ.BLL.BaseBllOperate.ExecuteSqlTran( clist ) > 0 )
  1145. {
  1146. //this.PublicFunctionRows();
  1147. this.ucPagerEx1.PageCurrent = 1;
  1148. ucPagerEx1.Bind();
  1149. MessageBoxCustom.Show( "重置成功!" );
  1150. }
  1151. else
  1152. {
  1153. MessageBoxCustom.Show( "重置失败!" );
  1154. }
  1155. }
  1156. }
  1157. }
  1158. }
  1159. }
  1160. /// <summary>
  1161. /// 点击列标头排序
  1162. /// </summary>
  1163. /// <param name="sender"></param>
  1164. /// <param name="e"></param>
  1165. void dgvData_ColumnHeaderMouseClick( object sender, DataGridViewCellMouseEventArgs e )
  1166. {
  1167. if ( e.Button == MouseButtons.Left )
  1168. {
  1169. string StrColumnName = GetOrderByName( this.dgvData.Columns[e.ColumnIndex].Name.Trim() );
  1170. if ( StrColumnName == this.StrCurrentClickField || string.IsNullOrEmpty( this.StrCurrentClickField ) )
  1171. {
  1172. if ( this.StrSortOrder == "ASC" )
  1173. {
  1174. this.StrSortOrder = "DESC";
  1175. }
  1176. else
  1177. {
  1178. this.StrSortOrder = "ASC";
  1179. }
  1180. }
  1181. else
  1182. {
  1183. this.StrSortOrder = "DESC";
  1184. }
  1185. if ( this.dgvData.StrValueNullColumn.Trim().IndexOf( StrColumnName ) == -1 || StrColumnName.Trim() == "套系金额" )
  1186. {
  1187. this.StrSortField = (StrColumnName) + " " + this.StrSortOrder + ",Ord_CreateDateTime,Ordv_DigitalNumber";
  1188. }
  1189. else
  1190. {
  1191. this.StrSortField = "Ord_CreateDateTime " + this.StrSortOrder + ",Ordv_DigitalNumber";
  1192. }
  1193. this.StrCurrentClickField = StrColumnName;
  1194. //this.PublicFunctionRows();
  1195. this.ucPagerEx1.PageCurrent = 1;
  1196. ucPagerEx1.Bind();
  1197. }
  1198. }
  1199. string GetOrderByName( string StrColumnName )
  1200. {
  1201. if ( StrColumnName == "选片时间" )
  1202. {
  1203. return "(case when Ordv_FilmSelectionStatus = '0' then Ordv_ReservationFilmSelectionTime else Ordv_FilmSelectionTime end)";
  1204. }
  1205. else if ( StrColumnName == "拍摄名称" )
  1206. {
  1207. return " Ordpg_Sights ";
  1208. }
  1209. else if ( StrColumnName == "摄影师" )
  1210. {
  1211. return " Ordpg_Photographer ";
  1212. }
  1213. else if ( StrColumnName == "拍摄时间" )
  1214. {
  1215. return " Ordpg_PhotographyTime ";
  1216. }
  1217. else if ( StrColumnName == "拍照状态" )
  1218. {
  1219. return " Ordpg_PhotographyStatus ";
  1220. }
  1221. else if ( StrColumnName == "订单号" )
  1222. {
  1223. return " Ord_SinceOrderNumber ";
  1224. }
  1225. else if ( StrColumnName == "客户姓名" )
  1226. {
  1227. return " Cus_Name ";
  1228. }
  1229. else if ( StrColumnName == "客户性别" )
  1230. {
  1231. return " Cus_Sex_cs ";
  1232. }
  1233. else if ( StrColumnName == "客户电话" )
  1234. {
  1235. return " Cus_Telephone ";
  1236. }
  1237. else if ( StrColumnName == "订单类型" )
  1238. {
  1239. return " Ord_Type ";
  1240. }
  1241. else if ( StrColumnName == "接单人" )
  1242. {
  1243. return " Ord_OrderPersonName ";
  1244. }
  1245. else if ( StrColumnName == "套系名称" )
  1246. {
  1247. return " Ord_SeriesName ";
  1248. }
  1249. else if ( StrColumnName == "套系价格" )
  1250. {
  1251. return " Ord_SeriesPrice ";
  1252. }
  1253. else if ( StrColumnName == "拍摄名称" )
  1254. {
  1255. return " Ordpg_Sights ";
  1256. }
  1257. else if ( StrColumnName == "摄影师" )
  1258. {
  1259. return " Ordpg_Photographer ";
  1260. }
  1261. else if ( StrColumnName == "拍摄时间" )
  1262. {
  1263. return " Ordpg_PhotographyTime ";
  1264. }
  1265. else if ( StrColumnName == "拍照状态" )
  1266. {
  1267. return " Ordpg_PhotographyStatus ";
  1268. }
  1269. else if ( StrColumnName == "初修师" )
  1270. {
  1271. return " Ordv_EarlyRepairName ";
  1272. }
  1273. else if ( StrColumnName == "初修日期" )
  1274. {
  1275. return " Ordv_EarlyRepairTime ";
  1276. }
  1277. else if ( StrColumnName == "初修状态" )
  1278. {
  1279. return " Ordv_EarlyRepairStatus ";
  1280. }
  1281. else if ( StrColumnName == "选片状态" )
  1282. {
  1283. return " Ordv_FilmSelectionStatus ";
  1284. }
  1285. else if ( StrColumnName == "加急" )
  1286. {
  1287. return " IsExpedited ";
  1288. }
  1289. else if ( StrColumnName == "加急日期" )
  1290. {
  1291. return " ExpeditedTime ";
  1292. }
  1293. else if ( StrColumnName == "设计状态" )
  1294. {
  1295. return " Ordv_DesignerStatus ";
  1296. }
  1297. else if ( StrColumnName == "精修状态" )
  1298. {
  1299. return " Ordv_RefinementStatus ";
  1300. }
  1301. else if ( StrColumnName == "看版状态" )
  1302. {
  1303. return " Ordv_LookDesignStatus ";
  1304. }
  1305. else if ( StrColumnName == "会员卡号" )
  1306. {
  1307. return " Mc_CradNumber ";
  1308. }
  1309. else if ( StrColumnName == "取件状态" )
  1310. {
  1311. return " Ords_ProductPickupIntStatus ";
  1312. }
  1313. return "";
  1314. }
  1315. /// <summary>
  1316. /// 当前点击的字段
  1317. /// </summary>
  1318. string StrCurrentClickField = "";
  1319. /// <summary>
  1320. /// 排序字段
  1321. /// </summary>
  1322. string StrSortField = "Ord_CreateDateTime DESC,Ordv_DigitalNumber";
  1323. /// <summary>
  1324. /// 排序顺序
  1325. /// </summary>
  1326. string StrSortOrder = "DESC";
  1327. /// <summary>
  1328. /// 创建行
  1329. /// </summary>
  1330. void PublicFunctionRows()
  1331. {
  1332. this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number,Ord_Type,Ordv_ViceNumber,订单号,客户姓名,客户性别,客户电话,套系名称,套系价格,订单类型,接单人,拍摄名称,摄影师,拍摄时间,拍照状态,初修师,初修日期,初修是否外发,初修状态,选片状态,选片时间,加急,加急日期,设计状态,精修状态,看版状态,取件状态,会员卡号";
  1333. string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0002.ToString().Trim();
  1334. if ( (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.MemberCardShowHide) )
  1335. {
  1336. this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type,会员卡号" + versionHideString;
  1337. }
  1338. else
  1339. {
  1340. this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type" + versionHideString;
  1341. }
  1342. this.dgvData.dgvGuidName = StrGuidName;
  1343. this.dgvData.dgvUserEmployeeID = this.StrUserID;
  1344. this.dgvData.StrValueNullColumn = "订单号,客户姓名,客户性别,客户电话,套系名称,套系价格,订单类型,接单人,会员卡号";
  1345. this.dgvData.DataColumns( this.dgvData.dgvCurrentColumnOriginalSet, strHideField: this.dgvData.dgvFixedHideColumn );
  1346. Dictionary<string, string> dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns( this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet );
  1347. this.dgvData.dictShowColumName = dictColumns;
  1348. string StrQueryCondition = "";
  1349. if ( IsFirstRun && !string.IsNullOrEmpty( LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber ) )
  1350. {
  1351. 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" );
  1352. this.cmbQueryText.Text = LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber;
  1353. StrQueryCondition = StrWhere + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhere( this.cmbtreevStoreName, "Ord_DividedShop" );
  1354. }
  1355. else
  1356. {
  1357. StrQueryCondition = this.GetWhereStr();
  1358. }
  1359. int intTopCount = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPageSize();
  1360. Hashtable htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderRepairPiece( this.dgvData, dictColumns, StrQueryCondition, intTopCount, this.StrSortField, ucPagerEx1.PageCurrent );
  1361. this.dataGridViewStatisticsCount1.LocationX = this.dgvData.RowHeadersWidth;
  1362. this.dataGridViewStatisticsCount1.CurrenQuantity = Convert.ToInt32( htData["CurrentCount"] );
  1363. this.dataGridViewStatisticsCount1.TotalQuantity = Convert.ToInt32( htData["TotalCount"] );
  1364. BindPageData( ucPagerEx1.PageCurrent, Convert.ToInt32( htData["CurrentCount"] ), Convert.ToInt32( htData["TotalCount"] ) );
  1365. }
  1366. /// <summary>
  1367. /// 返回要操作的条件
  1368. /// </summary>
  1369. /// <returns></returns>
  1370. string GetWhereStr()
  1371. {
  1372. string StrWhere = " Where Ord_Class = '1' " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere( this.cmbtreevStoreName, "Ord_DividedShop" );
  1373. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetQueryTextQueryCondition( cmbQueryText.Text.Trim() );
  1374. if ( chkCompleteOrder.Checked )
  1375. {
  1376. StrWhere += " and ( (Ords_ServiceIntStatus = 2 or ServiceCount=0 ) and (Ords_ProductPickupIntStatus = 2 or productCount=0 ) and (ServiceCount>0 or productCount>0) ) ";
  1377. }
  1378. else
  1379. {
  1380. if (BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.HidePickUpOrder && !this.chkCompleteOrder.Checked && string.IsNullOrEmpty(this.cmbQueryText.Text))
  1381. {
  1382. StrWhere += " and (Ords_ProductPickupIntStatus in (0,1) and productCount>0 ) ";
  1383. }
  1384. else
  1385. {
  1386. 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 ) ) ";
  1387. }
  1388. }
  1389. if ( DictData.ContainsKey( "PhotographyStatus" ) && DictData["PhotographyStatus"].Trim().Length > 0 )
  1390. {
  1391. StrWhere += " and Ordpg_PhotographyStatus in (1,2) ";
  1392. }
  1393. if ( DictData.ContainsKey( "EarlyRepairStatus" ) && DictData["EarlyRepairStatus"].Trim().Length > 0 )
  1394. {
  1395. StrWhere += " and Ordv_EarlyRepairStatus <> '2'";
  1396. }
  1397. if ( DictData.ContainsKey( "EarlyRepairName" ) && DictData["EarlyRepairName"].Trim().Length > 0 )
  1398. {
  1399. StrWhere += " and Ordv_EarlyRepairName = '" + DictData["EarlyRepairName"].Trim() + "'";
  1400. }
  1401. if ( DictData.ContainsKey( "QueryDateTimeStart" ) && DictData["QueryDateTimeStart"].Trim().Length > 0 && DictData.ContainsKey( "QueryDateTimeEnd" ) && DictData["QueryDateTimeEnd"].Trim().Length > 0 )
  1402. {
  1403. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime( "Ordv_EarlyRepairTime", DictData["QueryDateTimeStart"], DictData["QueryDateTimeEnd"] );
  1404. }
  1405. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, StrOrdType: "0,1,2" );
  1406. return StrWhere;
  1407. }
  1408. }
  1409. }