FrmSMSProcess.cs 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840
  1. using LYFZ.ComponentLibrary;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. namespace LYFZ.Software.MainBusiness.SMSManagement
  11. {
  12. public partial class FrmSMSProcess : LYFZ.Software.UI.SMSManagement.FrmSMSProcess
  13. {
  14. public FrmSMSProcess()
  15. {
  16. this.ucPagerEx1.EventPaging += ucPagerEx1_EventPaging;
  17. this.btnNotShoot.Click += new EventHandler(btnNotShoot_Click);
  18. this.btnNotSelectionFilms.Click += new EventHandler(btnNotSelectionFilms_Click);
  19. this.btnNotDesign.Click += new EventHandler(btnNotDesign_Click);
  20. this.btnNotPickup.Click += new EventHandler(btnNotPickup_Click);
  21. this.btnSmsSend.Click += new EventHandler(btnSmsSend_Click);
  22. this.btnClose.Click += new EventHandler(btnClose_Click);
  23. this.btnSelect.Click += btnSelect_Click;
  24. this.Shown += FrmSMSProcess_Shown;
  25. ShortSmsMessage.FrmScreening.bindCmbCustomerType(this.cmbCustomerType);
  26. if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType() == EnumPermissions.BusinessType.婚纱版 )
  27. {
  28. this.dgvOrderProcessCustomer.Columns[1].Visible = false;
  29. }
  30. SetSQueryWhereString();
  31. this.dgvOrderProcessCustomer.Sorted += dgvOrderProcessCustomer_Sorted;
  32. this.btnSendMicroMessage.Click += btnSendMicroMessage_Click;
  33. #region 优化列表;
  34. this.dgvOrderProcessCustomer.VirtualMode = true;
  35. this.dgvOrderProcessCustomer.CellValueNeeded += DgvOrderProcessCustomer_CellValueNeeded;
  36. #endregion
  37. }
  38. #region 优化列表;
  39. DataTable dataTable = null;
  40. private void DgvOrderProcessCustomer_CellValueNeeded( object sender, DataGridViewCellValueEventArgs e )
  41. {
  42. // 参数校验;
  43. if ( dataTable == null || dataTable.Rows.Count == 0 || dataTable.Rows.Count == e.RowIndex )
  44. return;
  45. if ( e.ColumnIndex == 0 )
  46. e.Value = dataTable.Rows[e.RowIndex]["订单号"];
  47. if ( e.ColumnIndex == 1 )
  48. e.Value = dataTable.Rows[e.RowIndex]["摄影名称"];
  49. if ( e.ColumnIndex == 2 )
  50. e.Value = dataTable.Rows[e.RowIndex]["订单类型"];
  51. if ( e.ColumnIndex == 3 )
  52. e.Value = dataTable.Rows[e.RowIndex]["客户姓名"];
  53. if ( e.ColumnIndex == 4 )
  54. e.Value = dataTable.Rows[e.RowIndex]["客户性别"];
  55. if ( e.ColumnIndex == 5 )
  56. e.Value = dataTable.Rows[e.RowIndex]["客户电话"];
  57. if ( e.ColumnIndex == 6 )
  58. {
  59. string[] BindIDList = null;
  60. if ( dataTable.Rows[e.RowIndex]["Cus_OpenID"] != null && dataTable.Rows[e.RowIndex]["Cus_OpenID"].ToString().Trim().Length > 0 )
  61. BindIDList = dataTable.Rows[e.RowIndex]["Cus_OpenID"].ToString().Split('/');
  62. if ( CheckWxBindOPenID(BindIDList) )
  63. {
  64. DataGridViewRow row = this.dgvOrderProcessCustomer.Rows[e.RowIndex];
  65. e.Value = "已绑定";
  66. row.Tag = BindIDList;
  67. }
  68. }
  69. if ( e.ColumnIndex == 7 )
  70. e.Value = dataTable.Rows[e.RowIndex]["拍照状态"];
  71. if ( e.ColumnIndex == 8 )
  72. e.Value = dataTable.Rows[e.RowIndex]["初修状态"];
  73. if ( e.ColumnIndex == 9 )
  74. e.Value = dataTable.Rows[e.RowIndex]["选片状态"];
  75. if ( e.ColumnIndex == 10 )
  76. e.Value = dataTable.Rows[e.RowIndex]["设计状态"];
  77. if ( e.ColumnIndex == 11 )
  78. e.Value = dataTable.Rows[e.RowIndex]["看设计状态"];
  79. if ( e.ColumnIndex == 12 )
  80. e.Value = dataTable.Rows[e.RowIndex]["齐件状态"];
  81. if ( e.ColumnIndex == 13 )
  82. e.Value = dataTable.Rows[e.RowIndex]["取件状态"];
  83. if ( e.ColumnIndex == 14 )
  84. {
  85. try
  86. {
  87. if ( dataTable.Rows[e.RowIndex]["预约日期"].ToString().Length >= 10 )
  88. e.Value = Convert.ToDateTime(dataTable.Rows[e.RowIndex]["预约日期"].ToString()).ToString("yyyy-MM-dd");
  89. }
  90. catch { }
  91. }
  92. if ( e.ColumnIndex == 15 )
  93. {
  94. try
  95. {
  96. if ( dataTable.Rows[e.RowIndex]["拍摄时间"].ToString().Length >= 10 )
  97. e.Value = Convert.ToDateTime(dataTable.Rows[e.RowIndex]["拍摄时间"].ToString()).ToString("yyyy-MM-dd");
  98. else if ( dataTable.Rows[e.RowIndex]["Ordpg_PhotographyCount"] == null || dataTable.Rows[e.RowIndex]["Ordpg_PhotographyCount"].ToString() == "0" )
  99. e.Value = "此单不含拍照";
  100. }
  101. catch { }
  102. }
  103. if ( e.ColumnIndex == 16 )
  104. {
  105. try
  106. {
  107. if ( dataTable.Rows[e.RowIndex]["初修时间"].ToString().Length >= 10 )
  108. e.Value = Convert.ToDateTime(dataTable.Rows[e.RowIndex]["初修时间"].ToString()).ToString("yyyy-MM-dd");
  109. }
  110. catch { }
  111. }
  112. if ( e.ColumnIndex == 17 )
  113. {
  114. try
  115. {
  116. if ( dataTable.Rows[e.RowIndex]["选片时间"].ToString().Length >= 10 )
  117. e.Value = Convert.ToDateTime(dataTable.Rows[e.RowIndex]["选片时间"].ToString()).ToString("yyyy-MM-dd");
  118. }
  119. catch { }
  120. }
  121. if ( e.ColumnIndex == 18 )
  122. {
  123. try
  124. {
  125. if ( dataTable.Rows[e.RowIndex]["设计时间"].ToString().Length >= 10 )
  126. e.Value = Convert.ToDateTime(dataTable.Rows[e.RowIndex]["设计时间"].ToString()).ToString("yyyy-MM-dd");
  127. }
  128. catch { }
  129. }
  130. if ( e.ColumnIndex == 19 )
  131. {
  132. try
  133. {
  134. if ( dataTable.Rows[e.RowIndex]["看设计时间"].ToString().Length >= 10 )
  135. e.Value = Convert.ToDateTime(dataTable.Rows[e.RowIndex]["看设计时间"].ToString()).ToString("yyyy-MM-dd");
  136. }
  137. catch { }
  138. }
  139. if ( e.ColumnIndex == 20 )
  140. {
  141. try
  142. {
  143. if ( dataTable.Rows[e.RowIndex]["取件日期"].ToString().Length >= 10 )
  144. e.Value = Convert.ToDateTime(dataTable.Rows[e.RowIndex]["取件日期"].ToString()).ToString("yyyy-MM-dd");
  145. else if ( dataTable.Rows[e.RowIndex]["productCount"] == null || dataTable.Rows[e.RowIndex]["productCount"].ToString() == "0" )
  146. {
  147. if ( dataTable.Rows[e.RowIndex]["Ord_Type"].ToString() == "1" )
  148. e.Value = "此单不含产品";
  149. }
  150. }
  151. catch { }
  152. }
  153. if ( e.ColumnIndex == 21 )
  154. {
  155. try
  156. {
  157. if ( dataTable.Rows[e.RowIndex]["齐件日期"].ToString().Length >= 10 )
  158. e.Value = Convert.ToDateTime(dataTable.Rows[e.RowIndex]["齐件日期"].ToString()).ToString("yyyy-MM-dd");
  159. else if ( dataTable.Rows[e.RowIndex]["productCount"] == null || dataTable.Rows[e.RowIndex]["productCount"].ToString() == "0" )
  160. {
  161. if ( dataTable.Rows[e.RowIndex]["Ord_Type"].ToString() == "1" )
  162. e.Value = "此单不含产品";
  163. }
  164. }
  165. catch { }
  166. }
  167. if ( e.ColumnIndex == 22 )
  168. e.Value = dataTable.Rows[e.RowIndex]["接单人"];
  169. if ( e.ColumnIndex == 23 )
  170. e.Value = dataTable.Rows[e.RowIndex]["套系名称"];
  171. if ( e.ColumnIndex == 24 )
  172. e.Value = dataTable.Rows[e.RowIndex]["套系价格"];
  173. }
  174. #endregion
  175. void btnSendMicroMessage_Click( object sender, EventArgs e )
  176. {
  177. if ( this.dgvOrderProcessCustomer.SelectedRows != null && this.dgvOrderProcessCustomer.SelectedRows.Count > 0 )
  178. {
  179. LYFZ.Software.MainBusiness.SMSManagement.SmsSend.frmSendMicroTemplateSMS sendMicro = new SmsSend.frmSendMicroTemplateSMS();
  180. string openIDs = "";
  181. for ( int i = 0; i < this.dgvOrderProcessCustomer.SelectedRows.Count; i++ )
  182. {
  183. if ( this.dgvOrderProcessCustomer.SelectedRows[i].Tag != null )
  184. {
  185. string[] temps = (string[])this.dgvOrderProcessCustomer.SelectedRows[i].Tag;
  186. foreach ( string bindOpenID in temps )
  187. {
  188. string[] openIDStr = bindOpenID.Split(':');
  189. if ( modInterFace.AppID != null && modInterFace.AppID.Trim().Length > 0 )
  190. {
  191. if ( openIDStr.Length == 2 )
  192. {
  193. string openID = openIDStr[1];
  194. if ( openIDStr[0].ToLower().Trim() == modInterFace.AppID.Trim().ToLower() )
  195. {
  196. if ( openID.Trim().Length > 0 && !openIDs.Contains(openID) )
  197. {
  198. openIDs += openID + ",";
  199. }
  200. }
  201. }
  202. }
  203. }
  204. }
  205. }
  206. sendMicro.DfTemplateNo = EnumPublic.MicroTemplate.拍摄服务提醒;
  207. sendMicro.ReceiveOPNIDs = openIDs.Trim(',');
  208. if ( sendMicro.ReceiveOPNIDs.Trim().Length > 0 )
  209. {
  210. sendMicro.ShowDialog();
  211. }
  212. else
  213. {
  214. MessageBoxCustom.Show("选择的客户没有绑定微信,不能发送微信消息");
  215. }
  216. }
  217. else
  218. {
  219. MessageBoxCustom.Show("请选择要发送消息的订单客户");
  220. }
  221. }
  222. void dgvOrderProcessCustomer_Sorted( object sender, EventArgs e )
  223. {
  224. Bind();
  225. }
  226. void btnSelect_Click( object sender, EventArgs e )
  227. {
  228. SetSQueryWhereString();
  229. Bind();
  230. }
  231. List<LYFZ.Software.MainBusiness.EnumPermissions.BusinessType> Versions = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessTypeList();
  232. #region 加载
  233. protected void FrmSMSProcess_Shown( object sender, EventArgs e )
  234. {
  235. List<Control> hideControl = new List<Control>();
  236. List<Control> moveControl = new List<Control>();
  237. hideControl.Add(cbxBindOK);
  238. //绑定门店
  239. BindStoreList(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition);
  240. moveControl.Add(cbxHideOK);
  241. //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D;
  242. bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(
  243. VersionControl.VersionFunctionEnum.短信管理微信短信推送, hideControl, moveControl, null);
  244. try
  245. {
  246. modInterFace = bllInterface.GetModelMicroInterface(LYFZ.BLL.BLL_ErpCompanyInfo.CurrentCompanyInfoID);
  247. #region 权限设置
  248. #region 短信发送
  249. if ( LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.SMSProcessCompetence, CustomAttributes.OperatingAuthority.SMSSend) )
  250. {
  251. btnSmsSend.Enabled = true;
  252. this.btnSendMicroMessage.Enabled = true;
  253. }
  254. else
  255. {
  256. btnSmsSend.Enabled = false;
  257. this.btnSendMicroMessage.Enabled = false;
  258. }
  259. List<string> dataSource = (List<string>)this.cmbCustomerType.DataSource;
  260. dataSource.Remove(ShortSmsMessage.SQueryCustomerType.其它客户.ToString());
  261. this.cmbCustomerType.DataSource = null;
  262. this.cmbCustomerType.DataSource = dataSource;
  263. this.cmbCustomerType.SelectedItem = ShortSmsMessage.SQueryCustomerType.全部.ToString();
  264. #endregion
  265. #endregion
  266. Bind();
  267. }
  268. catch
  269. {
  270. }
  271. }
  272. string _SQueryWhereString = "1=1";
  273. /// <summary>
  274. /// 查询条件语句
  275. /// </summary>
  276. public string SQueryWhereString
  277. {
  278. get
  279. {
  280. return _SQueryWhereString;
  281. }
  282. set
  283. {
  284. _SQueryWhereString = value;
  285. }
  286. }
  287. public void Bind()
  288. {
  289. this.ucPagerEx1.PageCurrent = 1;
  290. this.ucPagerEx1.Bind();
  291. }
  292. private delegate void UpdateControl();
  293. string GetStoreWhere()
  294. {
  295. if (this.cbxStoreList.Items.Count > 0)
  296. {
  297. ItemValue itemStore = (ItemValue)this.cbxStoreList.SelectedItem;
  298. if (itemStore.Value.ToString() != "0")
  299. {
  300. return String.Format("Ord_DividedShop='{0}' and ", itemStore.Value.ToString());
  301. }
  302. }
  303. return "";
  304. }
  305. /// <summary>
  306. /// 设置查询条件
  307. /// </summary>
  308. void SetSQueryWhereString( ProcessStatus status = ProcessStatus.全部 )
  309. {
  310. string keyWords = this.txtKeyWords.Text.Trim();
  311. string ord_Type = "";
  312. ShortSmsMessage.SQueryCustomerType QCustomerType = ShortSmsMessage.SQueryCustomerType.全部;
  313. QCustomerType = (ShortSmsMessage.SQueryCustomerType)Enum.Parse(typeof(ShortSmsMessage.SQueryCustomerType), this.cmbCustomerType.Text);
  314. switch ( QCustomerType )
  315. {
  316. case ShortSmsMessage.SQueryCustomerType.婚纱客户:
  317. ord_Type = "[Ord_Type]=0";
  318. break;
  319. case ShortSmsMessage.SQueryCustomerType.儿童客户:
  320. ord_Type = "[Ord_Type]=1";
  321. break;
  322. case ShortSmsMessage.SQueryCustomerType.写真客户:
  323. ord_Type = "[Ord_Type]=2";
  324. break;
  325. case ShortSmsMessage.SQueryCustomerType.其它客户:
  326. ord_Type = "[Ord_Type]=3";
  327. break;
  328. default:
  329. ord_Type = "[Ord_Type] in (0,1,2)";
  330. ord_Type = "1=1";
  331. break;
  332. }
  333. string processStatusString = "";
  334. switch ( status )
  335. {
  336. case ProcessStatus.已定未拍:
  337. processStatusString = " and [拍照状态] in('未拍','拍照中')";
  338. break;
  339. case ProcessStatus.已拍未选:
  340. processStatusString = " and ([拍照状态]='OK' and [选片状态]='未选')";
  341. break;
  342. case ProcessStatus.已设计未看:
  343. processStatusString = " and ([设计状态]='OK' and [看设计状态] in('未设计','设计中'))";
  344. break;
  345. case ProcessStatus.已完成未取:
  346. processStatusString = " and ([齐件状态]='OK' and [取件状态] in('未取','部分取件'))";
  347. break;
  348. }
  349. string selectOpenID = "";
  350. if ( this.cbxBindOK.Checked )
  351. {
  352. if ( modInterFace.AppID != null && modInterFace.AppID.Trim().Length > 0 )
  353. {
  354. selectOpenID = " and [Cus_OpenID] like '%" + modInterFace.AppID.Trim() + ":%' ";
  355. }
  356. }
  357. string Ord_DividedShop = GetStoreWhere();
  358. if ( keyWords.Length > 0 )
  359. {
  360. this.SQueryWhereString = Ord_DividedShop+ "(" +ord_Type + " and ( Ord_Number like '%" + keyWords + "%' "
  361. + " or [客户姓名] like '%" + keyWords + "%'"
  362. + " or [客户拼音] like '%" + keyWords + "%'"
  363. + " or [客户电话] like '%" + keyWords + "%') " + selectOpenID + processStatusString+")";
  364. }
  365. else
  366. {
  367. this.SQueryWhereString = Ord_DividedShop+"((1=1 and " + ord_Type + ") " + selectOpenID + processStatusString+")";
  368. }
  369. }
  370. BLL.BLL_ErpMicroInterface bllInterface = new BLL.BLL_ErpMicroInterface();
  371. LYFZ.Model.Model_ErpMicroInterface modInterFace = new Model.Model_ErpMicroInterface();
  372. LYFZ.BLL.BLL_CustomerAndWxOpen wxOPenBll = new BLL.BLL_CustomerAndWxOpen();
  373. List<LYFZ.Model.BindWxOpenID> wxOpenIDList = new List<LYFZ.Model.BindWxOpenID>();
  374. public List<LYFZ.Model.BindWxOpenID> WxOpenIDList
  375. {
  376. get
  377. {
  378. if ( wxOpenIDList.Count <= 0 )
  379. {
  380. if ( modInterFace.AppID != null && modInterFace.AppID.Trim().Length > 0 )
  381. {
  382. wxOpenIDList = wxOPenBll.GetWxOpenIdList(0, modInterFace.AppID.Trim());
  383. }
  384. }
  385. return wxOpenIDList;
  386. }
  387. }
  388. int ucPagerEx1_EventPaging( UCPager.EventPagingArg e )
  389. {
  390. LYFZ.UCPager.PageData pageData = new LYFZ.UCPager.PageData();
  391. if ( this.cbxHideOK.Checked )
  392. {
  393. pageData.TableName = "[dbo].[Vw_OrderProcessCustomer]";
  394. }
  395. else
  396. {
  397. pageData.TableName = "[dbo].[Vw_OrderProcessCustomerAll]";
  398. }
  399. pageData.PageIndex = this.ucPagerEx1.PageCurrent;
  400. pageData.PageSize = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.ReportFormPageSize;
  401. this.ucPagerEx1.PageSize = pageData.PageSize;
  402. pageData.QueryCondition = this.SQueryWhereString;
  403. pageData.QueryFieldName = "[ID]"
  404. + " ,[Ord_DividedShop]"
  405. + ",[Ord_Number]"
  406. + ",[订单号]"
  407. + ",[摄影名称]"
  408. + ",[订单类型]"
  409. + ",[客户姓名]"
  410. + ",[客户拼音]"
  411. + ",[客户性别]"
  412. + ",[客户电话]"
  413. + ",[套系类别]"
  414. + ",[客户来源] "
  415. + ",[套系名称]"
  416. + ",[套系价格]"
  417. + ",[接单人]"
  418. + ",[拍摄时间]"
  419. + ",[拍照状态]"
  420. + ",[初修时间]"
  421. + ",[初修状态]"
  422. + ",[选片时间]"
  423. + ",[选片状态]"
  424. + ",[设计时间]"
  425. + ",[设计状态]"
  426. + ",[精修时间]"
  427. + ",[精修状态]"
  428. + ",[看设计时间]"
  429. + ",[看设计状态]"
  430. + ",[取件状态]"
  431. + ",[取件日期]"
  432. + ",[齐件状态]"
  433. + ",[齐件日期]"
  434. + ",[预约日期]"
  435. + ",[Cus_OpenID]"
  436. + ",Ordpg_PhotographyCount"
  437. + ",productCount"
  438. + ",[Ord_CreateDateTime]";
  439. pageData.OrderStr = " id desc ";
  440. LYFZ.ComponentLibrary.DataGridViewEx.SortedColumnModel sortModel
  441. = this.dgvOrderProcessCustomer.GetSortedColumnModel("预约日期", ListSortDirection.Ascending);
  442. pageData.OrderStr = sortModel.OrderStr.TrimStart();
  443. dgvOrderProcessCustomer.Rows.Clear();
  444. //DataTable dataTable = null;
  445. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate ( object obj, BackgroundWorker backgroundWorker )
  446. {
  447. DataSet da = pageData.QueryDataTable();
  448. dataTable = da.Tables[0];
  449. try
  450. {
  451. if ( this.WxOpenIDList.Count > 0 )
  452. {
  453. //预加载
  454. }
  455. }
  456. catch { }
  457. });
  458. if ( dataTable.Rows.Count > 0 )
  459. {
  460. try
  461. {
  462. this.ucPagerEx1.TbDataSource = dataTable;
  463. }
  464. catch { }
  465. #if IGNORE
  466. #region
  467. for ( int i = 0; i < dataTable.Rows.Count; i++ )
  468. {
  469. DataGridViewRow row = new DataGridViewRow();
  470. row.CreateCells(this.dgvOrderProcessCustomer);
  471. row.Cells[0].Value = dataTable.Rows[i]["订单号"].ToString();
  472. row.Cells[1].Value = dataTable.Rows[i]["摄影名称"].ToString();
  473. row.Cells[2].Value = dataTable.Rows[i]["订单类型"].ToString();
  474. row.Cells[3].Value = dataTable.Rows[i]["客户姓名"].ToString();
  475. row.Cells[4].Value = dataTable.Rows[i]["客户性别"].ToString();
  476. row.Cells[5].Value = dataTable.Rows[i]["客户电话"].ToString();
  477. string[] BindIDList = null;
  478. if ( dataTable.Rows[i]["Cus_OpenID"] != null && dataTable.Rows[i]["Cus_OpenID"].ToString().Trim().Length > 0 )
  479. {
  480. BindIDList = dataTable.Rows[i]["Cus_OpenID"].ToString().Split('/');
  481. }
  482. if ( CheckWxBindOPenID(BindIDList) )
  483. {
  484. row.Cells[6].Value = "已绑定";
  485. row.Tag = BindIDList;
  486. }
  487. else
  488. {
  489. row.Cells[6].Value = "";
  490. }
  491. row.Cells[7].Value = dataTable.Rows[i]["拍照状态"].ToString();
  492. row.Cells[8].Value = dataTable.Rows[i]["初修状态"].ToString();
  493. row.Cells[9].Value = dataTable.Rows[i]["选片状态"].ToString();
  494. row.Cells[10].Value = dataTable.Rows[i]["设计状态"].ToString();
  495. row.Cells[11].Value = dataTable.Rows[i]["看设计状态"].ToString();
  496. row.Cells[12].Value = dataTable.Rows[i]["齐件状态"].ToString();
  497. row.Cells[13].Value = dataTable.Rows[i]["取件状态"].ToString();
  498. try
  499. {
  500. if ( dataTable.Rows[i]["预约日期"].ToString().Length >= 10 )
  501. row.Cells[14].Value = Convert.ToDateTime(dataTable.Rows[i]["预约日期"].ToString()).ToString("yyyy-MM-dd");
  502. }
  503. catch { }
  504. try
  505. {
  506. if ( dataTable.Rows[i]["拍摄时间"].ToString().Length >= 10 )
  507. row.Cells[15].Value = Convert.ToDateTime(dataTable.Rows[i]["拍摄时间"].ToString()).ToString("yyyy-MM-dd");
  508. else if ( dataTable.Rows[i]["Ordpg_PhotographyCount"] == null || dataTable.Rows[i]["Ordpg_PhotographyCount"].ToString() == "0" )
  509. row.Cells[15].Value = "此单不含拍照";
  510. }
  511. catch { }
  512. try
  513. {
  514. if ( dataTable.Rows[i]["初修时间"].ToString().Length >= 10 )
  515. row.Cells[16].Value = Convert.ToDateTime(dataTable.Rows[i]["初修时间"].ToString()).ToString("yyyy-MM-dd");
  516. }
  517. catch { }
  518. try
  519. {
  520. if ( dataTable.Rows[i]["选片时间"].ToString().Length >= 10 )
  521. row.Cells[17].Value = Convert.ToDateTime(dataTable.Rows[i]["选片时间"].ToString()).ToString("yyyy-MM-dd");
  522. }
  523. catch { }
  524. try
  525. {
  526. if ( dataTable.Rows[i]["设计时间"].ToString().Length >= 10 )
  527. row.Cells[18].Value = Convert.ToDateTime(dataTable.Rows[i]["设计时间"].ToString()).ToString("yyyy-MM-dd");
  528. }
  529. catch { }
  530. try
  531. {
  532. if ( dataTable.Rows[i]["看设计时间"].ToString().Length >= 10 )
  533. row.Cells[19].Value = Convert.ToDateTime(dataTable.Rows[i]["看设计时间"].ToString()).ToString("yyyy-MM-dd");
  534. }
  535. catch { }
  536. try
  537. {
  538. if ( dataTable.Rows[i]["取件日期"].ToString().Length >= 10 )
  539. row.Cells[20].Value = Convert.ToDateTime(dataTable.Rows[i]["取件日期"].ToString()).ToString("yyyy-MM-dd");
  540. else if ( dataTable.Rows[i]["productCount"] == null || dataTable.Rows[i]["productCount"].ToString() == "0" )
  541. {
  542. if ( dataTable.Rows[i]["Ord_Type"].ToString() == "1" )
  543. row.Cells[20].Value = "此单不含产品";
  544. }
  545. }
  546. catch { }
  547. try
  548. {
  549. if ( dataTable.Rows[i]["齐件日期"].ToString().Length >= 10 )
  550. row.Cells[21].Value = Convert.ToDateTime(dataTable.Rows[i]["齐件日期"].ToString()).ToString("yyyy-MM-dd");
  551. else if ( dataTable.Rows[i]["productCount"] == null || dataTable.Rows[i]["productCount"].ToString() == "0" )
  552. {
  553. if ( dataTable.Rows[i]["Ord_Type"].ToString() == "1" )
  554. row.Cells[21].Value = "此单不含产品";
  555. }
  556. }
  557. catch { }
  558. row.Cells[22].Value = dataTable.Rows[i]["接单人"].ToString();
  559. row.Cells[23].Value = dataTable.Rows[i]["套系名称"].ToString();
  560. row.Cells[24].Value = dataTable.Rows[i]["套系价格"].ToString();
  561. this.dgvOrderProcessCustomer.Rows.Add(row);
  562. }
  563. #endregion
  564. #else
  565. // 优化列表 ;
  566. this.dgvOrderProcessCustomer.RowCount = dataTable.Rows.Count;
  567. #endif
  568. }
  569. return pageData.TotalCount;
  570. }
  571. bool CheckWxBindOPenID( string[] _BindIDList )
  572. {
  573. bool retbl = false;
  574. if ( _BindIDList != null )
  575. {
  576. foreach ( string openIDStr in _BindIDList )
  577. {
  578. string[] temps = openIDStr.Split(':');
  579. if ( modInterFace.AppID != null && modInterFace.AppID.Trim().Length > 0 )
  580. {
  581. if ( temps[0].Trim().ToLower() == modInterFace.AppID.Trim().ToLower() )
  582. {
  583. retbl = true;
  584. break;
  585. }
  586. }
  587. }
  588. }
  589. return retbl;
  590. }
  591. /// <summary>
  592. /// 邦定门店
  593. /// </summary>
  594. void BindStoreList(bool isGroupEdition)
  595. {
  596. DataRowCollection rows = null;
  597. int allValue = 0;
  598. if (isGroupEdition)
  599. {
  600. this.cbxStoreList.Show();
  601. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  602. {
  603. rows = LYFZ.DAL.DAL_ErpCompanyInfo.GetCompanyBasicInfoList(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.SoftwareInfo.SDomainName.Trim());
  604. });
  605. if (rows == null)
  606. {
  607. MessageBoxCustom.Show("获取门店信息失败!");
  608. return;
  609. }
  610. else
  611. {
  612. if (rows.Count > 1)
  613. {
  614. ItemValue itemAll = new ItemValue(allValue, "全部");
  615. this.cbxStoreList.Items.Add(itemAll);
  616. this.cbxStoreList.SelectedIndex = 0;
  617. }
  618. //是否找到当前店
  619. bool isCurrentStore = false;
  620. foreach (DataRow row in rows)
  621. {
  622. ItemValue itemStore = new ItemValue(row["Company_DividedShop"].ToString(), row["Company_Name"].ToString());
  623. itemStore.Tag = row;
  624. this.cbxStoreList.Items.Add(itemStore);
  625. if (row["Company_JMGDomain"].ToString().Trim().ToLower() == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.SoftwareInfo.SDomainName.Trim().ToLower())
  626. {
  627. isCurrentStore = true;
  628. this.cbxStoreList.SelectedItem = itemStore;
  629. }
  630. }
  631. if (!isCurrentStore)
  632. {
  633. MessageBoxCustom.Show("没有找到当前门店信息");
  634. this.cbxStoreList.Items.Clear();
  635. return;
  636. }
  637. }
  638. }
  639. else
  640. {
  641. ItemValue itemAll = new ItemValue(allValue, "全部");
  642. this.cbxStoreList.Items.Add(itemAll);
  643. this.cbxStoreList.SelectedIndex = 0;
  644. this.cbxStoreList.Hide();
  645. }
  646. }
  647. #endregion
  648. /// <summary>
  649. /// 流程状态
  650. /// </summary>
  651. enum ProcessStatus
  652. {
  653. 已定未拍,
  654. 已拍未选,
  655. 已设计未看,
  656. 已完成未取,
  657. 全部,
  658. }
  659. #region 未拍照
  660. protected void btnNotShoot_Click( object sender, EventArgs e )
  661. {
  662. SetSQueryWhereString(ProcessStatus.已定未拍);
  663. Bind();
  664. }
  665. #endregion
  666. #region 未选片
  667. protected void btnNotSelectionFilms_Click( object sender, EventArgs e )
  668. {
  669. SetSQueryWhereString(ProcessStatus.已拍未选);
  670. Bind();
  671. }
  672. #endregion
  673. #region 未看设计
  674. protected void btnNotDesign_Click( object sender, EventArgs e )
  675. {
  676. SetSQueryWhereString(ProcessStatus.已设计未看);
  677. Bind();
  678. }
  679. #endregion
  680. #region 未取件
  681. protected void btnNotPickup_Click( object sender, EventArgs e )
  682. {
  683. SetSQueryWhereString(ProcessStatus.已完成未取);
  684. Bind();
  685. }
  686. #endregion
  687. #region 发送短信
  688. protected void btnSmsSend_Click( object sender, EventArgs e )
  689. {
  690. string Sj = "";
  691. if ( this.dgvOrderProcessCustomer.SelectedRows != null && this.dgvOrderProcessCustomer.SelectedRows.Count > 0 )
  692. {
  693. LYFZ.Software.MainBusiness.SMSManagement.SmsSend.FrmSendSms sendSms = new SmsSend.FrmSendSms();
  694. for ( int i = 0; i < this.dgvOrderProcessCustomer.SelectedRows.Count; i++ )
  695. {
  696. string tempPhones = this.dgvOrderProcessCustomer.SelectedRows[i].Cells["客户电话"].Value.ToString();
  697. string okPhones = "";
  698. LYFZ.WinAPI.CustomPublicMethod.ValidationPhones(tempPhones.Replace('/', ','), ref okPhones);
  699. okPhones = okPhones.Trim().Trim(',');
  700. foreach ( string phone in okPhones.Split(',') )
  701. {
  702. if ( phone.Trim().Length >= 11 && !Sj.Contains(phone) )
  703. {
  704. Sj += phone + ",";
  705. }
  706. }
  707. }
  708. Sj = Sj.Trim(',');
  709. if ( Sj.Length >= 11 )
  710. {
  711. sendSms.Phone = Sj;
  712. sendSms.ShowDialog();
  713. }
  714. else
  715. {
  716. MessageBoxCustom.Show("没有找到有效的手机号");
  717. }
  718. }
  719. else
  720. {
  721. MessageBoxCustom.Show("请选择要发送消息的订单");
  722. }
  723. }
  724. #endregion
  725. #region 关闭
  726. protected void btnClose_Click( object sender, EventArgs e )
  727. {
  728. this.Close();
  729. }
  730. #endregion
  731. }
  732. }