PhotographedFormMain.cs 80 KB

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