ProcessMonitorFormMain.cs 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976
  1. using LYFZ.ComponentLibrary;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Windows.Forms;
  11. namespace LYFZ.Software.MainBusiness.CameraControlBook
  12. {
  13. public partial class ProcessMonitorFormMain : LYFZ.Software.UI.CameraControlBook.ProcessMonitorFormMain
  14. {
  15. public ProcessMonitorFormMain()
  16. {
  17. this.UcPagerEx1.EventPaging += UcPagerEx1_EventPaging;
  18. this.flowLayoutPanel1.Height = 34;
  19. }
  20. /// <summary>
  21. /// 是否显示写真版
  22. /// </summary>
  23. bool IsPortrait = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsEnablePhotoEdition;
  24. /// <summary>
  25. /// 是否选择显示按钮上的版本
  26. /// </summary>
  27. bool IsChk = false;
  28. bool IsFirstRun = true;
  29. LYFZ.BLL.BLL_ErpOrder orbll = new LYFZ.BLL.BLL_ErpOrder();
  30. LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
  31. LYFZ.BLL.BLL_ErpOrderProcessMonitor ordpmbll = new BLL.BLL_ErpOrderProcessMonitor();
  32. /// <summary>
  33. /// 窗体加载事件
  34. /// </summary>
  35. /// <param name="sender"></param>
  36. /// <param name="e"></param>
  37. protected override void ProcessMonitorFormMain_Shown(object sender, EventArgs e)
  38. {
  39. #region
  40. this.chkKidsVersion.Visible = false;
  41. this.chkDressVersion.Visible = false;
  42. this.chkPortraitVersion.Visible = false;
  43. switch (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  44. {
  45. case LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.旗舰版:
  46. this.chkKidsVersion.Visible = true;
  47. this.chkDressVersion.Visible = true;
  48. if (IsPortrait)
  49. { this.chkPortraitVersion.Visible = true; }
  50. break;
  51. case LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.婚纱版:
  52. if (IsPortrait)
  53. { this.chkPortraitVersion.Visible = true; this.chkDressVersion.Visible = true; }
  54. break;
  55. case LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.儿童版:
  56. if (IsPortrait)
  57. { this.chkPortraitVersion.Visible = true; this.chkKidsVersion.Visible = true; }
  58. break;
  59. }
  60. #endregion
  61. #region 权限
  62. //if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.ProcessMonitoring, LYFZ.CustomAttributes.OperatingAuthority.Setting))
  63. //{ this.btnWarningSet.Enabled = false; }
  64. #endregion
  65. this.panelEx5.BackColor = Color.LightSteelBlue;
  66. this.panelEx6.BackColor = Color.Green;
  67. this.panelEx7.BackColor = Color.Red;
  68. this.panelEx8.BackColor = Color.Orange;
  69. PublicFunctionRows();
  70. this.IsFirstRun = false;
  71. this.ProcessMonitorFormMain_Resize(this, null);
  72. }
  73. /// <summary>
  74. /// 回车
  75. /// </summary>
  76. /// <param name="sender"></param>
  77. /// <param name="e"></param>
  78. protected override void cmbQueryText_KeyDown(object sender, KeyEventArgs e)
  79. {
  80. if (e.KeyCode == Keys.Enter)
  81. { this.btnQuery_Click(this, null); }
  82. }
  83. /// <summary>
  84. /// 窗体加载事件
  85. /// </summary>
  86. /// <param name="sender"></param>
  87. /// <param name="e"></param>
  88. protected override void ProcessMonitorFormMain_Load(object sender, EventArgs e)
  89. {
  90. if (this.dgvData.Columns.Count <= 0)
  91. {
  92. string[] strColumn = ("订单号,订单类型,客户姓名,客户电话,客户性别,接单人,订单日期,开拍日期,拍照日期,选片日期,拍照,选片,看样,件齐,取走").Split(',');
  93. for (int i = 0; i < strColumn.Length; i++)
  94. {
  95. DataGridViewColumn column = null;
  96. column = new DataGridViewColumn();
  97. column.ReadOnly = true;
  98. column.Name = strColumn[i].ToString().Trim();
  99. column.HeaderText = strColumn[i].ToString().Trim();
  100. this.dgvData.Columns.Add(column);
  101. }
  102. //this.dgvData.DataColumns(strColumn, LYFZ.Software.MainBusiness.CommonLogical.CacheData.StrOrderReportHideField);
  103. }
  104. }
  105. /// <summary>
  106. /// 创建行
  107. /// </summary>
  108. private void PublicFunctionRows()
  109. {
  110. this.UcPagerEx1.PageCurrent = 1;
  111. this.UcPagerEx1.PageSize = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPageSize();//3;分页条数
  112. this.UcPagerEx1.Bind();
  113. }
  114. /// <summary>
  115. /// 分页前数据,便于展开时用来查询订单的子数据
  116. /// </summary>
  117. DataTable tbl = new DataTable();
  118. /// <summary>
  119. /// 画分页
  120. /// </summary>
  121. /// <param name="e"></param>
  122. /// <returns></returns>
  123. private int UcPagerEx1_EventPaging(UCPager.EventPagingArg e)
  124. {
  125. LYFZ.UCPager.PageData pageData = new LYFZ.UCPager.PageData();
  126. pageData.TableName = "AView_WarningSet";
  127. pageData.PageIndex = this.UcPagerEx1.PageCurrent;
  128. pageData.PageSize = this.UcPagerEx1.PageSize;
  129. pageData.QueryCondition = GetWhereStr();
  130. pageData.QueryFieldName = "Ord_Type,Ord_CustomerListID,Ord_Number,Ord_ViceNumber,订单号,订单类型,姓名1,姓名2,电话1,电话2,接单人,订单日期,开拍日期,拍照日期,选片日期,拍照,选片,看样,件齐,取走";
  131. pageData.OrderStr = "ID";
  132. pageData.OrderType = 1;
  133. string strType = GetVersion();//获取版本
  134. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
  135. {
  136. tbl = pageData.QueryDataTable().Tables[0];
  137. string StrM = "";
  138. string StrV = "";
  139. for (int i = 0; i < tbl.Rows.Count; i++)
  140. {
  141. if (i == 0)
  142. { StrM += "'" + tbl.Rows[i]["Ord_Number"].ToString().Trim() + "'"; StrV += "'" + tbl.Rows[i]["Ord_ViceNumber"].ToString().Trim() + "'"; }
  143. else
  144. { StrM += ",'" + tbl.Rows[i]["Ord_Number"].ToString().Trim() + "'"; StrV += ",'" + tbl.Rows[i]["Ord_ViceNumber"].ToString().Trim() + "'"; }
  145. }
  146. string ExecuteSql = "select Cus_CustomerNumber, Cus_Name, Cus_Sex, Cus_Telephone FROM dbo.tb_ErpCustomer;";
  147. ExecuteSql += "select OPlist_ViceNumber, OPlist_CompletedStatus, OPlist_PickupStatus from dbo.tb_ErpOrderProductList where OPlist_Type='2' and OPlist_PickupTime != '' and OPlist_ViceNumber in (" + StrV + ") ;";
  148. ExecuteSql += "select OPlist_ViceNumber,OPlist_PickupStatus,OPlist_CompletedStatus from dbo.tb_ErpOrderProductList where OPlist_Type = '2' and OPlist_ViceNumber in (" + StrV + ") ;";
  149. ExecuteSql += "select Ordpg_ViceNumber,Ordpg_Sights,Ordpg_PhotographyStatus,dbo.fn_CheckUserIDGetUserName(Ordpg_Photographer) AS Ordpg_Photographer,Ordpg_PhotographyTime,dbo.fn_CheckUserIDGetUserName(Ordpg_MakeupArtist) AS Ordpg_MakeupArtist FROM tb_ErpOrdersPhotography where Ordpg_ViceNumber in (" + StrV + ");";
  150. ExecuteSql += "select Ordpm_Number,Ordpm_ViceNumber,Ordpm_ProcessType,Ordpm_ProcessDays,Ordpm_ProcessDate,Ordpm_ProcessRemark,Ordpm_UpdateDateTime,Ordpm_UpdateName from tb_ErpOrderProcessMonitor where Ordpm_Number in (" + StrM + ");";
  151. DataSet dsData = orbll.GetView_Custom(ExecuteSql);
  152. DataTable tbl_Client = dsData.Tables["ds"];
  153. tbl_Client.PrimaryKey = new DataColumn[] { tbl_Client.Columns["Cus_CustomerNumber"] };
  154. DataTable tbl_PickupTime = dsData.Tables["ds1"];
  155. DataTable tbl_PickupStatus = dsData.Tables["ds2"];
  156. DataTable tbl_Sights = dsData.Tables["ds3"];
  157. DataTable tblP = dsData.Tables["ds4"];
  158. try
  159. {
  160. this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
  161. {
  162. #region 列标题
  163. this.dgvData.Columns.Clear();
  164. this.dgvData.Rows.Clear();
  165. this.dgvData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
  166. this.dgvData.ColumnHeadersHeight = 24;
  167. DataGridViewColumn dgvcl = new DataGridViewColumn();
  168. dgvcl.HeaderText = "strNumber";
  169. dgvcl.Name = "strNumber";
  170. dgvcl.ReadOnly = true;
  171. dgvcl.Width = 120;
  172. dgvcl.Visible = false;
  173. this.dgvData.Columns.Add(dgvcl);
  174. dgvcl = new DataGridViewColumn();
  175. dgvcl.HeaderText = "strViceNumber";
  176. dgvcl.Name = "strViceNumber";
  177. dgvcl.ReadOnly = true;
  178. dgvcl.Width = 120;
  179. dgvcl.Visible = false;
  180. this.dgvData.Columns.Add(dgvcl);
  181. dgvcl = new DataGridViewColumn();
  182. dgvcl.HeaderText = "订单号";
  183. dgvcl.Name = "strNumber";
  184. dgvcl.ReadOnly = true;
  185. dgvcl.Width = 120;
  186. this.dgvData.Columns.Add(dgvcl);
  187. dgvcl = new DataGridViewColumn();
  188. dgvcl.HeaderText = "订单类型";
  189. dgvcl.Name = "strType";
  190. dgvcl.ReadOnly = true;
  191. dgvcl.Width = 120;
  192. this.dgvData.Columns.Add(dgvcl);
  193. dgvcl = new DataGridViewColumn();
  194. switch (strType)
  195. {
  196. case "": dgvcl.HeaderText = "男/家姓名"; break;
  197. case "1": dgvcl.HeaderText = "家长姓名"; break;
  198. case "0": dgvcl.HeaderText = "男宾姓名"; break;
  199. case "2": dgvcl.HeaderText = "客户姓名"; break;
  200. }
  201. dgvcl.Name = "strName1";
  202. dgvcl.ReadOnly = true;
  203. dgvcl.Width = 80;
  204. this.dgvData.Columns.Add(dgvcl);
  205. if (strType == "" || strType == "0" || strType == "1")
  206. {
  207. dgvcl = new DataGridViewColumn();
  208. switch (strType)
  209. {
  210. case "": dgvcl.HeaderText = "女/宝姓名"; break;
  211. case "0": dgvcl.HeaderText = "女宾姓名"; break;
  212. case "1": dgvcl.HeaderText = "宝贝姓名"; break;
  213. }
  214. dgvcl.Name = "strName2";
  215. dgvcl.ReadOnly = true;
  216. dgvcl.Width = 80;
  217. this.dgvData.Columns.Add(dgvcl);
  218. }
  219. dgvcl = new DataGridViewColumn();
  220. dgvcl.HeaderText = "接单人";
  221. dgvcl.Name = "strStore";
  222. dgvcl.ReadOnly = true;
  223. dgvcl.Width = 120;
  224. this.dgvData.Columns.Add(dgvcl);
  225. dgvcl = new DataGridViewColumn();
  226. dgvcl.HeaderText = "订单日期";
  227. dgvcl.Name = "strOrdDate";
  228. dgvcl.ReadOnly = true;
  229. dgvcl.Width = 70;
  230. this.dgvData.Columns.Add(dgvcl);
  231. dgvcl = new DataGridViewColumn();
  232. dgvcl.HeaderText = "拍照日期";
  233. dgvcl.Name = "strPhotographDate";
  234. dgvcl.ReadOnly = true;
  235. dgvcl.Width = 70;
  236. this.dgvData.Columns.Add(dgvcl);
  237. dgvcl = new DataGridViewColumn();
  238. dgvcl.HeaderText = "选片日期";
  239. dgvcl.Name = "strSelectionFilmDate";
  240. dgvcl.ReadOnly = true;
  241. dgvcl.Width = 70;
  242. this.dgvData.Columns.Add(dgvcl);
  243. dgvcl = new DataGridViewColumn();
  244. dgvcl.HeaderText = "拍照";
  245. dgvcl.Name = "strPhotograph";
  246. dgvcl.ReadOnly = true;
  247. dgvcl.Width = 65;
  248. this.dgvData.Columns.Add(dgvcl);
  249. dgvcl = new DataGridViewColumn();
  250. dgvcl.HeaderText = "拍完";
  251. dgvcl.Name = "strPhotographOK";
  252. dgvcl.ReadOnly = true;
  253. dgvcl.Width = 65;
  254. this.dgvData.Columns.Add(dgvcl);
  255. dgvcl = new DataGridViewColumn();
  256. dgvcl.HeaderText = "选片";
  257. dgvcl.Name = "strSelectionFilm";
  258. dgvcl.ReadOnly = true;
  259. dgvcl.Width = 65;
  260. this.dgvData.Columns.Add(dgvcl);
  261. dgvcl = new DataGridViewColumn();
  262. dgvcl.HeaderText = "看样";
  263. dgvcl.Name = "strLookSample";
  264. dgvcl.ReadOnly = true;
  265. dgvcl.Width = 65;
  266. this.dgvData.Columns.Add(dgvcl);
  267. dgvcl = new DataGridViewColumn();
  268. dgvcl.HeaderText = "件齐";
  269. dgvcl.Name = "strPieceQi";
  270. dgvcl.ReadOnly = true;
  271. dgvcl.Width = 65;
  272. this.dgvData.Columns.Add(dgvcl);
  273. dgvcl = new DataGridViewColumn();
  274. dgvcl.HeaderText = "取走";
  275. dgvcl.Name = "strTakeAway";
  276. dgvcl.ReadOnly = true;
  277. dgvcl.Width = 65;
  278. this.dgvData.Columns.Add(dgvcl);
  279. dgvcl = new DataGridViewColumn();
  280. switch (strType)
  281. {
  282. case "": dgvcl.HeaderText = "男/家电话"; break;
  283. case "0": dgvcl.HeaderText = "男宾电话"; break;
  284. case "1": dgvcl.HeaderText = "家长电话"; break;
  285. case "2": dgvcl.HeaderText = "客户电话"; break;
  286. }
  287. dgvcl.Name = "strPhone1";
  288. dgvcl.ReadOnly = true;
  289. dgvcl.Width = 80;
  290. this.dgvData.Columns.Add(dgvcl);
  291. if (strType == "" || strType == "0")
  292. {
  293. dgvcl = new DataGridViewColumn();
  294. dgvcl.HeaderText = "女宾电话";
  295. dgvcl.Name = "strPhone2";
  296. dgvcl.ReadOnly = true;
  297. dgvcl.Width = 80;
  298. this.dgvData.Columns.Add(dgvcl);
  299. }
  300. #endregion
  301. #region 获取预警设置数据
  302. string txtA = "";
  303. string txtB = "";
  304. string txtC = "";
  305. string txtD = "";
  306. string txtE = "";
  307. string txtF = "";
  308. DataTable tbl_Scon = sgbll.GetSystemConfigureCustom("Sconfig_Code,Sconfig_Value", "Sconfig_Remark = 'Alert'").Tables[0];
  309. for (int i = 0; i < tbl_Scon.Rows.Count; i++)
  310. {
  311. if (tbl_Scon.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_OrderLater_NotShot")
  312. { txtA = tbl_Scon.Rows[i]["Sconfig_Value"].ToString().Trim(); }
  313. else if (tbl_Scon.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_photographedLater_NotEnd")
  314. { txtB = tbl_Scon.Rows[i]["Sconfig_Value"].ToString().Trim(); }
  315. else if (tbl_Scon.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_photograpOKLater_NotSelect")
  316. { txtC = tbl_Scon.Rows[i]["Sconfig_Value"].ToString().Trim(); }
  317. else if (tbl_Scon.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_SelectOKLater_NotLook")
  318. { txtD = tbl_Scon.Rows[i]["Sconfig_Value"].ToString().Trim(); }
  319. else if (tbl_Scon.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_SelectOKLater_NotQi")
  320. { txtE = tbl_Scon.Rows[i]["Sconfig_Value"].ToString().Trim(); }
  321. else if (tbl_Scon.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_SelectOKLater_NotTake")
  322. { txtF = tbl_Scon.Rows[i]["Sconfig_Value"].ToString().Trim(); }
  323. }
  324. #endregion
  325. #region 行
  326. for (int i = 0; i < tbl.Rows.Count; i++)
  327. {
  328. string[] ArrayClient = tbl.Rows[i]["Ord_CustomerListID"].ToString().Trim().Split(',');
  329. Hashtable htData_Client = LYFZ.Software.MainBusiness.DoorCityProcess.PublicGetTableName.GetClientData(tbl_Client, ArrayClient, tbl.Rows[i]["Ord_Type"].ToString().Trim());
  330. Hashtable htData_Sights = LYFZ.Software.MainBusiness.DoorCityProcess.PublicGetTableName.GetSightsData(tbl_Sights, tbl.Rows[i]["Ord_ViceNumber"].ToString().Trim(), tbl.Rows[i]["Ord_Type"].ToString().Trim());
  331. string strPhotographyTimeStart = htData_Sights["Ordpg_PhotographyTimeStart"].ToString();
  332. string strPhotographyTimeEnd = htData_Sights["Ordpg_PhotographyTimeEnd"].ToString();
  333. DataGridViewRow dgvl = new DataGridViewRow();
  334. dgvl.Height = 25;
  335. DataGridViewCell cell = null;
  336. cell = new DataGridViewTextBoxCell();
  337. cell.Value = tbl.Rows[i]["Ord_Number"].ToString().Trim();
  338. dgvl.Cells.Add(cell);
  339. cell = new DataGridViewTextBoxCell();
  340. cell.Value = tbl.Rows[i]["Ord_ViceNumber"].ToString().Trim();
  341. dgvl.Cells.Add(cell);
  342. cell = new DataGridViewTextBoxCell();
  343. cell.Value = tbl.Rows[i]["订单号"].ToString().Trim();
  344. dgvl.Cells.Add(cell);
  345. cell = new DataGridViewTextBoxCell();
  346. cell.Value = tbl.Rows[i]["订单类型"].ToString().Trim();
  347. dgvl.Cells.Add(cell);
  348. cell = new DataGridViewTextBoxCell();
  349. cell.Value = htData_Client["strManName"];// tbl.Rows[i]["姓名1"].ToString().Trim();
  350. dgvl.Cells.Add(cell);
  351. if (strType == "" || strType == "0" || strType == "1")
  352. {
  353. cell = new DataGridViewTextBoxCell();
  354. cell.Value = htData_Client["strWoManName"];//tbl.Rows[i]["姓名2"].ToString().Trim();
  355. dgvl.Cells.Add(cell);
  356. }
  357. cell = new DataGridViewTextBoxCell();
  358. cell.Value = tbl.Rows[i]["接单人"].ToString().Trim();
  359. dgvl.Cells.Add(cell);
  360. cell = new DataGridViewTextBoxCell();
  361. cell.Value = tbl.Rows[i]["订单日期"].ToString().Trim();
  362. dgvl.Cells.Add(cell);
  363. cell = new DataGridViewTextBoxCell();
  364. cell.Value = strPhotographyTimeEnd;
  365. dgvl.Cells.Add(cell);
  366. cell = new DataGridViewTextBoxCell();
  367. cell.Value = tbl.Rows[i]["选片日期"].ToString().Trim();
  368. dgvl.Cells.Add(cell);
  369. #region 拍照
  370. cell = new DataGridViewTextBoxCell();
  371. cell.Style.BackColor = Color.LightSteelBlue;
  372. string strPz = htData_Sights["Ordpg_PhotographyStatus"].ToString();
  373. cell.Value = strPz;
  374. DataRow[] dtRow1 = tblP.Select("Ordpm_Number = '" + tbl.Rows[i]["Ord_Number"].ToString().Trim() + "' and Ordpm_ViceNumber = '" + tbl.Rows[i]["Ord_ViceNumber"].ToString().Trim() + "' and Ordpm_ProcessType = '拍照'");
  375. if (dtRow1.Length > 0)
  376. {
  377. string StrToolTip = "当前为(拍照)延期\r\n延 期:3天\r\n延期至:" + Convert.ToDateTime(dtRow1[0]["Ordpm_ProcessDate"]).ToString("yyyy-MM-dd") + "\r\n原 因:" + dtRow1[0]["Ordpm_ProcessRemark"].ToString().Trim().Replace("\r\n", " ");
  378. cell.ToolTipText = StrToolTip;
  379. }
  380. else { cell.ToolTipText = "无"; }
  381. if (strPz == "未拍" || strPz == "拍摄中")
  382. {
  383. if (dtRow1.Length > 0)
  384. {
  385. if (SDateTime.Now <= Convert.ToDateTime(dtRow1[0]["Ordpm_ProcessDate"]))
  386. { cell.Style.BackColor = Color.Orange; }
  387. else { cell.Style.BackColor = Color.Red; }
  388. }
  389. else
  390. {
  391. if ((SDateTime.Now - Convert.ToDateTime(tbl.Rows[i]["订单日期"])).Days >= Convert.ToInt32(txtA))
  392. { cell.Style.BackColor = Color.Red; }
  393. }
  394. }
  395. else { cell.Style.BackColor = Color.Green; }
  396. dgvl.Cells.Add(cell);
  397. #endregion
  398. #region 拍完
  399. cell = new DataGridViewTextBoxCell();
  400. cell.Style.BackColor = Color.LightSteelBlue;
  401. string StrNotPw = "未拍完";
  402. if (strPz == "OK")
  403. { StrNotPw = "OK"; }
  404. cell.Value = StrNotPw;//拍完
  405. DataRow[] dtRow2 = tblP.Select("Ordpm_Number = '" + tbl.Rows[i]["Ord_Number"].ToString().Trim() + "' and Ordpm_ViceNumber = '" + tbl.Rows[i]["Ord_ViceNumber"].ToString().Trim() + "' and Ordpm_ProcessType = '拍完'");
  406. if (dtRow2.Length > 0)
  407. {
  408. string StrToolTip = "当前为(拍完)延期\r\n延 期:3天\r\n延期至:" + Convert.ToDateTime(dtRow2[0]["Ordpm_ProcessDate"]).ToString("yyyy-MM-dd") + "\r\n原 因:" + dtRow2[0]["Ordpm_ProcessRemark"].ToString().Trim().Replace("\r\n", " ");
  409. cell.ToolTipText = StrToolTip;
  410. }
  411. else { cell.ToolTipText = "无"; }
  412. if (StrNotPw != "OK")
  413. {
  414. if (dtRow2.Length > 0)
  415. {
  416. if (SDateTime.Now <= Convert.ToDateTime(dtRow2[0]["Ordpm_ProcessDate"]))
  417. { cell.Style.BackColor = Color.Orange; }
  418. else { cell.Style.BackColor = Color.Red; }
  419. }
  420. else
  421. {
  422. //如果未开拍,则用订单日期,如果已开拍则用开始拍照日期
  423. if (!String.IsNullOrEmpty(strPhotographyTimeStart))
  424. {
  425. if ((SDateTime.Now - Convert.ToDateTime(strPhotographyTimeStart)).Days >= Convert.ToInt32(txtB))
  426. { cell.Style.BackColor = Color.Red; }
  427. }
  428. else
  429. {
  430. if ((SDateTime.Now - Convert.ToDateTime(tbl.Rows[i]["订单日期"])).Days >= (Convert.ToInt32(txtA) + Convert.ToInt32(txtB)))
  431. { cell.Style.BackColor = Color.Red; }
  432. }
  433. }
  434. }
  435. else { cell.Style.BackColor = Color.Green; }
  436. dgvl.Cells.Add(cell);
  437. #endregion
  438. #region 选片
  439. cell = new DataGridViewTextBoxCell();
  440. cell.Style.BackColor = Color.LightSteelBlue;
  441. cell.Value = tbl.Rows[i]["选片"].ToString().Trim();
  442. DataRow[] dtRow3 = tblP.Select("Ordpm_Number = '" + tbl.Rows[i]["Ord_Number"].ToString().Trim() + "' and Ordpm_ViceNumber = '" + tbl.Rows[i]["Ord_ViceNumber"].ToString().Trim() + "' and Ordpm_ProcessType = '选片'");
  443. if (dtRow3.Length > 0)
  444. {
  445. string StrToolTip = "当前为(选片)延期\r\n延 期:3天\r\n延期至:" + Convert.ToDateTime(dtRow3[0]["Ordpm_ProcessDate"]).ToString("yyyy-MM-dd") + "\r\n原 因:" + dtRow3[0]["Ordpm_ProcessRemark"].ToString().Trim().Replace("\r\n", " ");
  446. cell.ToolTipText = StrToolTip;
  447. }
  448. else { cell.ToolTipText = "无"; }
  449. if (tbl.Rows[i]["选片"].ToString().Trim() == "未选")
  450. {
  451. if (dtRow3.Length > 0)
  452. {
  453. if (SDateTime.Now <= Convert.ToDateTime(dtRow3[0]["Ordpm_ProcessDate"]))
  454. { cell.Style.BackColor = Color.Orange; }
  455. else { cell.Style.BackColor = Color.Red; }
  456. }
  457. else
  458. {
  459. if (!String.IsNullOrEmpty(strPhotographyTimeEnd))
  460. {
  461. if ((SDateTime.Now - Convert.ToDateTime(strPhotographyTimeEnd)).Days >= Convert.ToInt32(txtC))
  462. { cell.Style.BackColor = Color.Red; }
  463. }
  464. else
  465. {
  466. if ((SDateTime.Now - Convert.ToDateTime(tbl.Rows[i]["订单日期"])).Days >= (Convert.ToInt32(txtA) + Convert.ToInt32(txtB) + Convert.ToInt32(txtC)))
  467. { cell.Style.BackColor = Color.Red; }
  468. }
  469. }
  470. }
  471. else { cell.Style.BackColor = Color.Green; }
  472. dgvl.Cells.Add(cell);
  473. #endregion
  474. #region 看样
  475. cell = new DataGridViewTextBoxCell();
  476. cell.Style.BackColor = Color.LightSteelBlue;
  477. cell.Value = tbl.Rows[i]["看样"].ToString().Trim();
  478. DataRow[] dtRow4 = tblP.Select("Ordpm_Number = '" + tbl.Rows[i]["Ord_Number"].ToString().Trim() + "' and Ordpm_ViceNumber = '" + tbl.Rows[i]["Ord_ViceNumber"].ToString().Trim() + "' and Ordpm_ProcessType = '看样'");
  479. if (dtRow4.Length > 0)
  480. {
  481. string StrToolTip = "当前为(看样)延期\r\n延 期:3天\r\n延期至:" + Convert.ToDateTime(dtRow4[0]["Ordpm_ProcessDate"]).ToString("yyyy-MM-dd") + "\r\n原 因:" + dtRow4[0]["Ordpm_ProcessRemark"].ToString().Trim().Replace("\r\n", " ");
  482. cell.ToolTipText = StrToolTip;
  483. }
  484. else { cell.ToolTipText = "无"; }
  485. if (tbl.Rows[i]["看样"].ToString().Trim() == "未看")
  486. {
  487. if (dtRow4.Length > 0)
  488. {
  489. if (SDateTime.Now <= Convert.ToDateTime(dtRow4[0]["Ordpm_ProcessDate"]))
  490. { cell.Style.BackColor = Color.Orange; }
  491. else { cell.Style.BackColor = Color.Red; }
  492. }
  493. else
  494. {
  495. if (!String.IsNullOrEmpty(tbl.Rows[i]["选片日期"].ToString()))
  496. {
  497. if ((SDateTime.Now - Convert.ToDateTime(tbl.Rows[i]["选片日期"])).Days >= Convert.ToInt32(txtD))
  498. { cell.Style.BackColor = Color.Red; }
  499. }
  500. else
  501. {
  502. if (!String.IsNullOrEmpty(strPhotographyTimeEnd))
  503. {
  504. if ((SDateTime.Now - Convert.ToDateTime(strPhotographyTimeEnd)).Days >= (Convert.ToInt32(txtC) + Convert.ToInt32(txtD)))
  505. { cell.Style.BackColor = Color.Red; }
  506. }
  507. else
  508. {
  509. if (!String.IsNullOrEmpty(strPhotographyTimeStart))
  510. {
  511. if ((SDateTime.Now - Convert.ToDateTime(strPhotographyTimeStart)).Days >= (Convert.ToInt32(txtB) + Convert.ToInt32(txtC) + Convert.ToInt32(txtD)))
  512. { cell.Style.BackColor = Color.Red; }
  513. }
  514. else
  515. {
  516. if (!String.IsNullOrEmpty(tbl.Rows[i]["订单日期"].ToString()))
  517. {
  518. if ((SDateTime.Now - Convert.ToDateTime(tbl.Rows[i]["订单日期"])).Days >= (Convert.ToInt32(txtB) + Convert.ToInt32(txtC) + Convert.ToInt32(txtD)))
  519. { cell.Style.BackColor = Color.Red; }
  520. }
  521. }
  522. }
  523. }
  524. }
  525. }
  526. else { cell.Style.BackColor = Color.Green; }
  527. dgvl.Cells.Add(cell);
  528. #endregion
  529. #region 件齐
  530. cell = new DataGridViewTextBoxCell();
  531. cell.Style.BackColor = Color.LightSteelBlue;
  532. cell.Value = tbl.Rows[i]["件齐"].ToString().Trim();
  533. DataRow[] dtRow5 = tblP.Select("Ordpm_Number = '" + tbl.Rows[i]["Ord_Number"].ToString().Trim() + "' and Ordpm_ViceNumber = '" + tbl.Rows[i]["Ord_ViceNumber"].ToString().Trim() + "' and Ordpm_ProcessType = '件齐'");
  534. if (dtRow5.Length > 0)
  535. {
  536. string StrToolTip = "当前为(件齐)延期\r\n延 期:3天\r\n延期至:" + Convert.ToDateTime(dtRow5[0]["Ordpm_ProcessDate"]).ToString("yyyy-MM-dd") + "\r\n原 因:" + dtRow5[0]["Ordpm_ProcessRemark"].ToString().Trim().Replace("\r\n", " ");
  537. cell.ToolTipText = StrToolTip;
  538. }
  539. else { cell.ToolTipText = "无"; }
  540. if (tbl.Rows[i]["件齐"].ToString().Trim() == "未齐")
  541. {
  542. if (dtRow5.Length > 0)
  543. {
  544. if (SDateTime.Now <= Convert.ToDateTime(dtRow5[0]["Ordpm_ProcessDate"]))
  545. { cell.Style.BackColor = Color.Orange; }
  546. else { cell.Style.BackColor = Color.Red; }
  547. }
  548. else
  549. {
  550. if (!String.IsNullOrEmpty(tbl.Rows[i]["选片日期"].ToString()))
  551. {
  552. if ((SDateTime.Now - Convert.ToDateTime(tbl.Rows[i]["选片日期"])).Days >= Convert.ToInt32(txtD))
  553. { cell.Style.BackColor = Color.Red; }
  554. }
  555. else
  556. {
  557. if (!String.IsNullOrEmpty(strPhotographyTimeEnd))
  558. {
  559. if ((SDateTime.Now - Convert.ToDateTime(strPhotographyTimeEnd)).Days >= (Convert.ToInt32(txtC) + Convert.ToInt32(txtD)))
  560. { cell.Style.BackColor = Color.Red; }
  561. }
  562. else
  563. {
  564. if (!String.IsNullOrEmpty(strPhotographyTimeStart))
  565. {
  566. if ((SDateTime.Now - Convert.ToDateTime(strPhotographyTimeStart)).Days >= (Convert.ToInt32(txtB) + Convert.ToInt32(txtC) + Convert.ToInt32(txtD)))
  567. { cell.Style.BackColor = Color.Red; }
  568. }
  569. else
  570. {
  571. if (!String.IsNullOrEmpty(tbl.Rows[i]["订单日期"].ToString()))
  572. {
  573. if ((SDateTime.Now - Convert.ToDateTime(tbl.Rows[i]["订单日期"])).Days >= (Convert.ToInt32(txtB) + Convert.ToInt32(txtC) + Convert.ToInt32(txtD)))
  574. { cell.Style.BackColor = Color.Red; }
  575. }
  576. }
  577. }
  578. }
  579. }
  580. }
  581. else { cell.Style.BackColor = Color.Green; }
  582. dgvl.Cells.Add(cell);
  583. #endregion
  584. #region 取走
  585. cell = new DataGridViewTextBoxCell();
  586. cell.Style.BackColor = Color.LightSteelBlue;
  587. cell.Value = tbl.Rows[i]["取走"].ToString().Trim();
  588. DataRow[] dtRow = tblP.Select("Ordpm_Number = '" + tbl.Rows[i]["Ord_Number"].ToString().Trim() + "' and Ordpm_ViceNumber = '" + tbl.Rows[i]["Ord_ViceNumber"].ToString().Trim() + "' and Ordpm_ProcessType = '取走'");
  589. if (dtRow.Length > 0)
  590. {
  591. string StrToolTip = "当前为(取走)延期\r\n延 期:3天\r\n延期至:" + Convert.ToDateTime(dtRow[0]["Ordpm_ProcessDate"]).ToString("yyyy-MM-dd") + "\r\n原 因:" + dtRow[0]["Ordpm_ProcessRemark"].ToString().Trim().Replace("\r\n", " ");
  592. cell.ToolTipText = StrToolTip;
  593. }
  594. else { cell.ToolTipText = "无"; }
  595. if (tbl.Rows[i]["取走"].ToString().Trim() == "未取")
  596. {
  597. if (dtRow.Length > 0)
  598. {
  599. if (SDateTime.Now <= Convert.ToDateTime(dtRow[0]["Ordpm_ProcessDate"]))
  600. { cell.Style.BackColor = Color.Orange; }
  601. else { cell.Style.BackColor = Color.Red; }
  602. }
  603. else
  604. {
  605. if (!String.IsNullOrEmpty(tbl.Rows[i]["选片日期"].ToString()))
  606. {
  607. if ((SDateTime.Now - Convert.ToDateTime(tbl.Rows[i]["选片日期"])).Days >= Convert.ToInt32(txtD))
  608. { cell.Style.BackColor = Color.Red; }
  609. }
  610. else
  611. {
  612. if (!String.IsNullOrEmpty(strPhotographyTimeEnd))
  613. {
  614. if ((SDateTime.Now - Convert.ToDateTime(strPhotographyTimeEnd)).Days >= (Convert.ToInt32(txtC) + Convert.ToInt32(txtD)))
  615. { cell.Style.BackColor = Color.Red; }
  616. }
  617. else
  618. {
  619. if (!String.IsNullOrEmpty(strPhotographyTimeStart))
  620. {
  621. if ((SDateTime.Now - Convert.ToDateTime(strPhotographyTimeStart)).Days >= (Convert.ToInt32(txtB) + Convert.ToInt32(txtC) + Convert.ToInt32(txtD)))
  622. { cell.Style.BackColor = Color.Red; }
  623. }
  624. else
  625. {
  626. if (!String.IsNullOrEmpty(tbl.Rows[i]["订单日期"].ToString()))
  627. {
  628. if ((SDateTime.Now - Convert.ToDateTime(tbl.Rows[i]["订单日期"])).Days >= (Convert.ToInt32(txtB) + Convert.ToInt32(txtC) + Convert.ToInt32(txtD)))
  629. { cell.Style.BackColor = Color.Red; }
  630. }
  631. }
  632. }
  633. }
  634. }
  635. }
  636. else { cell.Style.BackColor = Color.Green; }
  637. dgvl.Cells.Add(cell);
  638. #endregion
  639. cell = new DataGridViewTextBoxCell();
  640. cell.Value = tbl.Rows[i]["电话1"].ToString().Trim();
  641. dgvl.Cells.Add(cell);
  642. if (strType == "" || strType == "0")
  643. {
  644. cell = new DataGridViewTextBoxCell();
  645. cell.Value = tbl.Rows[i]["电话2"].ToString().Trim();//14
  646. dgvl.Cells.Add(cell);
  647. }
  648. this.dgvData.Rows.Add(dgvl);
  649. }
  650. #endregion
  651. }));
  652. }
  653. catch
  654. { }
  655. });
  656. try
  657. {
  658. this.UcPagerEx1.TbDataSource = tbl;
  659. this.dgvData.Columns["订单号"].Frozen = true;
  660. }
  661. catch { }
  662. this.dgvData.ClearSelection();
  663. return pageData.TotalCount;
  664. }
  665. /// <summary>
  666. /// 获取版本
  667. /// </summary>
  668. /// <returns></returns>
  669. public string GetVersion()
  670. {
  671. string RetValue = "";
  672. if ((this.chkPortraitVersion.Checked && !this.chkKidsVersion.Checked && !this.chkDressVersion.Checked) || LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.写真版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  673. { RetValue = "2"; }
  674. else if ((this.chkDressVersion.Checked && !this.chkKidsVersion.Checked && !this.chkPortraitVersion.Checked) || LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.婚纱版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  675. { RetValue = "0"; }
  676. else if ((this.chkKidsVersion.Checked && !this.chkDressVersion.Checked && !this.chkPortraitVersion.Checked) || LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.儿童版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  677. { RetValue = "1"; }
  678. else if ((!this.chkKidsVersion.Checked && !this.chkDressVersion.Checked && !this.chkPortraitVersion.Checked) || LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.旗舰版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  679. { RetValue = ""; }
  680. return RetValue;
  681. }
  682. /// <summary>
  683. /// 返回要操作的条件
  684. /// </summary>
  685. /// <returns></returns>
  686. private string GetWhereStr()
  687. {
  688. string StrWhere = " 1=1 ";
  689. string StrText = this.cmbQueryText.Text.Trim().ToLower();
  690. if (StrText != "")
  691. {
  692. Hashtable htData = new Hashtable();
  693. htData["订单号"] = "";
  694. htData["接单人"] = "";
  695. htData["接单人拼音"] = "";
  696. htData["姓名1"] = "";
  697. htData["姓名拼音1"] = "";
  698. htData["姓名2"] = "";
  699. htData["姓名拼音2"] = "";
  700. htData["电话1"] = "";
  701. htData["电话2"] = "";
  702. string Atext = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.儿童订单).Trim();
  703. string Ctext = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.婚纱订单).Trim();
  704. string Dtext = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPrefix(LYFZ.EnumPublic.OrderNumberPrefixType.写真订单).Trim();
  705. bool Isbl = true;
  706. if (Atext != "" || Ctext != "" || Dtext != "")
  707. {
  708. if (LYFZ.Command.Command_Validate.IsOrderNumber(StrText))
  709. { htData["订单号"] = "1"; Isbl = false; }
  710. }
  711. if (LYFZ.Command.Command_Validate.IsNumber(StrText))
  712. {
  713. if (Atext == "" || Ctext == "" || Dtext == "")
  714. { htData["订单号"] = "1"; }
  715. htData["电话1"] = "1";
  716. htData["电话2"] = "1";
  717. }
  718. else if (LYFZ.Command.Command_Validate.IsEnglish(StrText))
  719. {
  720. if (Atext != "" || Ctext != "" || Dtext != "")
  721. { htData["订单号"] = "1"; }
  722. htData["姓名拼音1"] = "1";
  723. htData["姓名拼音2"] = "1";
  724. htData["接单人拼音"] = "1";
  725. }
  726. else if (LYFZ.Command.Command_Validate.IsChinese(StrText))
  727. {
  728. htData["姓名1"] = "1";
  729. htData["姓名2"] = "1";
  730. htData["接单人"] = "1";
  731. }
  732. else if (Isbl)
  733. {
  734. htData["订单号"] = "1";
  735. htData["姓名1"] = "1";
  736. htData["姓名拼音1"] = "1";
  737. htData["姓名2"] = "1";
  738. htData["姓名拼音2"] = "1";
  739. htData["电话1"] = "1";
  740. htData["电话2"] = "1";
  741. htData["接单人"] = "1";
  742. htData["接单人拼音"] = "1";
  743. }
  744. string strV = "";
  745. int i = 0;
  746. foreach (DictionaryEntry dic in htData)
  747. {
  748. if (dic.Value.ToString().Trim() != "")
  749. {
  750. if (i == 0)
  751. { strV += dic.Key + " like '%" + StrText + "%'"; }
  752. else
  753. { strV += " or " + dic.Key + " like '%" + StrText + "%'"; }
  754. i++;
  755. }
  756. }
  757. if (strV != "")
  758. { StrWhere += " and (" + strV + ")"; }
  759. }
  760. if (!IsChk)
  761. {
  762. if (IsPortrait)
  763. {
  764. if (LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.婚纱版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  765. { StrWhere += " And Ord_Type in ('" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.婚纱订单) + "','" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.写真订单) + "')"; }
  766. else if (LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.儿童版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  767. { StrWhere += " And Ord_Type in ('" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.儿童订单) + "','" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.写真订单) + "')"; }
  768. else if (LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.旗舰版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  769. { StrWhere += " And Ord_Type in ('" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.婚纱订单) + "','" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.儿童订单) + "','" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.写真订单) + "')"; }
  770. }
  771. else
  772. {
  773. if (LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.婚纱版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  774. { StrWhere += " And Ord_Type = '" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.婚纱订单) + "'"; }
  775. else if (LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.儿童版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  776. { StrWhere += " And Ord_Type = '" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.儿童订单) + "'"; }
  777. else if (LYFZ.Software.MainBusiness.EnumPermissions.BusinessType.旗舰版 == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessType())
  778. { StrWhere += " And Ord_Type in ('" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.婚纱订单) + "','" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.儿童订单) + "')"; }
  779. }
  780. }
  781. else
  782. {
  783. if (this.chkDressVersion.Checked)
  784. { StrWhere += " And Ord_Type = '" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.婚纱订单) + "'"; }
  785. else if (this.chkKidsVersion.Checked)
  786. { StrWhere += " And Ord_Type = '" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.儿童订单) + "'"; }
  787. else if (this.chkPortraitVersion.Checked)
  788. { StrWhere += " And Ord_Type = '" + Convert.ToInt32(LYFZ.EnumPublic.OrderType.写真订单) + "'"; }
  789. }
  790. return StrWhere;
  791. }
  792. /// <summary>
  793. /// 查询
  794. /// </summary>
  795. /// <param name="sender"></param>
  796. /// <param name="e"></param>
  797. protected override void btnQuery_Click(object sender, EventArgs e)
  798. { PublicFunctionRows(); }
  799. /// <summary>
  800. /// 预警设置
  801. /// </summary>
  802. /// <param name="sender"></param>
  803. /// <param name="e"></param>
  804. protected override void btnWarningSet_Click(object sender, EventArgs e)
  805. {
  806. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.SetProcessAlertSuperSmallForm frm = new SuperSmallForm.SetProcessAlertSuperSmallForm();
  807. frm.ShowDialog();
  808. if (frm.IsSave)
  809. { PublicFunctionRows(); }
  810. }
  811. /// <summary>
  812. /// 导出
  813. /// </summary>
  814. /// <param name="sender"></param>
  815. /// <param name="e"></param>
  816. protected override void btnExport_Click(object sender, EventArgs e)
  817. { this.dgvData.ExportDataTable(); }
  818. /// <summary>
  819. /// 关闭
  820. /// </summary>
  821. /// <param name="sender"></param>
  822. /// <param name="e"></param>
  823. protected override void btnClose_Click(object sender, EventArgs e)
  824. { this.Close(); }
  825. /// <summary>
  826. /// 婚纱版
  827. /// </summary>
  828. /// <param name="sender"></param>
  829. /// <param name="e"></param>
  830. protected override void chkDressVersion_Click(object sender, EventArgs e)
  831. {
  832. if (this.chkDressVersion.Checked)
  833. { this.chkPortraitVersion.Checked = false; this.chkKidsVersion.Checked = false; this.chkDressVersion.Checked = true; this.IsChk = true; }
  834. else { this.IsChk = false; }
  835. PublicFunctionRows();
  836. }
  837. /// <summary>
  838. /// 儿童版
  839. /// </summary>
  840. /// <param name="sender"></param>
  841. /// <param name="e"></param>
  842. protected override void chkKidsVersion_Click(object sender, EventArgs e)
  843. {
  844. if (this.chkKidsVersion.Checked)
  845. { this.chkPortraitVersion.Checked = false; this.chkKidsVersion.Checked = true; this.chkDressVersion.Checked = false; this.IsChk = true; }
  846. else { this.IsChk = false; }
  847. PublicFunctionRows();
  848. }
  849. /// <summary>
  850. /// 写真版
  851. /// </summary>
  852. /// <param name="sender"></param>
  853. /// <param name="e"></param>
  854. protected override void chkPortraitVersion_Click(object sender, EventArgs e)
  855. {
  856. if (this.chkPortraitVersion.Checked)
  857. { this.chkPortraitVersion.Checked = true; this.chkKidsVersion.Checked = false; this.chkDressVersion.Checked = false; this.IsChk = true; }
  858. else { this.IsChk = false; }
  859. PublicFunctionRows();
  860. }
  861. /// <summary>
  862. /// 双击事件
  863. /// </summary>
  864. /// <param name="sender"></param>
  865. /// <param name="e"></param>
  866. protected override void dgvData_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
  867. {
  868. if (this.dgvData.Rows.Count > 0)
  869. {
  870. if (e.RowIndex != -1 && e.ColumnIndex != -1)
  871. {
  872. #region 权限
  873. //if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.ProcessMonitoring, LYFZ.CustomAttributes.OperatingAuthority.Monitor_Postpone))
  874. //{ return; }
  875. #endregion
  876. if (this.dgvData.CurrentRow.Cells[e.ColumnIndex].Value.ToString().Trim().ToLower() != "ok")
  877. {
  878. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.ProcessExtensionSetSuperSmallForm frm = new SuperSmallForm.ProcessExtensionSetSuperSmallForm();
  879. frm.StrNumber = this.dgvData.CurrentRow.Cells["strNumber"].Value.ToString().Trim();
  880. frm.StrViceNumber = this.dgvData.CurrentRow.Cells["strViceNumber"].Value.ToString().Trim();
  881. frm.StrType = this.dgvData.Columns[e.ColumnIndex].HeaderText.Trim();
  882. frm.ShowDialog();
  883. if (frm.IsSaveed)
  884. { this.PublicFunctionRows(); }
  885. }
  886. }
  887. }
  888. }
  889. /// <summary>
  890. /// 窗体大小发生变化事件
  891. /// </summary>
  892. /// <param name="sender"></param>
  893. /// <param name="e"></param>
  894. protected override void ProcessMonitorFormMain_Resize(object sender, EventArgs e)
  895. {
  896. if (!IsFirstRun)
  897. {
  898. int ControlsWidth = 0;
  899. int ForCount = 0;
  900. for (int i = 0; i < this.flowLayoutPanel1.Controls.Count; i++)
  901. {
  902. if (this.flowLayoutPanel1.Controls[i].Visible)
  903. {
  904. ForCount++;
  905. ControlsWidth += this.flowLayoutPanel1.Controls[i].Width;
  906. }
  907. }
  908. ControlsWidth += ForCount * 6 + this.btnClose.Width / 2;
  909. int strWidth = this.Width;
  910. if (strWidth > ControlsWidth)
  911. {
  912. this.flowLayoutPanel1.Height = 34;
  913. //this.flowLayoutPanel1.Size = new Size(this.panelEx2.Width - 10, 34);
  914. //this.panelEx2.Location = new Point(0, 50);
  915. //this.dgvData.Location = new Point(this.dgvData.Location.X, 61);
  916. //this.dgvData.Size = new Size(this.panelEx2.Width - (this.dgvData.Location.X * 2), this.panelEx1.Height - this.dgvData.Location.Y - this.ucPagerEx1.Height - 5);
  917. }
  918. else
  919. {
  920. this.flowLayoutPanel1.Height = 70;
  921. //this.flowLayoutPanel1.Size = new Size(this.panelEx2.Width - 10, 70);
  922. //this.panelEx2.Location = new Point(0, 85);
  923. //this.dgvData.Location = new Point(this.dgvData.Location.X, 95);
  924. //this.dgvData.Size = new Size(this.panelEx2.Width - (this.dgvData.Location.X * 2), this.panelEx1.Height - this.dgvData.Location.Y - this.ucPagerEx1.Height - 5);
  925. }
  926. }
  927. }
  928. }
  929. }