FilmSelectionFormMain.cs 87 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Collections;
  10. using LYFZ.ComponentLibrary;
  11. using LYFZ.Helper;
  12. using System.IO;
  13. using System.Diagnostics;
  14. namespace LYFZ.Software.MainBusiness.DoorCityProcess
  15. {
  16. public partial class FilmSelectionFormMain : LYFZ.Software.UI.DoorCityProcess.FilmSelectionFormMain
  17. {
  18. #region OSS云传片
  19. bool useOss = false;
  20. List<AliyunOssLibrary.Model.SimplifyBranch> listbranch = null;
  21. #endregion
  22. #region N8选版开启、程序路径属性
  23. public bool IsUserN8ViewGo
  24. {
  25. get; set;
  26. }
  27. public string N8ViewGoPath
  28. {
  29. get; set;
  30. }
  31. #endregion
  32. #region 2017-03-18 杨云奕 添加 获取门店配置的ftp情况
  33. BLL.BaseBLL.BaseBLL_FTPServiceUserAccount ftpbll = new BLL.BaseBLL.BaseBLL_FTPServiceUserAccount();
  34. DataSet ftpData;
  35. #endregion
  36. LYFZ.BLL.BLL_ErpOrder obll = new BLL.BLL_ErpOrder();
  37. LYFZ.BLL.BLL_ErpSystemLogs slogbll = new BLL.BLL_ErpSystemLogs();
  38. LYFZ.BLL.BLL_ErpOrderDigital dbll = new LYFZ.BLL.BLL_ErpOrderDigital();
  39. public FilmSelectionFormMain()
  40. {
  41. this.Shown += FilmSelectionFormMain_Shown;
  42. this.Load += FilmSelectionFormMain_Load;
  43. this.cmbtreevStoreName.ComboBoxTree_NodeMouseClick += cmbtreevStoreName_ComboBoxTree_NodeMouseClick;
  44. this.cmbQueryText.KeyDown += cmbQueryText_KeyDown;
  45. this.btnQuery.Click += btnQuery_Click;
  46. this.btnHasRepairNoSelection.Click += btnHasRepairNoSelection_Click;
  47. this.btnConditionQuery.Click += btnConditionQuery_Click;
  48. this.btnStartFilmSelection.Click += btnStartFilmSelection_Click;
  49. this.btnCacheNative.Click += btnCacheNative_Click;
  50. this.btnCacheManage.Click += btnCacheManage_Click;
  51. this.btnChangeFilmSelection.Click += btnChangeFilmSelection_Click;
  52. this.btnViewCropped.Click += btnViewCropped_Click;
  53. this.btnClose.Click += btnClose_Click;
  54. this.chkDressVersion.Click += chkDressVersion_Click;
  55. this.chkKidsVersion.Click += chkKidsVersion_Click;
  56. this.chkPortraitVersion.Click += chkPortraitVersion_Click;
  57. this.dgvData.CellMouseDown += dgvData_CellMouseDown;
  58. this.dgvData.CellClick += dgvData_CellClick;
  59. this.dgvData.MouseDoubleClick += dgvData_MouseDoubleClick;
  60. this.dgvData.ColumnHeaderMouseClick += dgvData_ColumnHeaderMouseClick;
  61. this.btnYunFilmSelection.Click += btnYunFilmSelection_Click;
  62. this.btnYunFilmSelectionResult.Click += btnYunFilmSelectionResult_Click;
  63. this.btnExport.Click += btnExport_Click;
  64. this.flowLayoutPanel1.Height = 34;
  65. //打单功能
  66. btnPrintOrder.Click += btnPrintOrder_Click;
  67. // N8选版按钮;
  68. this.btn_N8ViewGo.Click += Btn_N8ViewGo_Click;
  69. this.Resize += FilmSelectionFormMain_Resize;
  70. ucPagerEx1.EventPaging += ucPagerEx1_EventPaging;
  71. this.chkCompleteOrder.Click += ChkCompleteOrder_Click;
  72. this.btn_CusOssUpload.Click += Btn_CusOssUpload_Click;
  73. this.btn_CusOssUpload.Visible = false;
  74. }
  75. /// <summary>
  76. /// 客照云传;
  77. /// </summary>
  78. /// <param name="sender"></param>
  79. /// <param name="e"></param>
  80. private void Btn_CusOssUpload_Click( object sender, EventArgs e )
  81. {
  82. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  83. {
  84. backgroundWorker.ReportProgress( 0, "正在上传中,请稍等..." );
  85. // 选中行;
  86. if ( this.dgvData.SelectedRows.Count == 0 )
  87. {
  88. MessageBoxCustom.Show( "请选择要上传的客照" );
  89. return;
  90. }
  91. if ( !OssTask.frmOssTask.IsExistsEnterpriseID() )
  92. {
  93. MessageBoxCustom.Show( "未注册企业ID,请联系服务商注册" );
  94. return;
  95. }
  96. // 选择os type;
  97. OssTask.frmChooseOsType dlg = new OssTask.frmChooseOsType();
  98. if ( DialogResult.OK != dlg.ShowDialog() )
  99. {
  100. return;
  101. }
  102. // 选择第一行;
  103. DataGridViewRow row = this.dgvData.SelectedRows[0];
  104. // 订单号;
  105. string strOrderNumber = row.Cells["Ord_Number"].Value.ToString();
  106. // 订单类型;
  107. string strOrderType = row.Cells["订单类型"].Value.ToString();
  108. // 副订单号;
  109. string strViceOrderNumber = row.Cells["Ordv_ViceNumber"].Value.ToString();
  110. // 客户姓名;
  111. string strCusNames = row.Cells["客户姓名"].Value.ToString();
  112. // 客户性别;
  113. string strCusGenders = row.Cells["客户性别"].Value.ToString();
  114. // 客户电话;
  115. string strCusPhones = row.Cells["客户电话"].Value.ToString();
  116. // 相片类型;
  117. string strPhotosType = "选好的片";
  118. // 拍摄名称;
  119. string strScenery = "";
  120. if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString().Trim() )
  121. {
  122. try
  123. {
  124. strScenery = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim();
  125. }
  126. catch { }
  127. }
  128. // 上传的相片;
  129. List<string> listPhotos = null;
  130. if ( !LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.UseBaiduShareUrl )
  131. {
  132. listPhotos = LYFZ.Software.MainBusiness.OssTask.frmOssTask.GetSelectedPhotos( strOrderNumber, strViceOrderNumber, strScenery );
  133. // 生成任务;
  134. if ( listPhotos == null || listPhotos.Count == 0 )
  135. {
  136. MessageBoxCustom.Show( "该订单没有相片,不生成任务" );
  137. return;
  138. }
  139. }
  140. /*if ( LYFZ.Software.MainBusiness.OssTask.frmOssTask.GenerateOssTaskEx(
  141. dlg.cb_baidu.Checked ? 2 : -1,
  142. dlg.dtp_expire.Value.ToString( "yyyy-MM-dd 00:00:00" ),
  143. Convert.ToInt32( dlg.dup_times.SelectedItem ),
  144. strOrderNumber, strOrderType, strCusNames, strCusGenders, strCusPhones, strPhotosType, strScenery, listPhotos ) )
  145. {
  146. MessageBoxCustom.Show( "任务生成成功!" );
  147. }*/
  148. OssTask.JsonOssTask jsonOssTask = LYFZ.Software.MainBusiness.OssTask.frmOssTask.GenerateOssTask(
  149. //dlg.cb_baidu.Checked ? 2 : -1,
  150. LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.UseBaiduShareUrl ? 2 : -1,
  151. //dlg.dtp_expire.Value.ToString( "yyyy-MM-dd 00:00:00" ),
  152. DateTime.Now.AddMonths( 1 ).ToString( "yyyy-MM-dd 00:00:00" ),
  153. //Convert.ToInt32( dlg.dup_times.SelectedItem ),
  154. 1,
  155. strOrderNumber, "子订单号", strOrderType, strCusNames, strCusGenders, strCusPhones, strPhotosType, strScenery, listPhotos );
  156. if ( jsonOssTask != null )
  157. {
  158. // 如果任务列表空,加载任务;
  159. //if ( OssTask.frmOssTask.IsTaskListNullOrEmpty() )
  160. /*{
  161. // 从服务器加载文件数据;
  162. List<string> listJson;
  163. if ( LYFZ.Network.PlatinumClientProcess.GetOssTaskInfoFromSvr( out listJson ) )
  164. {
  165. OssTask.frmOssTask.LoadOssTask2( listJson );
  166. }
  167. }*/
  168. // 是否存在;
  169. //if ( OssTask.frmOssTask.IsTaskExists( jsonOssTask ) )
  170. string strJson;
  171. if ( LYFZ.Network.PlatinumClientProcess.IsOssTaskInfoExists( jsonOssTask.TaskID, out strJson ) )
  172. {// 任务已存在;
  173. MessageBoxCustom.Show( "任务已存在, 若要重新上传, 请到服务端删除任务再上传!" );
  174. }
  175. else
  176. {// 新增任务;
  177. if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.UseBaiduShareUrl )
  178. {
  179. LYFZ.Software.MainBusiness.OssTask.frmBaiduShareUrl frm = new OssTask.frmBaiduShareUrl();
  180. frm.ShowDialog();
  181. if ( frm.DialogResult == DialogResult.OK )
  182. {
  183. jsonOssTask.BaiduExtrCode = frm.tx_code.Text;
  184. jsonOssTask.BaiduShareUrl = frm.tx_url.Text;
  185. OssTask.frmOssTask.SendBaiduShare2WebSrv( jsonOssTask );
  186. }
  187. else
  188. {
  189. return;
  190. }
  191. }
  192. else
  193. {
  194. if ( OssTask.frmOssTask.SendOssTask2Svr( jsonOssTask ) )
  195. {
  196. OssTask.frmOssTask.PushTask( jsonOssTask );
  197. MessageBoxCustom.Show( "任务生成成功!" );
  198. }
  199. else
  200. {
  201. MessageBoxCustom.Show( "任务生成失败!" );
  202. }
  203. }
  204. }
  205. }
  206. } );
  207. }
  208. private void ChkCompleteOrder_Click( object sender, EventArgs e )
  209. {
  210. this.ucPagerEx1.PageCurrent = 1;
  211. this.ucPagerEx1.Bind();
  212. }
  213. int ucPagerEx1_EventPaging( UCPager.EventPagingArg e )
  214. {
  215. //pageData.PageSize = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReportFormPageSize;
  216. this.ucPagerEx1.PageSize = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReportFormPageSize;
  217. PublicFunctionRows();
  218. return ucPagerEx1.NMax;
  219. }
  220. public void BindPageData( int pageIndx, int pageSize, int totalCount )
  221. {
  222. ucPagerEx1.NMax = totalCount;
  223. ucPagerEx1.CurrentPageCount = (pageSize);
  224. ucPagerEx1.PageCurrent = pageIndx;
  225. }
  226. private void Btn_N8ViewGo_Click( object sender, EventArgs e )
  227. {
  228. #region N8选版
  229. if ( File.Exists( N8ViewGoPath ) )
  230. {
  231. LYFZ.Model.Model_ErpOrder model = obll.GetModel( "Ord_Number", this.dgvData.CurrentRow.Cells["Ord_Number"].Value );
  232. LYFZ.Model.Model_ErpOrderDigital vmodel = dbll.GetModel( "Ordv_ViceNumber", this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value );
  233. // 是否完成了选版;
  234. bool bFinishView = false;
  235. // 商品列表;
  236. List<LYFZ.Model.Model_ErpOrderProductList> listProduct = null;
  237. // 员工id;
  238. string staffId = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  239. // 员工姓名;
  240. string staffName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
  241. // 若N8已选的选版目录;
  242. StringBuilder strN8HasSelectPath = new StringBuilder();
  243. // 若N8未选的选版目录;
  244. StringBuilder strN8UnSelectPath = new StringBuilder();
  245. // 订单商品信息;
  246. LYFZ.BLL.BLL_ErpOrder currentOrderBll = new BLL.BLL_ErpOrder();
  247. // 是否已经N8选版完成;
  248. bool keepOnN8ViewGo = false;
  249. LYFZ.ExtendControlLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  250. {
  251. // 获取订单类型:儿童订单、婚纱订单……;
  252. LYFZ.EnumPublic.OrderType currentOrderType = (LYFZ.EnumPublic.OrderType)Convert.ToInt32( model.Ord_Type );
  253. if ( LYFZ.Network.PlatinumClientProcess.N8SvrConfig == null )
  254. {
  255. MessageBoxCustom.Show( "服务器未设置N8信息,请到服务器设置" );
  256. return;
  257. }
  258. strN8HasSelectPath.Append( LYFZ.Network.PlatinumClientProcess.N8SvrConfig.N8ServerUserDirectory );
  259. strN8UnSelectPath.Append( LYFZ.Network.PlatinumClientProcess.N8SvrConfig.N8ServerUserDirectory );
  260. if ( currentOrderType == EnumPublic.OrderType.儿童订单 )
  261. {
  262. // 获取儿童订单的成长次数名;
  263. LYFZ.BLL.BLL_ErpOrdersPhotography photoBll = new BLL.BLL_ErpOrdersPhotography();
  264. List<LYFZ.Model.Model_ErpOrdersPhotography> photoModelList = photoBll.GetViceNumberToModel( vmodel.Ordv_ViceNumber );
  265. // 次数名;
  266. string CurrentSightsName = photoModelList[0].Ordpg_Sights;
  267. strN8HasSelectPath.Append( model.Ord_Number );
  268. strN8HasSelectPath.Append( "\\[已选]" );
  269. strN8HasSelectPath.Append( CurrentSightsName );
  270. strN8UnSelectPath.Append( model.Ord_Number );
  271. strN8UnSelectPath.Append( "\\" );
  272. strN8UnSelectPath.Append( CurrentSightsName );
  273. }
  274. else
  275. {
  276. strN8HasSelectPath.Append( "[已选]" );
  277. strN8HasSelectPath.Append( model.Ord_Number );
  278. strN8UnSelectPath.Append( model.Ord_Number );
  279. }
  280. // 获取订单商品信息;
  281. listProduct = currentOrderBll.GetOrderProductList( vmodel.Ordv_Number, vmodel.Ordv_ViceNumber, DAL.OrderProductType.制作商品 );
  282. if ( Directory.Exists( strN8HasSelectPath.ToString() ) )
  283. {
  284. if ( currentOrderType == EnumPublic.OrderType.儿童订单 )
  285. {
  286. if ( DialogResult.Yes == MessageBoxCustom.Show( "该儿童成长次数选版已完成,是否继续N8选版?", "提示消息", MessageBoxButtons.YesNo ) )
  287. {
  288. keepOnN8ViewGo = true;
  289. }
  290. }
  291. else
  292. {
  293. if ( DialogResult.Yes == MessageBoxCustom.Show( "该订单选版已完成,是否继续N8选版?", "提示消息", MessageBoxButtons.YesNo ) )
  294. {
  295. keepOnN8ViewGo = true;
  296. }
  297. }
  298. bFinishView = true;
  299. }
  300. else
  301. {// 如果没有选版完成,导入商品信息到本次N8选版订单中;
  302. if ( !Directory.Exists( strN8UnSelectPath.ToString() ) )
  303. {
  304. if ( currentOrderType == EnumPublic.OrderType.儿童订单 )
  305. MessageBoxCustom.Show( "未找到该童成长次数选版,退出N8选版" );
  306. else
  307. MessageBoxCustom.Show( "未找到该订单选版,退出N8选版" );
  308. return;
  309. }
  310. keepOnN8ViewGo = true;
  311. if ( !Directory.Exists( strN8UnSelectPath + "\\选版结果\\" ) )
  312. {
  313. Directory.CreateDirectory( strN8UnSelectPath + "\\选版结果\\" );
  314. }
  315. // 导入商品到本次n8选版结果中;
  316. //File.Delete(strN8UnSelectPath + "\\选版结果\\product.data");
  317. //File.Delete(strN8UnSelectPath + "\\选版结果\\vgproduct.data");
  318. DAL.N8Process.DAL_N8ResultProduct dalResulProduct = new DAL.N8Process.DAL_N8ResultProduct( strN8UnSelectPath + "\\选版结果\\product.data" );
  319. DAL.N8Process.DAL_N8ResultViewGoProduct dalResulViewGoProduct = new DAL.N8Process.DAL_N8ResultViewGoProduct( strN8UnSelectPath + "\\选版结果\\vgproduct.data" );
  320. if ( !File.Exists( strN8UnSelectPath + "\\选版结果\\product.data" ) || !File.Exists( strN8UnSelectPath + "\\选版结果\\vgproduct.data" ) )
  321. {
  322. foreach ( Model.Model_ErpOrderProductList product in listProduct )
  323. {// 遍历添加;
  324. dalResulProduct.AddResultProduct( product.ID.ToString(), product.OPlist_ProdNumber, "", product.OPlist_ProdName, product.OPlist_ProdWidth, product.OPlist_ProdHeight, false );
  325. dalResulViewGoProduct.AddResultViewGoProduct( product.ID.ToString(), product.OPlist_ProdNumber, "", product.OPlist_ProdName, product.OPlist_ProdWidth, product.OPlist_ProdHeight, false );
  326. }
  327. }
  328. }
  329. } );
  330. try
  331. {
  332. if ( keepOnN8ViewGo )
  333. {
  334. ProcessStartInfo startInfo = new ProcessStartInfo( N8ViewGoPath );
  335. startInfo.Arguments = string.Format( "/t \"<task userfolder='{0}' staffid='{1}' serverip='{2}'/>\"", bFinishView ? strN8HasSelectPath.ToString() : strN8UnSelectPath.ToString(), staffId, LYFZ.Network.PlatinumClientProcess.N8SvrConfig.N8ServerIpAddress );
  336. Process proc = Process.Start( startInfo );
  337. if ( proc != null )
  338. {
  339. proc.WaitForExit();
  340. MessageBoxCustom.Show( "选版完成" );
  341. }
  342. }
  343. if ( !bFinishView && Directory.Exists( strN8HasSelectPath.ToString() ) )
  344. {
  345. bFinishView = true;
  346. }
  347. // N8选版完成,处理加挑;
  348. #if !DEBUG
  349. if ( bFinishView )
  350. #endif
  351. {
  352. frmSaveN8Selection dlg = new frmSaveN8Selection();
  353. dlg.N8ServerUserDirectory = Directory.Exists( strN8HasSelectPath.ToString() ) ? strN8HasSelectPath.ToString() : strN8UnSelectPath.ToString();
  354. dlg.CurrentModel = model;
  355. dlg.CurrentModelDigital = vmodel;
  356. dlg.PhotoModelList = listProduct;
  357. dlg.ShowDialog();
  358. }
  359. }
  360. catch ( ArgumentException ex )
  361. {
  362. MessageBox.Show( ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error );
  363. }
  364. }
  365. else
  366. {
  367. MessageBoxCustom.Show( "N8选版客户端程序不存在, 请重置!" );
  368. }
  369. #endregion
  370. }
  371. void btnExport_Click( object sender, EventArgs e )
  372. {
  373. if ( this.dgvData.Rows.Count > 0 )
  374. {
  375. if ( this.dgvData.CurrentRow.Index >= 0 )
  376. {
  377. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.OrderReportExportOptionsSuperSmallForm frm = new LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.OrderReportExportOptionsSuperSmallForm();
  378. frm.ShowDialog();
  379. if ( frm.IsSaveed )
  380. {
  381. try
  382. {
  383. if ( !frm.isExportPhotograph )
  384. {
  385. if ( frm.IsExportCurrent )
  386. {
  387. this.dgvData.ExportDataTable( StrFileName: "订单报表" );
  388. }
  389. else
  390. {
  391. Dictionary<string, string> dictColumns = new Dictionary<string, string>();
  392. //Hashtable htData =
  393. DataTable newTable = this.GetExportReportData();
  394. SaveFileDialog saveFile = new SaveFileDialog();
  395. saveFile.FileName = "订单报表";
  396. saveFile.Title = "导出数据报表文件";
  397. saveFile.Filter = "EXECL文件(*.xls) |*.xls |文本文件(*.txt) |*.txt |所有文件(*.*) |*.*";
  398. saveFile.FilterIndex = 1;
  399. DialogResult drst = saveFile.ShowDialog();
  400. if ( drst == DialogResult.No || drst == DialogResult.Cancel || drst == DialogResult.No || drst == DialogResult.Abort )
  401. {
  402. return;
  403. }
  404. LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod(delegate (object obj, System.ComponentModel.BackgroundWorker backgroundWorker)
  405. {
  406. try
  407. {
  408. if (LYFZ.WinAPI.CustomPublicMethod.DataGridViewToExcel(saveFile.FileName.Trim(), newTable, null, backgroundWorker))
  409. {
  410. MessageBoxCustom.Show("数据导出成功!");
  411. }
  412. else
  413. {
  414. MessageBoxCustom.Show("数据导出失败!");
  415. }
  416. }
  417. catch (Exception ex)
  418. {
  419. MessageBoxCustom.Show(String.Format("导出数据出错:{0}", ex.Message));
  420. }
  421. });
  422. }
  423. }
  424. else
  425. {
  426. Dictionary<string, string> dictColumns = new Dictionary<string, string>();
  427. DataTable newTable = GetExportReportData();
  428. SaveFileDialog saveFile = new SaveFileDialog();
  429. saveFile.FileName = "订单报表";
  430. saveFile.Title = "导出数据报表文件";
  431. saveFile.Filter = "EXECL文件(*.xls) |*.xls |文本文件(*.txt) |*.txt |所有文件(*.*) |*.*";
  432. saveFile.FilterIndex = 1;
  433. DialogResult drst = saveFile.ShowDialog();
  434. if ( drst == DialogResult.No || drst == DialogResult.Cancel || drst == DialogResult.No || drst == DialogResult.Abort )
  435. {
  436. return;
  437. }
  438. LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod(delegate (object obj, System.ComponentModel.BackgroundWorker backgroundWorker)
  439. {
  440. try
  441. {
  442. if (LYFZ.WinAPI.CustomPublicMethod.DataGridViewToExcel(saveFile.FileName.Trim(), newTable, null, backgroundWorker))
  443. {
  444. MessageBoxCustom.Show("数据导出成功!");
  445. }
  446. else
  447. {
  448. MessageBoxCustom.Show("数据导出失败!");
  449. }
  450. }
  451. catch (Exception ex)
  452. {
  453. MessageBoxCustom.Show(String.Format("导出数据出错:{0}", ex.Message));
  454. }
  455. });
  456. }
  457. }
  458. catch ( Exception ex )
  459. {
  460. MessageBoxCustom.Show( "导出失败:" + ex.Message );
  461. }
  462. }
  463. }
  464. }
  465. }
  466. private DataTable GetExportReportData()
  467. {
  468. this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number,Ord_Type,Ordv_ViceNumber,订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,欠款,入册加挑张数,入底加挑张数,加挑金额,拍摄名称,拍照状态,摄影师,化妆师,引导师,初修师,初修状态,初修日期,选片师,选片日期,选片状态,设计状态,精修状态,看版状态,取件状态,会员卡号";
  469. string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0004.ToString().Trim();
  470. if ( (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.MemberCardShowHide) )
  471. {
  472. this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type,会员卡号";
  473. }
  474. else
  475. {
  476. this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type";
  477. }
  478. this.dgvData.dgvGuidName = StrGuidName;
  479. this.dgvData.dgvUserEmployeeID = this.StrUserID;
  480. this.dgvData.StrValueNullColumn = "订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,欠款,会员卡号";
  481. this.dgvData.DataColumns( this.dgvData.dgvCurrentColumnOriginalSet, strHideField: this.dgvData.dgvFixedHideColumn );
  482. Dictionary<string, string> dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns( this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet );
  483. this.dgvData.dictShowColumName = dictColumns;
  484. string StrQueryCondition = "";
  485. if ( IsFirstRun && !string.IsNullOrEmpty( LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber ) )
  486. {
  487. 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" );
  488. this.cmbQueryText.Text = LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber;
  489. StrQueryCondition = StrWhere + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhere( this.cmbtreevStoreName, "Ord_DividedShop" );
  490. }
  491. else
  492. {
  493. StrQueryCondition = this.GetWhereStr();
  494. }
  495. int intTopCount = 10000;
  496. DataSet dtSet = LYFZ.BLL.BLL_ErpOrderView.GetData_OrderFilmSelection( dictColumns, StrQueryCondition, intTopCount, this.StrSortField, true );
  497. //PublicFunctionRows();
  498. this.ucPagerEx1.PageCurrent = 1;
  499. ucPagerEx1.Bind();
  500. return dtSet.Tables[0];
  501. }
  502. void btnPrintOrder_Click( object sender, EventArgs e )
  503. {
  504. if ( this.dgvData.CurrentRow != null )
  505. {
  506. string MainOrderNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();//主订单号
  507. string ViceOrderNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//副订单号
  508. LYFZ.BLL.BLL_ErpOrderDigital mydbll = new LYFZ.BLL.BLL_ErpOrderDigital();
  509. if ( this.dgvData.CurrentRow.Cells["选片状态"].Value.ToUpperString() == "OK" )
  510. {
  511. LYFZ.PhotoSelectSystem.EventSelectPhotoPrint eventSelectPhotoPrint = null;
  512. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  513. {
  514. backgroundWorker.ReportProgress( 0, "正在获取选片信息...." );
  515. LYFZ.Model.Model_ErpOrderDigital vmodel = mydbll.GetModel( "Ordv_ViceNumber", ViceOrderNumber );
  516. LYFZ.Model.Model_ErpOrder model = obll.GetModel( "Ord_Number", MainOrderNumber );
  517. eventSelectPhotoPrint = LYFZ.PhotoSelectSystem.frmSaveSelectPhotoInfo.GetStaticSelectPhotoPrint( model, vmodel );
  518. } );
  519. if ( eventSelectPhotoPrint != null )
  520. {
  521. LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat( LYFZ.EnumPublic.PrintTypeEnum.制作单明细, eventSelectPhotoPrint );
  522. }
  523. else
  524. {
  525. MessageBoxCustom.Show( "获取选片信息失败" );
  526. }
  527. }
  528. else
  529. {
  530. MessageBoxCustom.Show( "选片未完成,不可以打单!" );
  531. }
  532. }
  533. }
  534. /// <summary>
  535. /// 订单号(用于开单处跳转过来)
  536. /// </summary>
  537. public string StrOrdNumber = "";
  538. /// <summary>
  539. /// 是否首次运行
  540. /// </summary>
  541. bool IsFirstRun = true;
  542. /// <summary>
  543. /// 查询条件
  544. /// </summary>
  545. private Dictionary<string, string> DictData = new Dictionary<string, string>();
  546. /// <summary>
  547. /// 员工编号
  548. /// </summary>
  549. string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  550. /// <summary>
  551. /// 员工姓名
  552. /// </summary>
  553. string StrUserName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
  554. /// <summary>
  555. /// 窗体加载
  556. /// </summary>
  557. /// <param name="sender"></param>
  558. /// <param name="e"></param>
  559. void FilmSelectionFormMain_Shown( object sender, EventArgs e )
  560. {
  561. ///重拍功能的的版本权限
  562. List<Control> hideControl = new List<Control>();
  563. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  564. hideControl.Add( this.btnYunFilmSelection );
  565. hideControl.Add( this.btnYunFilmSelectionResult );
  566. bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  567. LYFZ.Software.MainBusiness.VersionControl.VersionFunctionEnum.订单选片云选片,
  568. hideControl, null, null );
  569. hideControl = new List<Control>();
  570. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  571. hideControl.Add( this.btnYunFilmSelectionResult );
  572. b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  573. LYFZ.Software.MainBusiness.VersionControl.VersionFunctionEnum.订单选片云选片,
  574. hideControl, null, null );
  575. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName( this.cmbtreevStoreName, StrGroupKeyCode: "retailProcess", StrKeyCode: "st008" );
  576. this.PublicFunctionRights();
  577. //this.PublicFunctionRows();
  578. this.ucPagerEx1.PageCurrent = 1;
  579. this.ucPagerEx1.Bind();
  580. this.IsFirstRun = false;
  581. this.FilmSelectionFormMain_Resize( this, null );
  582. }
  583. /// <summary>
  584. /// 窗体加载事件
  585. /// </summary>
  586. /// <param name="sender"></param>
  587. /// <param name="e"></param>
  588. void FilmSelectionFormMain_Load( object sender, EventArgs e )
  589. {
  590. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetSystemVersion( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion );
  591. this.cmbQueryText.Text = this.StrOrdNumber;
  592. #region 获取是否N8选版
  593. if ( BLL.BLL_N8ClientConfig.N8ViewGoEnable )
  594. {
  595. // 显示n8选版按钮;
  596. this.btn_N8ViewGo.Visible = true;
  597. // 获取本机是否启动N8选版信息;
  598. IsUserN8ViewGo = true;
  599. N8ViewGoPath = BLL.BLL_N8ClientConfig.N8ViewGoPath;
  600. // 获取N8服务器地址;
  601. if ( LYFZ.Network.PlatinumClientProcess.N8SvrConfig == null )
  602. LYFZ.Network.PlatinumClientProcess.GetN8ServerConfig();
  603. }
  604. #endregion
  605. }
  606. /// <summary>
  607. /// 选择分店获取权限
  608. /// </summary>
  609. void PublicFunctionRights()
  610. {
  611. this.btnStartFilmSelection.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.StartFilmSelection );
  612. this.btnCacheNative.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.FilmSelectionCache );
  613. //this.btnCacheManage.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.FilmSelectionCacheManage);
  614. this.btnYunFilmSelection.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.YunSelectionFilm );
  615. this.btnYunFilmSelectionResult.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.YunSelectionFilmResult );
  616. this.btnExport.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.DataExport );
  617. }
  618. /// <summary>
  619. /// 分店选择查询数据
  620. /// </summary>
  621. /// <param name="sender"></param>
  622. /// <param name="e"></param>
  623. void cmbtreevStoreName_ComboBoxTree_NodeMouseClick( object sender, TreeNodeMouseClickEventArgs e )
  624. {
  625. this.PublicFunctionRights();
  626. //this.PublicFunctionRows();
  627. this.ucPagerEx1.PageCurrent = 1;
  628. this.ucPagerEx1.Bind();
  629. }
  630. /// <summary>
  631. /// 回车
  632. /// </summary>
  633. /// <param name="sender"></param>
  634. /// <param name="e"></param>
  635. void cmbQueryText_KeyDown( object sender, KeyEventArgs e )
  636. {
  637. if ( e.KeyCode == Keys.Enter )
  638. {
  639. this.btnQuery_Click( this, null );
  640. }
  641. }
  642. /// <summary>
  643. /// 查询
  644. /// </summary>
  645. /// <param name="sender"></param>
  646. /// <param name="e"></param>
  647. void btnQuery_Click( object sender, EventArgs e )
  648. {
  649. this.DictData.Clear();
  650. //this.PublicFunctionRows();
  651. this.ucPagerEx1.PageCurrent = 1;
  652. this.ucPagerEx1.Bind();
  653. }
  654. /// <summary>
  655. /// 已修未选
  656. /// </summary>
  657. /// <param name="sender"></param>
  658. /// <param name="e"></param>
  659. void btnHasRepairNoSelection_Click( object sender, EventArgs e )
  660. {
  661. this.DictData.Clear();
  662. DictData["FilmSelectionStatus"] = LYFZ.EnumPublic.FilmSelectionStatusEnum.未选.ToString();
  663. DictData["EarlyRepairStatus"] = "OK,修片中";
  664. DictData["PickupStatusNotOK"] = "OK";
  665. //this.PublicFunctionRows();
  666. this.ucPagerEx1.PageCurrent = 1;
  667. this.ucPagerEx1.Bind();
  668. }
  669. /// <summary>
  670. /// 条件查询
  671. /// </summary>
  672. /// <param name="sender"></param>
  673. /// <param name="e"></param>
  674. void btnConditionQuery_Click( object sender, EventArgs e )
  675. {
  676. this.DictData.Clear();
  677. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ConditionQuerySamllForm frm = new SetSmallForm.ConditionQuerySamllForm();
  678. frm.bPhotographNumber = true;
  679. frm.LoadType = "选片";
  680. frm.ShowDialog();
  681. if ( frm.DictDataArray.Count > 0 )
  682. {
  683. this.DictData = frm.DictDataArray;
  684. //this.PublicFunctionRows();
  685. this.ucPagerEx1.PageCurrent = 1;
  686. this.ucPagerEx1.Bind();
  687. }
  688. }
  689. /// <summary>
  690. /// 开始选片
  691. /// </summary>
  692. /// <param name="sender"></param>
  693. /// <param name="e"></param>
  694. void btnStartFilmSelection_Click( object sender, EventArgs e )
  695. {
  696. if ( this.dgvData.Rows.Count > 0 )
  697. {
  698. if ( this.dgvData.CurrentRow != null )
  699. {
  700. if ( this.dgvData.CurrentRow.Index >= 0 )
  701. {
  702. string ViceOrderNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//副订单号
  703. if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( ViceOrderNumber ) )
  704. {
  705. return;
  706. }
  707. bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(
  708. LYFZ.Software.MainBusiness.VersionControl.VersionFunctionEnum.订单选片选P, false );
  709. LYFZ.Software.MainBusiness.DoorCityProcess.FilmSelectionStart.ShowPhotoSelectSystemMainPhotoSelect( this.dgvData.CurrentRow );
  710. return;
  711. }
  712. }
  713. MessageBoxCustom.Show( "请选择订单" );
  714. }
  715. }
  716. /// <summary>
  717. /// 缓存本机
  718. /// </summary>
  719. /// <param name="sender"></param>
  720. /// <param name="e"></param>
  721. void btnCacheNative_Click( object sender, EventArgs e )
  722. {
  723. if ( this.dgvData.CurrentRow != null )
  724. {
  725. if ( !LYFZ.WinAPI.CustomPublicMethod.CheckInternaNetworkAddress( LYFZ.BLL.SelectPhotoHandling.ServerSddress ) )
  726. {
  727. ExMessageBoxCustom.Show( "外网访问时禁止缓存相片!." );
  728. return;
  729. }
  730. string ViceName = "";
  731. if ( this.dgvData.CurrentRow.Cells["Ord_Type"].Value.ToString().Trim() == Convert.ToInt32( LYFZ.EnumPublic.OrderType.儿童订单 ).ToString().Trim() )
  732. {
  733. try
  734. {
  735. ViceName = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim();
  736. }
  737. catch { }
  738. }
  739. string MainOrderNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();//主订单号
  740. string ViceOrderNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//副订单号
  741. if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( ViceOrderNumber ) )
  742. {
  743. return;
  744. }
  745. LYFZ.Model.Model_ErpOrder model = obll.GetModel( "Ord_Number", MainOrderNumber );
  746. LYFZ.Model.Model_ErpOrderDigital vmodel = dbll.GetModel( "Ordv_ViceNumber", ViceOrderNumber );
  747. LYFZ.PhotoSelectSystem.LocalCachePhoto lp = new PhotoSelectSystem.LocalCachePhoto( model, vmodel );
  748. LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  749. {
  750. lp.CachePhotoToLocal( ViceName, backgroundWorker );
  751. }, width: 500 );
  752. }
  753. else
  754. {
  755. MessageBoxCustom.Show( "请选择你要缓存下来的订单" ); return;
  756. }
  757. }
  758. /// <summary>
  759. /// 管理缓存
  760. /// </summary>
  761. /// <param name="sender"></param>
  762. /// <param name="e"></param>
  763. void btnCacheManage_Click( object sender, EventArgs e )
  764. {
  765. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.CacheManageSuperSmallForm frm = new SuperSmallForm.CacheManageSuperSmallForm();
  766. frm.ShowDialog();
  767. }
  768. /// <summary>
  769. /// 选片更改
  770. /// </summary>
  771. /// <param name="sender"></param>
  772. /// <param name="e"></param>
  773. void btnChangeFilmSelection_Click( object sender, EventArgs e )
  774. {
  775. MessageBoxCustom.Show( "此功能暂未开放" ); return;
  776. }
  777. /// <summary>
  778. /// 查看裁剪
  779. /// </summary>
  780. /// <param name="sender"></param>
  781. /// <param name="e"></param>
  782. void btnViewCropped_Click( object sender, EventArgs e )
  783. {
  784. MessageBoxCustom.Show( "此功能暂未开放" ); return;
  785. }
  786. /// <summary>
  787. /// 云选片
  788. /// </summary>
  789. /// <param name="sender"></param>
  790. /// <param name="e"></param>
  791. void btnYunFilmSelection_Click( object sender, EventArgs e )
  792. {
  793. if ( this.dgvData.Rows.Count > 0 )
  794. {
  795. if ( this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0 )
  796. {
  797. string MainOrderNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();//主订单号
  798. string ViceOrderNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//副订单号
  799. if ( !LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword( ViceOrderNumber ) )
  800. {
  801. return;
  802. }
  803. DoorCityProcess.DesignFormMain.ShowCloudSelection( MainOrderNumber, ViceOrderNumber, 0, 0 );
  804. }
  805. else
  806. {
  807. MessageBoxCustom.Show( "请选择要上传的订单" );
  808. }
  809. }
  810. }
  811. /// <summary>
  812. /// 云选片结果
  813. /// </summary>
  814. /// <param name="sender"></param>
  815. /// <param name="e"></param>
  816. void btnYunFilmSelectionResult_Click( object sender, EventArgs e )
  817. {
  818. DoorCityProcess.DesignFormMain.ShowCloudSelection( "", "", 1, 0 );
  819. }
  820. /// <summary>
  821. /// 关闭
  822. /// </summary>
  823. /// <param name="sender"></param>
  824. /// <param name="e"></param>
  825. void btnClose_Click( object sender, EventArgs e )
  826. {
  827. this.Close();
  828. }
  829. /// <summary>
  830. /// 儿童版
  831. /// </summary>
  832. /// <param name="sender"></param>
  833. /// <param name="e"></param>
  834. void chkKidsVersion_Click( object sender, EventArgs e )
  835. {
  836. if ( this.chkKidsVersion.Checked )
  837. {
  838. this.chkPortraitVersion.Checked = false; this.chkKidsVersion.Checked = true; this.chkDressVersion.Checked = false;
  839. }
  840. this.cmbQueryText.Text = "";
  841. //this.PublicFunctionRows();
  842. this.ucPagerEx1.PageCurrent = 1;
  843. this.ucPagerEx1.Bind();
  844. }
  845. /// <summary>
  846. /// 婚纱版
  847. /// </summary>
  848. /// <param name="sender"></param>
  849. /// <param name="e"></param>
  850. void chkDressVersion_Click( object sender, EventArgs e )
  851. {
  852. if ( this.chkDressVersion.Checked )
  853. {
  854. this.chkPortraitVersion.Checked = false; this.chkDressVersion.Checked = true; this.chkKidsVersion.Checked = false;
  855. }
  856. this.cmbQueryText.Text = "";
  857. //this.PublicFunctionRows();
  858. this.ucPagerEx1.PageCurrent = 1;
  859. this.ucPagerEx1.Bind();
  860. }
  861. /// <summary>
  862. /// 写真版
  863. /// </summary>
  864. /// <param name="sender"></param>
  865. /// <param name="e"></param>
  866. void chkPortraitVersion_Click( object sender, EventArgs e )
  867. {
  868. if ( this.chkPortraitVersion.Checked )
  869. {
  870. this.chkPortraitVersion.Checked = true; this.chkDressVersion.Checked = false; this.chkKidsVersion.Checked = false;
  871. }
  872. this.cmbQueryText.Text = "";
  873. //this.PublicFunctionRows();
  874. this.ucPagerEx1.PageCurrent = 1;
  875. this.ucPagerEx1.Bind();
  876. }
  877. /// <summary>
  878. /// 窗体大小发生改变事件
  879. /// </summary>
  880. /// <param name="sender"></param>
  881. /// <param name="e"></param>
  882. void FilmSelectionFormMain_Resize( object sender, EventArgs e )
  883. {
  884. if ( !this.IsFirstRun )
  885. {
  886. switch ( this.panelPortraitVersion.Location.Y )
  887. {
  888. case 4: this.flowLayoutPanel1.Height = 36; break;
  889. case 36: this.flowLayoutPanel1.Height = 68; break;
  890. }
  891. }
  892. }
  893. /// <summary>
  894. /// 点击事件
  895. /// </summary>
  896. /// <param name="sender"></param>
  897. /// <param name="e"></param>
  898. void dgvData_CellMouseDown( object sender, DataGridViewCellMouseEventArgs e )
  899. {
  900. if ( e.Button == MouseButtons.Right )
  901. {
  902. if ( e.RowIndex >= 0 && e.ColumnIndex >= 0 )
  903. {
  904. bool IsFind = false;
  905. Hashtable htData = null;
  906. ToolStripMenuItem item = null;
  907. if ( this.dgvData.Columns[e.ColumnIndex].Name.Trim() == "选片状态" )
  908. {
  909. if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.ProcessStatusReset ) )
  910. {
  911. this.dgvData.conMenu.Items.Clear();
  912. htData = new Hashtable();
  913. htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
  914. htData["StrStatusName"] = this.dgvData.Columns[e.ColumnIndex].Name.Trim() + ":";
  915. htData["StrStatusType"] = "2";
  916. htData["StrViceNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  917. //弹出操作菜单
  918. item = new ToolStripMenuItem();
  919. item.Text = "重置" + this.dgvData.Columns[e.ColumnIndex].Name.Trim();
  920. item.Tag = htData;
  921. item.Name = "ResetStatus";
  922. this.dgvData.conMenu.Items.Add( item );
  923. IsFind = true;
  924. }
  925. }
  926. else if ( this.dgvData.Columns[e.ColumnIndex].Name.Trim() == "选片日期" && this.dgvData.Rows[e.RowIndex].Cells["选片日期"].Value.ToString().Trim() != "" )
  927. {
  928. if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights( this.cmbtreevStoreName, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.ProcessDateReset ) )
  929. {
  930. this.dgvData.conMenu.Items.Clear();
  931. htData = new Hashtable();
  932. htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
  933. htData["StrViceNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  934. htData["StrOldDate"] = this.dgvData.Rows[e.RowIndex].Cells["选片日期"].Value.ToString().Trim();
  935. item = new ToolStripMenuItem();
  936. item.Text = "重置" + this.dgvData.Columns[e.ColumnIndex].Name.Trim();
  937. item.Tag = htData;
  938. item.Name = "ResetDate";
  939. this.dgvData.conMenu.Items.Add( item );
  940. IsFind = true;
  941. }
  942. }
  943. item = new ToolStripMenuItem();
  944. htData = new Hashtable();
  945. htData["StrNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString().Trim();
  946. htData["StrViceNumber"] = this.dgvData.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  947. item.Text = "订单备注";
  948. item.Tag = htData;
  949. item.Name = "OrderRemark";
  950. this.dgvData.conMenu.Items.Add( item );
  951. IsFind = true;
  952. if ( IsFind )
  953. {
  954. // this.dgvData.conMenu.Show( MousePosition.X, MousePosition.Y );//弹出操作菜单
  955. this.dgvData.conMenu.ItemClicked -= dgvData_DataGridViewConMenu_ItemClicked;
  956. this.dgvData.conMenu.ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
  957. // this.dgvData.conMenu.Show();
  958. if (!this.dgvData.conMenu.Visible)
  959. {
  960. this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
  961. }
  962. }
  963. if ( htData != null )
  964. {
  965. BindContextMenu( this.dgvData.Rows[e.RowIndex] );
  966. }
  967. }
  968. else
  969. {
  970. this.dgvData.conMenu.Items.Clear();
  971. ToolStripMenuItem item = new ToolStripMenuItem();
  972. item.Text = "设置标题";
  973. item.Tag = "SetColumnShow";
  974. item.Name = "SetColumnShow";
  975. this.dgvData.conMenu.Items.Add( item );
  976. // this.dgvData.conMenu.Show( MousePosition.X, MousePosition.Y );//弹出操作菜单
  977. this.dgvData.conMenu.ItemClicked -= dgvData_DataGridViewConMenu_ItemClicked;
  978. this.dgvData.conMenu.ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
  979. // this.dgvData.conMenu.Show();
  980. if (!this.dgvData.conMenu.Visible)
  981. {
  982. this.dgvData.conMenu.Show(MousePosition.X, MousePosition.Y);//弹出操作菜单
  983. }
  984. }
  985. }
  986. }
  987. /// <summary>
  988. /// 列表单击事件
  989. /// </summary>
  990. /// <param name="sender"></param>
  991. /// <param name="e"></param>
  992. void dgvData_CellClick( object sender, DataGridViewCellEventArgs e )
  993. {
  994. try
  995. {
  996. string StrNumber = this.dgvData.CurrentRow.Cells["订单号"].Value.ToString().Trim();
  997. if ( string.IsNullOrEmpty( StrNumber ) || StrNumber.Trim() == "(取件OK)" )
  998. {
  999. bool IsFind = false;
  1000. int i = this.dgvData.CurrentRow.Index;
  1001. while ( !IsFind )
  1002. {
  1003. i = i - 1;
  1004. if ( !string.IsNullOrEmpty( this.dgvData.Rows[i].Cells["订单号"].Value.ToString().Trim() ) )
  1005. {
  1006. StrNumber = this.dgvData.Rows[i].Cells["订单号"].Value.ToString().Trim(); IsFind = true;
  1007. }
  1008. }
  1009. }
  1010. LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = StrNumber;
  1011. }
  1012. catch
  1013. {
  1014. }
  1015. }
  1016. /// <summary>
  1017. /// 对列表控件双击事件
  1018. /// </summary>
  1019. /// <param name="sender"></param>
  1020. /// <param name="e"></param>
  1021. void dgvData_MouseDoubleClick( object sender, MouseEventArgs e )
  1022. {
  1023. Point hit = this.dgvData.PointToClient( Cursor.Position );
  1024. DataGridView.HitTestInfo hitTest = this.dgvData.HitTest( hit.X, hit.Y );
  1025. if ( hitTest.RowIndex < 0 && hitTest.ColumnIndex < 0 )
  1026. {
  1027. if ( !string.IsNullOrEmpty( this.cmbQueryText.Text.Trim() ) )
  1028. {
  1029. LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = "";
  1030. this.cmbQueryText.Text = "";
  1031. //this.PublicFunctionRows();
  1032. this.ucPagerEx1.PageCurrent = 1;
  1033. this.ucPagerEx1.Bind();
  1034. }
  1035. }
  1036. }
  1037. /// <summary>
  1038. /// 右键菜单选择项事件
  1039. /// </summary>
  1040. /// <param name="sender"></param>
  1041. /// <param name="e"></param>
  1042. void dgvData_DataGridViewConMenu_ItemClicked( object sender, ToolStripItemClickedEventArgs e )
  1043. {
  1044. ToolStripItem item = e.ClickedItem;
  1045. if ( item.Name.Trim() == "SetColumnShow" )
  1046. {
  1047. if ( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ShowDataGridViewSetColumn( this.dgvData ) )
  1048. {
  1049. //this.PublicFunctionRows();
  1050. this.ucPagerEx1.PageCurrent = 1;
  1051. this.ucPagerEx1.Bind();
  1052. }
  1053. }
  1054. else if ( item.Name.ToString().Trim() == "OrderRemark" )
  1055. {
  1056. Hashtable htData = (Hashtable)item.Tag;
  1057. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OrderRemarkRecordAddSuperSmallForm frm = new SuperSmallForm.OrderRemarkRecordAddSuperSmallForm();
  1058. frm.StrOrderNumber = htData["StrNumber"].ToString().Trim();
  1059. frm.StrOrdViceNumber = htData["StrViceNumber"].ToString().Trim();
  1060. frm.StrOrdModuleName = LYFZ.EnumPublic.EnumOrderRemarkModule.订单选片.ToString().Trim();
  1061. frm.ShowDialog();
  1062. }
  1063. else if ( item.Name.ToString().Trim() == "ResetStatus" )
  1064. {
  1065. Hashtable htData = (Hashtable)item.Tag;
  1066. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.OrderStatusResetSmallForm frm = new SetSmallForm.OrderStatusResetSmallForm();
  1067. frm.StrNumber = htData["StrNumber"].ToString();
  1068. frm.StrStatusName = htData["StrStatusName"].ToString();
  1069. frm.StrStatusType = htData["StrStatusType"].ToString();
  1070. frm.StrViceNumber = htData["StrViceNumber"].ToString();
  1071. frm.ShowDialog();
  1072. if ( frm.IsSaveed )
  1073. {
  1074. //PublicFunctionRows();
  1075. this.ucPagerEx1.PageCurrent = 1;
  1076. this.ucPagerEx1.Bind();
  1077. }
  1078. return;
  1079. }
  1080. else if ( item.Name.ToString().Trim() == "ResetDate" )
  1081. {
  1082. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.GetDateSuperSmallForm frm = new CameraControlBook.SuperSmallForm.GetDateSuperSmallForm();
  1083. frm.IsValueNull = false;
  1084. frm.ShowDialog();
  1085. if ( !frm.IsOK )
  1086. {
  1087. return;
  1088. }
  1089. if ( MessageBoxCustom.Show( "您确定要重置移选片日期吗?", "温馨提示", MessageBoxButtons.YesNo ) == DialogResult.No )
  1090. {
  1091. return;
  1092. }
  1093. DateTime strTime = SDateTime.Now;
  1094. Hashtable htData = (Hashtable)item.Tag;
  1095. List<Helper.CommandInfo> clist = new List<CommandInfo>();
  1096. LYFZ.Model.Model_ErpOrderDigital model = dbll.GetModel( "Ordv_ViceNumber", htData["StrViceNumber"] );
  1097. model.Ordv_FilmSelectionTime = Convert.ToDateTime( frm.StrValue );
  1098. model.Ordv_ReservationFilmSelectionTime = model.Ordv_FilmSelectionTime;
  1099. model.Ordv_UpdateDateTime = strTime;
  1100. model.Ordv_UpdateName = this.StrUserID;
  1101. clist.Add( dbll.GetUpdateCommandInfo( model ) );
  1102. string StrContent = "[重置选片日期] 数码编号为:" + htData["StrViceNumber"] + ",的选片日期由" + htData["StrOldDate"] + "改为" + frm.StrValue;
  1103. clist.Add( slogbll.GetAddCommandInfo( LYFZ.BLL.BLL_ErpSystemLogs.GetWriteLogModel( LYFZ.EnumPublic.SystemLogsType.订单流程重置, StrContent, this.StrUserID, this.StrUserName, LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.User_IP ) ) );
  1104. if ( clist.Count > 0 )
  1105. {
  1106. if ( LYFZ.BLL.BaseBllOperate.ExecuteSqlTran( clist ) > 0 )
  1107. {
  1108. //this.PublicFunctionRows();
  1109. this.ucPagerEx1.PageCurrent = 1;
  1110. this.ucPagerEx1.Bind();
  1111. MessageBoxCustom.Show( "重置成功!" );
  1112. }
  1113. else
  1114. {
  1115. MessageBoxCustom.Show( "重置失败!" );
  1116. }
  1117. }
  1118. }
  1119. }
  1120. /// <summary>
  1121. /// 点击列标头排序
  1122. /// </summary>
  1123. /// <param name="sender"></param>
  1124. /// <param name="e"></param>
  1125. void dgvData_ColumnHeaderMouseClick( object sender, DataGridViewCellMouseEventArgs e )
  1126. {
  1127. if ( e.Button == MouseButtons.Left )
  1128. {
  1129. string StrColumnName = GetOrderByName( this.dgvData.Columns[e.ColumnIndex].Name.Trim() );
  1130. if ( StrColumnName == this.StrCurrentClickField || string.IsNullOrEmpty( this.StrCurrentClickField ) )
  1131. {
  1132. if ( this.StrSortOrder == "ASC" )
  1133. {
  1134. this.StrSortOrder = "DESC";
  1135. }
  1136. else
  1137. {
  1138. this.StrSortOrder = "ASC";
  1139. }
  1140. }
  1141. else
  1142. {
  1143. this.StrSortOrder = "DESC";
  1144. }
  1145. if ( this.dgvData.StrValueNullColumn.Trim().IndexOf( StrColumnName ) == -1 || StrColumnName.Trim() == "欠款" || StrColumnName.Trim() == "套系金额" )
  1146. {
  1147. this.StrSortField = StrColumnName + " " + this.StrSortOrder + ",Ord_CreateDateTime,Ordv_DigitalNumber";
  1148. }
  1149. else
  1150. {
  1151. this.StrSortField = "Ord_CreateDateTime " + this.StrSortOrder + ",Ordv_DigitalNumber";
  1152. }
  1153. this.StrCurrentClickField = StrColumnName;
  1154. //this.PublicFunctionRows();
  1155. this.ucPagerEx1.PageCurrent = 1;
  1156. this.ucPagerEx1.Bind();
  1157. }
  1158. }
  1159. string GetOrderByName( string StrColumnName )
  1160. {
  1161. if ( StrColumnName == "选片时间" )
  1162. {
  1163. return "(case when Ordv_FilmSelectionStatus = '0' then Ordv_ReservationFilmSelectionTime else Ordv_FilmSelectionTime end)";
  1164. }
  1165. else if ( StrColumnName == "拍摄名称" )
  1166. {
  1167. return " Ordpg_Sights ";
  1168. }
  1169. else if ( StrColumnName == "摄影师" )
  1170. {
  1171. return " Ordpg_Photographer ";
  1172. }
  1173. else if ( StrColumnName == "化妆师" )
  1174. {
  1175. return " Ordpg_MakeupArtist ";
  1176. }
  1177. else if ( StrColumnName == "引导师" )
  1178. {
  1179. return " Ordpg_BootDivision ";
  1180. }
  1181. else if ( StrColumnName == "拍摄时间" )
  1182. {
  1183. return " Ordpg_PhotographyTime ";
  1184. }
  1185. else if ( StrColumnName == "拍照状态" )
  1186. {
  1187. return " Ordpg_PhotographyStatus ";
  1188. }
  1189. else if ( StrColumnName == "订单号" )
  1190. {
  1191. return " Ord_SinceOrderNumber ";
  1192. }
  1193. else if ( StrColumnName == "客户姓名" )
  1194. {
  1195. return " Cus_Name ";
  1196. }
  1197. else if ( StrColumnName == "客户性别" )
  1198. {
  1199. return " Cus_Sex_cs ";
  1200. }
  1201. else if ( StrColumnName == "客户电话" )
  1202. {
  1203. return " Cus_Telephone ";
  1204. }
  1205. else if ( StrColumnName == "订单类型" )
  1206. {
  1207. return " Ord_Type ";
  1208. }
  1209. else if ( StrColumnName == "接单人" )
  1210. {
  1211. return " Ord_OrderPersonName ";
  1212. }
  1213. else if ( StrColumnName == "套系名称" )
  1214. {
  1215. return " Ord_SeriesName ";
  1216. }
  1217. else if ( StrColumnName == "套系价格" )
  1218. {
  1219. return " Ord_SeriesPrice ";
  1220. }
  1221. else if ( StrColumnName == "摄影师" )
  1222. {
  1223. return " Ordpg_Photographer ";
  1224. }
  1225. else if ( StrColumnName == "拍摄时间" )
  1226. {
  1227. return " Ordpg_PhotographyTime ";
  1228. }
  1229. else if ( StrColumnName == "拍照状态" )
  1230. {
  1231. return " Ordpg_PhotographyStatus ";
  1232. }
  1233. else if ( StrColumnName == "初修师" )
  1234. {
  1235. return " Ordv_EarlyRepairName ";
  1236. }
  1237. else if ( StrColumnName == "选片师" )
  1238. {
  1239. return " Ordv_FilmSelectionName ";
  1240. }
  1241. else if ( StrColumnName == "初修日期" )
  1242. {
  1243. return " Ordv_EarlyRepairTime ";
  1244. }
  1245. else if ( StrColumnName == "选片日期" )
  1246. {
  1247. return " Ordv_FilmSelectionTime ";
  1248. }
  1249. else if ( StrColumnName == "初修状态" )
  1250. {
  1251. return " Ordv_EarlyRepairStatus ";
  1252. }
  1253. else if ( StrColumnName == "选片状态" )
  1254. {
  1255. return " Ordv_FilmSelectionStatus ";
  1256. }
  1257. else if ( StrColumnName == "加急" )
  1258. {
  1259. return " IsExpedited ";
  1260. }
  1261. else if ( StrColumnName == "加急日期" )
  1262. {
  1263. return " ExpeditedTime ";
  1264. }
  1265. else if ( StrColumnName == "设计状态" )
  1266. {
  1267. return " Ordv_DesignerStatus ";
  1268. }
  1269. else if ( StrColumnName == "精修状态" )
  1270. {
  1271. return " Ordv_RefinementStatus ";
  1272. }
  1273. else if ( StrColumnName == "看版状态" )
  1274. {
  1275. return " Ordv_LookDesignStatus ";
  1276. }
  1277. else if ( StrColumnName == "会员卡号" )
  1278. {
  1279. return " Mc_CradNumber ";
  1280. }
  1281. else if ( StrColumnName == "取件状态" )
  1282. {
  1283. return " Ords_ProductPickupIntStatus ";
  1284. }
  1285. return "";
  1286. }
  1287. /// <summary>
  1288. /// 当前点击的字段
  1289. /// </summary>
  1290. string StrCurrentClickField = "";
  1291. /// <summary>
  1292. /// 排序字段
  1293. /// </summary>
  1294. string StrSortField = "Ord_CreateDateTime DESC,Ordv_DigitalNumber";
  1295. /// <summary>
  1296. /// 排序顺序
  1297. /// </summary>
  1298. string StrSortOrder = "DESC";
  1299. /// <summary>
  1300. /// 创建行
  1301. /// </summary>
  1302. Hashtable PublicFunctionRows()
  1303. {
  1304. this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number,Ord_Type,Ordv_ViceNumber,订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,欠款,入册加挑张数,入底加挑张数,加挑金额,拍摄名称,拍照状态,摄影师,化妆师,引导师,初修师,初修状态,初修日期,选片师,选片日期,选片状态,设计状态,精修状态,看版状态,取件状态,会员卡号";
  1305. string StrGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0004.ToString().Trim();
  1306. if ( (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.MemberCardShowHide) )
  1307. {
  1308. this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type,会员卡号";
  1309. }
  1310. else
  1311. {
  1312. this.dgvData.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,Ord_Type";
  1313. }
  1314. this.dgvData.dgvGuidName = StrGuidName;
  1315. this.dgvData.dgvUserEmployeeID = this.StrUserID;
  1316. this.dgvData.StrValueNullColumn = "订单号,客户姓名,客户性别,客户电话,订单类型,接单人,套系名称,套系价格,欠款,会员卡号";
  1317. this.dgvData.DataColumns( this.dgvData.dgvCurrentColumnOriginalSet, strHideField: this.dgvData.dgvFixedHideColumn );
  1318. Dictionary<string, string> dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns( this.StrUserID, StrGuidName, this.dgvData.dgvCurrentColumnOriginalSet );
  1319. this.dgvData.dictShowColumName = dictColumns;
  1320. string StrQueryCondition = "";
  1321. if ( IsFirstRun && !string.IsNullOrEmpty( LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber ) )
  1322. {
  1323. 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" );
  1324. this.cmbQueryText.Text = LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber;
  1325. StrQueryCondition = StrWhere + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhere( this.cmbtreevStoreName, "Ord_DividedShop" );
  1326. }
  1327. else
  1328. {
  1329. StrQueryCondition = this.GetWhereStr();
  1330. }
  1331. int intTopCount = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPageSize();
  1332. Hashtable htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderFilmSelection( this.dgvData, dictColumns, StrQueryCondition, intTopCount, this.StrSortField, ucPagerEx1.PageCurrent );
  1333. this.dataGridViewStatisticsCount1.LocationX = this.dgvData.RowHeadersWidth;
  1334. this.dataGridViewStatisticsCount1.CurrenQuantity = Convert.ToInt32( htData["CurrentCount"] );
  1335. this.dataGridViewStatisticsCount1.TotalQuantity = Convert.ToInt32( htData["TotalCount"] );
  1336. BindPageData( ucPagerEx1.PageCurrent, Convert.ToInt32( htData["CurrentCount"] ), Convert.ToInt32( htData["TotalCount"] ) );
  1337. return htData;
  1338. }
  1339. /// <summary>
  1340. /// 返回要操作的条件
  1341. /// </summary>
  1342. /// <returns></returns>
  1343. string GetWhereStr()
  1344. {
  1345. string StrWhere = " Where Ord_Class = '1' " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere( this.cmbtreevStoreName, "Ord_DividedShop" );
  1346. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetQueryTextQueryCondition( cmbQueryText.Text.Trim() );
  1347. if ( chkCompleteOrder.Checked )
  1348. {
  1349. StrWhere += " and ( (Ords_ServiceIntStatus = 2 or ServiceCount=0 ) and (Ords_ProductPickupIntStatus = 2 or productCount=0 ) and (ServiceCount>0 or productCount>0) ) ";
  1350. }
  1351. else
  1352. {
  1353. if ( BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.HidePickUpOrder && !this.chkCompleteOrder.Checked && string.IsNullOrEmpty( this.cmbQueryText.Text ) )
  1354. {
  1355. StrWhere += " and (Ords_ProductPickupIntStatus in (0,1) and productCount>0 ) ";
  1356. }
  1357. else
  1358. {
  1359. 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 ) ) ";
  1360. }
  1361. }
  1362. if ( DictData.ContainsKey( "OrderArrears" ) && DictData["OrderArrears"].Trim().Length > 0 )
  1363. {
  1364. StrWhere += " and (套系金额 + isnull(加挑金额,0) - isnull(收款金额,0)) > 0 ";
  1365. }
  1366. if ( DictData.ContainsKey( "EarlyRepairStatus" ) && DictData["EarlyRepairStatus"].Trim().Length > 0 )
  1367. {
  1368. StrWhere += " and Ordv_EarlyRepairStatus <> '0'";
  1369. }
  1370. if ( DictData.ContainsKey( "FilmSelectionStatus" ) && DictData["FilmSelectionStatus"].Trim().Length > 0 )
  1371. {
  1372. StrWhere += " and Ordv_FilmSelectionStatus ='0'";
  1373. }
  1374. if ( DictData.ContainsKey( "FilmSelectionName" ) && DictData["FilmSelectionName"].Trim().Length > 0 )
  1375. {
  1376. StrWhere += " and Ordv_FilmSelectionName = '" + DictData["FilmSelectionName"].Trim() + "'";
  1377. }
  1378. if ( DictData.ContainsKey( "QueryDateTimeStart" ) && DictData["QueryDateTimeStart"].Trim().Length > 0 && DictData.ContainsKey( "QueryDateTimeEnd" ) && DictData["QueryDateTimeEnd"].Trim().Length > 0 )
  1379. {
  1380. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime( "Ordv_FilmSelectionTime", DictData["QueryDateTimeStart"].Trim(), DictData["QueryDateTimeEnd"].Trim() );
  1381. }
  1382. if ( DictData.ContainsKey( "Photographer" ) && DictData["Photographer"].Trim().Length > 0 )
  1383. {
  1384. StrWhere += " and Ordpg_Photographer like '%" + DictData["Photographer"].Trim() + "%'";
  1385. }
  1386. if ( DictData.ContainsKey( "PickupStatusNotOK" ) && DictData["PickupStatusNotOK"].Trim().Length > 0 )
  1387. {
  1388. StrWhere += " and Ords_ProductPickupIntStatus in (0,1)";
  1389. }
  1390. if ( DictData.ContainsKey( "EarlyRepairName" ) && DictData["EarlyRepairName"].Trim().Length > 0 )
  1391. {
  1392. StrWhere += " and Ordv_EarlyRepairName like '%" + DictData["EarlyRepairName"].Trim() + "%'";
  1393. }
  1394. if ( DictData.ContainsKey( "MakeupArtistNmae" ) && DictData["MakeupArtistNmae"].Trim().Length > 0 )
  1395. {
  1396. StrWhere += " and Ordpg_MakeupArtist like '%" + DictData["MakeupArtistNmae"].Trim() + "%'";
  1397. }
  1398. if ( DictData.ContainsKey( "BootDivisionName" ) && DictData["BootDivisionName"].Trim().Length > 0 )
  1399. {
  1400. StrWhere += " and Ordpg_BootDivision like '%" + DictData["BootDivisionName"].Trim() + "%'";
  1401. }
  1402. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL( this.chkPortraitVersion, this.chkDressVersion, this.chkKidsVersion, StrOrdType: "0,1,2" );
  1403. return StrWhere;
  1404. }
  1405. /// <summary>
  1406. /// 右键添加上传功能
  1407. /// </summary>
  1408. /// <param name="orNumber"></param>
  1409. void BindContextMenu( DataGridViewRow dataGridViewRow )
  1410. {
  1411. if ( BLL.N8Process.BLL_N8Process.IsN8ModelValid() )
  1412. {
  1413. #region 获取OSS信息;
  1414. if ( LYFZ.Network.OssOperation.OssProcess.GetOssStatus( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.TcpClient.Client, ref this.useOss ) )
  1415. {
  1416. if ( this.useOss )
  1417. {
  1418. Network.OssOperation.OssProcess.GetOssBranchList( out this.listbranch, ref this.useOss );
  1419. }
  1420. }
  1421. #endregion
  1422. ToolStripMenuItem menuItem = new ToolStripMenuItem();
  1423. menuItem.Text = "同步N8选版:" + dataGridViewRow.Cells["Ord_Number"].Value.ToString();
  1424. menuItem.Name = "NemoInfo";
  1425. menuItem.Tag = dataGridViewRow;
  1426. menuItem.Click += item_Click; ;
  1427. this.dgvData.conMenu.Items.Add( menuItem );
  1428. }
  1429. }
  1430. void item_Click( object sender, EventArgs e )
  1431. {
  1432. ToolStripMenuItem menuItem = (ToolStripMenuItem)sender;
  1433. FTPUpFileForm ftpForm = new FTPUpFileForm( 1 );
  1434. if ( this.useOss )
  1435. {
  1436. ftpForm.UseOss = true;
  1437. ftpForm.ListBranch = this.listbranch;
  1438. }
  1439. DataGridViewRow dgvr = (DataGridViewRow)((ToolStripMenuItem)sender).Tag;
  1440. LYFZ.BLL.BLL_ErpOrdersPhotography pbll = new BLL.BLL_ErpOrdersPhotography();
  1441. // 拍摄景点;
  1442. DataTable tbl = pbll.GetList( "Ordpg_Number='" + dgvr.Cells["Ord_Number"].Value.ToString() + "'" ).Tables[0];
  1443. string _Type = dgvr.Cells["Ord_Type"].Value.ToString();
  1444. string LoadType = "N8选版";
  1445. string signName = "";
  1446. string SightsName = "";
  1447. if ( _Type == "1" )
  1448. {// 儿童订单;
  1449. if ( tbl.Rows.Count > 0 )
  1450. {
  1451. for ( int i = 0; i < tbl.Rows.Count; i++ )
  1452. {
  1453. SightsName += tbl.Rows[i]["Ordpg_Sights"].ToString() + ",";
  1454. }
  1455. }
  1456. signName = SightsName.TrimEnd( ',' );
  1457. }
  1458. else if ( _Type != "1" )
  1459. {
  1460. if ( tbl.Rows.Count > 0 )
  1461. {
  1462. for ( int i = 0; i < tbl.Rows.Count; i++ )
  1463. {
  1464. SightsName += tbl.Rows[i]["Ordpg_Sights"].ToString() + (LoadType == "原片" ? "," : ",");
  1465. }
  1466. }
  1467. signName = SightsName.TrimEnd( ',' );
  1468. }
  1469. else
  1470. {
  1471. signName = dgvr.Cells["拍摄名称"].Value.ToString();
  1472. }
  1473. string[] str = signName.Split( ',' );
  1474. foreach ( var item in str )
  1475. {
  1476. CheckBoxEx cb = new CheckBoxEx();
  1477. cb.Text = item;
  1478. ftpForm.AddCheckBoxModel( cb );
  1479. cb.Checked = true;
  1480. }
  1481. ftpForm.BindData( dgvr.Cells["Ord_Number"].Value.ToString(), dgvr.Cells["Ordv_ViceNumber"].Value.ToString(), _Type, "设计", "" );
  1482. ftpForm.AddCheckBoxByFtpInfo( null );
  1483. ftpForm.ShowDialog();
  1484. }
  1485. }
  1486. public static class FilmSelectionStart
  1487. {
  1488. /// <summary>
  1489. /// 显示并进入选片系统
  1490. /// </summary>
  1491. /// <param name="currentRow"></param>
  1492. /// <returns></returns>
  1493. public static bool ShowPhotoSelectSystemMainPhotoSelect( DataGridViewRow currentRow )
  1494. {
  1495. bool ret = false;
  1496. if ( currentRow != null )
  1497. {
  1498. string MainOrderNumber = currentRow.Cells["Ord_Number"].Value.ToString().Trim();//主订单号
  1499. string ViceOrderNumber = currentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//副订单号
  1500. LYFZ.Software.MainBusiness.DoorCityProcess.FilmSelectionStart.ShowPhotoSelectSystemMainPhotoSelect( MainOrderNumber, ViceOrderNumber );
  1501. }
  1502. return ret;
  1503. }
  1504. /// <summary>
  1505. /// 显示并进入选片系统
  1506. /// </summary>
  1507. /// <param name="StrOrdNumber"></param>
  1508. /// <param name="StrViceNumber"></param>
  1509. /// <returns></returns>
  1510. public static bool ShowPhotoSelectSystemMainPhotoSelect( string StrOrdNumber, string StrViceNumber )
  1511. {
  1512. bool ret = false;
  1513. if ( !string.IsNullOrEmpty( StrOrdNumber ) && !string.IsNullOrEmpty( StrViceNumber ) )
  1514. {
  1515. LYFZ.BLL.BLL_ErpOrder myobll = new BLL.BLL_ErpOrder();
  1516. LYFZ.BLL.BLL_ErpOrderDigital mydbll = new LYFZ.BLL.BLL_ErpOrderDigital();
  1517. LYFZ.Model.Model_ErpOrder model = myobll.GetModel( "Ord_Number", StrOrdNumber );
  1518. LYFZ.Model.Model_ErpOrderDigital vmodel = mydbll.GetModel( "Ordv_ViceNumber", StrViceNumber );
  1519. bool ReadOnlyFilmSelection = false;
  1520. #if !DEBUG
  1521. if ( vmodel.Ordv_FilmSelectionStatus == "1")//&& LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.AuthorizationQuadraticPiece
  1522. {
  1523. // if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresFilmSelection, LYFZ.CustomAttributes.OperatingAuthority.QuadraticSelectPiece ) )
  1524. // {
  1525. DialogResult retDResult = MessageBoxCustom.Show( "订单已选片OK,未防止误操作造成选片信息错误和丢失,需要“二次选片权限”授权后才能选片"
  1526. + "\r\n选“是”开始请求授权\r\n选“否”将以只读模式进入选片系统\r\n选“取消”将取消本次操作", msgBoxButton: MessageBoxButtons.YesNoCancel );
  1527. //MessageBoxCustom.Show( "抱歉,你没有“二次选片权限”,需要授权后才能选片!\r\n"
  1528. // + "是否要请求授权并选片?\r\n选“是”开始请求授权\r\n选“否”将以只读模式进入选片系统\r\n选“取消”将取消本次操作", msgBoxButton: MessageBoxButtons.YesNoCancel );
  1529. if ( retDResult == DialogResult.Yes )
  1530. {
  1531. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm afrm = new SuperSmallForm.AuthorizeLoginSuperSmallForm( "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.QuadraticSelectPiece );
  1532. if ( afrm.ShowDialog() == System.Windows.Forms.DialogResult.OK )
  1533. {
  1534. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( afrm.CurrentAuthorizeUserRights.StoresFilmSelection, LYFZ.CustomAttributes.OperatingAuthority.QuadraticSelectPiece, afrm.User_BelongRoles ) )
  1535. {
  1536. afrm.SetAuthorizationResult( String.Format( "授权失败,授权人没有“二次选片权限”" ) );
  1537. MessageBoxCustom.Show( "抱歉,你没有“二次选片权限”" );
  1538. return false;
  1539. }
  1540. else
  1541. {
  1542. afrm.SetAuthorizationResult();
  1543. }
  1544. }
  1545. else
  1546. {
  1547. return false;
  1548. }
  1549. }
  1550. else if ( retDResult == DialogResult.Cancel )
  1551. {
  1552. return false;
  1553. }
  1554. else
  1555. {
  1556. ReadOnlyFilmSelection = true;
  1557. }
  1558. // }
  1559. }
  1560. #endif
  1561. //如果拥有选片权限时,检查订单是否被锁定
  1562. if ( !ReadOnlyFilmSelection )
  1563. {
  1564. // 当前订单是否被锁定
  1565. bool isLockOrder = false;
  1566. if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnableOrderLockFeature )
  1567. {
  1568. if ( model.ID > 0 )
  1569. {
  1570. isLockOrder = myobll.CheckOrderLock( model.ID );
  1571. }
  1572. if ( isLockOrder )
  1573. {
  1574. ReadOnlyFilmSelection = true;
  1575. if ( MessageBoxCustom.Show( String.Format( "此订单已被其他人员锁定,你不能对此订单进行选片操作。\r\n当有人正在修改订单或选片时,订单会被锁定。\r\n如果要强制解锁请选“是”进行解锁订单" ), msgBoxButton: MessageBoxButtons.YesNo ) == DialogResult.Yes )
  1576. {
  1577. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm frmAuthorize = new MainBusiness.DoorCityProcess.SuperSmallForm.AuthorizeLoginSuperSmallForm( null, CustomAttributes.OperatingAuthority.ErrorPrivilegeValue, 2 );
  1578. frmAuthorize.StrWindowText = "解锁订单授权";
  1579. if ( frmAuthorize.ShowDialog() == System.Windows.Forms.DialogResult.OK )
  1580. {
  1581. // if (!LYFZ.BLL.BLL_ErpUser.CheckAdministrator(frmAuthorize.User_BelongRoles))
  1582. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.OtherPermissionsSet, LYFZ.CustomAttributes.OperatingAuthority.UnlockOrderLock ) )
  1583. {
  1584. string msg = "授权失败,没有权限强制解锁订单";
  1585. frmAuthorize.SetAuthorizationResult( msg );
  1586. MessageBoxCustom.Show( msg );
  1587. }
  1588. else
  1589. {
  1590. ReadOnlyFilmSelection = false;
  1591. frmAuthorize.SetAuthorizationResult();
  1592. }
  1593. }
  1594. }
  1595. }
  1596. }
  1597. }
  1598. LYFZ.PhotoSelectSystem.MainPhotoSelect frm = new PhotoSelectSystem.MainPhotoSelect( model, vmodel, ReadOnlyFilmSelection );
  1599. if ( !frm.IsDisposed )
  1600. {
  1601. frm.EventPrintSingle += frm_EventPrintSingle;
  1602. frm.EventPrintSmallmap += frm_EventPrintSmallmap;
  1603. frm.EventMicroShareClick += frm_EventMicroShareClick;
  1604. frm.EventSelectProduct_Select += frm_EventSelectProduct_Select;
  1605. frm.EventCalculatedPrintClick += frm_EventCalculatedPrintClick;
  1606. frm.EventEditOrder_Click += Frm_EventEditOrder_Click;
  1607. frm.BtnAdditionalPayments += Frm_BtnAdditionalPayments;
  1608. if ( frm.ShowDialog() == DialogResult.OK )
  1609. {
  1610. ret = true;
  1611. }
  1612. }
  1613. }
  1614. return ret;
  1615. }
  1616. private static void Frm_EventEditOrder_Click(PhotoSelectSystem.EventEditOrder e)
  1617. {
  1618. frmNewOrder newOrder = new frmNewOrder();
  1619. newOrder.OrderNumber = e.OrderNumber;
  1620. newOrder.IsShowUcNavigationTool = false;
  1621. newOrder.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1622. newOrder.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  1623. newOrder.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  1624. newOrder.OrderType = e.OrderType;
  1625. newOrder.IsSelectPhoto = true;
  1626. newOrder.ShowDialog();
  1627. if (newOrder.IsSaveData)
  1628. {
  1629. e.IsEditOrder = true;
  1630. }
  1631. }
  1632. private static void Frm_BtnAdditionalPayments(PhotoSelectSystem.EventAdditionalPayments e)
  1633. {
  1634. FinancialManagement.OrdersReceivables.FrmLatePayment frmLatePayment = new FinancialManagement.OrdersReceivables.FrmLatePayment();
  1635. frmLatePayment.StrOrdNumber = e.OrderModel.Ord_Number;
  1636. frmLatePayment.ShowDialog();
  1637. }
  1638. static void frm_EventCalculatedPrintClick( PhotoSelectSystem.EventCalculatedPrint e )
  1639. {
  1640. LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat( LYFZ.EnumPublic.PrintTypeEnum.加减乘除, e );
  1641. //e.SumText 合计
  1642. // e.ReserveProductList 原套系商品
  1643. //e.AddSelectedProductList; 商品加选
  1644. // e.UpgradeProductList 商品升级
  1645. //e.AddBatchProductList 商品加P
  1646. // e.BookAndEndList 入底入册统计
  1647. // e.AddSelectedProductList[0].Title 标题 也就是一项的第一行
  1648. // e.AddSelectedProductList[0].Value 第二行
  1649. // e.AddSelectedProductList[0].IsSum 标记是否为合计
  1650. }
  1651. static void frm_EventSelectProduct_Select( string type, PhotoSelectSystem.EventSelectProduct e )
  1652. {
  1653. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ToolboxListViewSamllForm frm = new SetSmallForm.ToolboxListViewSamllForm();
  1654. if ( type == "update" )
  1655. {
  1656. frm.IsFilmSelectionMultiple = false;
  1657. }
  1658. frm.LoadType = "套系包含商品";
  1659. frm.ShowDialog();
  1660. if ( frm.IsSaveed )
  1661. {
  1662. e.SetSelectProductList( frm.mlist );
  1663. }
  1664. }
  1665. static void frm_EventMicroShareClick( PhotoSelectSystem.EventMicroShare e )
  1666. {
  1667. try
  1668. {
  1669. LYFZ.Software.MainBusiness.MicroShare.FrmMicroShare frm = new MicroShare.FrmMicroShare();
  1670. frm.SPhotoList = e.SPhotoList;
  1671. frm.F_Number = e.MainOrderNumber;//主订单号
  1672. frm.F_CusName = e.CusName;
  1673. frm.F_Attractions = e.SightsName;
  1674. frm.F_MakeupArtist = e.MakeupArtist;
  1675. frm.Show();
  1676. }
  1677. catch ( Exception ex )
  1678. {
  1679. MessageBoxCustom.Show( "调用微分享失败!错误原因:" + ex.Message );
  1680. }
  1681. }
  1682. /// <summary>
  1683. /// 打印小图
  1684. /// </summary>
  1685. /// <param name="e"></param>
  1686. static void frm_EventPrintSmallmap( PhotoSelectSystem.EventSelectPhotoPrint e )
  1687. {
  1688. LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat( LYFZ.EnumPublic.PrintTypeEnum.选片缩略图, e );
  1689. }
  1690. /// <summary>
  1691. /// 打印单
  1692. /// </summary>
  1693. /// <param name="e"></param>
  1694. static void frm_EventPrintSingle( PhotoSelectSystem.EventSelectPhotoPrint e )
  1695. {
  1696. LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat( LYFZ.EnumPublic.PrintTypeEnum.制作单明细, e );
  1697. }
  1698. }
  1699. }