DesignFormMain.cs 82 KB

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