frmAddDress.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. using HttpFileTransfer;
  2. using LYFZ.ComponentLibrary;
  3. using LYFZ.PhotoSelectSystem;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.ComponentModel;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Windows.Forms;
  11. namespace LYFZ.Software.MainBusiness.NewDressSystem
  12. {
  13. public class frmAddDress : LYFZ.Software.NewDressSystem.frmAddDress
  14. {
  15. public frmAddDress()
  16. {
  17. /* RequestParameter parameter = new RequestParameter("http://192.168.1.19:8090", "E33111416591824337");
  18. parameter.DomainUrl = "http://e33111416591824337.bjb10.lyfz.net:8000";
  19. ResultData resultData = HttpFileTransferClient.UploadFile(parameter, "2018", "Preview_011.jpg", @"E:\测试相片\Preview_011.jpg", UploadProgress);
  20. */
  21. this.txtDressNumber.Multiline = true;
  22. initialization();
  23. BindFieldClickEvent();
  24. this.likAllSelect.Click += LikAllSelect_Click;
  25. this.likNoAllSelect.Click += LikNoAllSelect_Click;
  26. this.Shown += FrmAddDress_Shown;
  27. this.listViewImage.DoubleClick += ListViewImage_DoubleClick;
  28. this.txtDressNumber.KeyUp += TxtDressNumber_KeyUp;
  29. this.btnSave.Click += BtnSave_Click;
  30. this.btnClose.Click += BtnClose_Click;
  31. this.dtpDressBuyDate.Value = SDateTime.Now;
  32. this.btnSetJingHuoChuangJia.Click += BtnSetJingHuoChuangJia_Click;
  33. this.btnSetLiFuLeiBei.Click += BtnSetLiFuLeiBei_Click;
  34. this.btnSetBaiFangQuYu.Click += BtnSetBaiFangQuYu_Click;
  35. this.btnSetYuanShe.Click += BtnSetYuanShe_Click;
  36. this.btnSetFengGe.Click += BtnSetFengGe_Click;
  37. this.btnSetYuangShi.Click += BtnSetYuangShi_Click;
  38. this.btnSetXiuChuang.Click += BtnSetXiuChuang_Click;
  39. this.btnSetQunChuang.Click += BtnSetQunChuang_Click;
  40. this.btnSetLiFuChiChun.Click += BtnSetLiFuChiChun_Click;
  41. this.btnSetQiTa.Click += BtnSetQiTa_Click;
  42. }
  43. private void BtnSetQiTa_Click(object sender, EventArgs e)
  44. {
  45. SetFrmSystemSet(BLL.SysTemCategoryCodeType.礼服其它);
  46. }
  47. private void BtnSetLiFuChiChun_Click(object sender, EventArgs e)
  48. {
  49. SetFrmSystemSet(BLL.SysTemCategoryCodeType.礼服尺寸);
  50. }
  51. private void BtnSetQunChuang_Click(object sender, EventArgs e)
  52. {
  53. SetFrmSystemSet(BLL.SysTemCategoryCodeType.礼服裙长);
  54. }
  55. private void BtnSetXiuChuang_Click(object sender, EventArgs e)
  56. {
  57. SetFrmSystemSet(BLL.SysTemCategoryCodeType.礼服袖长);
  58. }
  59. private void BtnSetYuangShi_Click(object sender, EventArgs e)
  60. {
  61. SetFrmSystemSet(BLL.SysTemCategoryCodeType.礼服颜色);
  62. }
  63. private void BtnSetFengGe_Click(object sender, EventArgs e)
  64. {
  65. SetFrmSystemSet(BLL.SysTemCategoryCodeType.礼服风格);
  66. }
  67. private void BtnSetYuanShe_Click(object sender, EventArgs e)
  68. {
  69. SetFrmSystemSet(BLL.SysTemCategoryCodeType.礼服颜色);
  70. }
  71. private void BtnSetBaiFangQuYu_Click(object sender, EventArgs e)
  72. {
  73. SetFrmSystemSet(BLL.SysTemCategoryCodeType.礼服摆放区域);
  74. }
  75. private void BtnSetLiFuLeiBei_Click(object sender, EventArgs e)
  76. {
  77. SetFrmSystemSet(BLL.SysTemCategoryCodeType.礼服类别);
  78. }
  79. private void BtnSetJingHuoChuangJia_Click(object sender, EventArgs e)
  80. {
  81. SetFrmSystemSet(BLL.SysTemCategoryCodeType.礼服进货厂家);
  82. }
  83. /// <summary>
  84. /// 重新加载所有系统类别
  85. /// </summary>
  86. public static void LoadAllSystemCategory()
  87. {
  88. LYFZ.BLL.WageStatisticsProcess.LoadAllSystemCategory();
  89. }
  90. void SetFrmSystemSet(BLL.SysTemCategoryCodeType sysTemCategory)
  91. {
  92. LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
  93. frm.TypeName = BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode(sysTemCategory).ToUpper();
  94. frm.Version = "Version";
  95. if (frm.ShowDialog() == DialogResult.OK)
  96. {
  97. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
  98. {
  99. LoadAllSystemCategory();
  100. });
  101. switch (sysTemCategory)
  102. {
  103. case BLL.SysTemCategoryCodeType.礼服进货厂家:
  104. BindTreeView(BLL.SysTemCategoryCodeType.礼服进货厂家, this.cbxJingHuoChuangJia.TreeView, isExpandAll: false);
  105. break;
  106. case BLL.SysTemCategoryCodeType.礼服类别:
  107. this.cbxJingHuoChuangJia.Text = "";
  108. BindTreeView(BLL.SysTemCategoryCodeType.礼服类别, this.cbxLiFuLeiBei.TreeView, isExpandAll: false);
  109. break;
  110. case BLL.SysTemCategoryCodeType.礼服摆放区域:
  111. this.cbxBaiFangQuYu.Text = "";
  112. BindTreeView(BLL.SysTemCategoryCodeType.礼服摆放区域, this.cbxBaiFangQuYu.TreeView, isExpandAll: false);
  113. break;
  114. case BLL.SysTemCategoryCodeType.礼服颜色:
  115. BindTreeView(BLL.SysTemCategoryCodeType.礼服颜色, this.cbxYuangShi.TreeView, isExpandAll: false);
  116. break;
  117. case BLL.SysTemCategoryCodeType.礼服风格:
  118. BindTreeView(BLL.SysTemCategoryCodeType.礼服风格, this.cbxFengGe.TreeView, isExpandAll: false);
  119. break;
  120. case BLL.SysTemCategoryCodeType.礼服样式:
  121. BindTreeView(BLL.SysTemCategoryCodeType.礼服样式, this.cbxYuangShi.TreeView, isExpandAll: false);
  122. break;
  123. case BLL.SysTemCategoryCodeType.礼服袖长:
  124. BindTreeView(BLL.SysTemCategoryCodeType.礼服袖长, this.cbxXiuChuang.TreeView, isExpandAll: false);
  125. break;
  126. case BLL.SysTemCategoryCodeType.礼服裙长:
  127. BindTreeView(BLL.SysTemCategoryCodeType.礼服裙长, this.cbxQunChuang.TreeView, isExpandAll: false);
  128. break;
  129. case BLL.SysTemCategoryCodeType.礼服尺寸:
  130. BindTreeView(BLL.SysTemCategoryCodeType.礼服尺寸, this.cbxLiFuChiChun.TreeView, isExpandAll: false);
  131. break;
  132. case BLL.SysTemCategoryCodeType.礼服其它:
  133. BindTreeView(BLL.SysTemCategoryCodeType.礼服其它, this.cbxQiTa.TreeView, isExpandAll: false);
  134. break;
  135. }
  136. }
  137. }
  138. private void BtnClose_Click(object sender, EventArgs e)
  139. {
  140. this.DialogResult = DialogResult.Cancel;
  141. }
  142. private void BtnSave_Click(object sender, EventArgs e)
  143. {
  144. List<string> LiFuSerialNumberList=GetLiFuSerialNumberList();
  145. this.txtDressNumber.Text = String.Join(",", LiFuSerialNumberList);
  146. TxtDressNumber_KeyUp(null,null);
  147. string verificationMsg = "";
  148. if (VerificationControlValue(ref verificationMsg))
  149. {
  150. if (this.Read_ErpDressFrom(_DressFromModel))
  151. {
  152. }
  153. }
  154. else {
  155. MessageBoxCustom.Show(verificationMsg);
  156. }
  157. }
  158. Model.Model_ErpDressFrom _DressFromModel = new Model.Model_ErpDressFrom();
  159. /// <summary>
  160. ///
  161. /// </summary>
  162. /// <param name="_DressModel"></param>
  163. bool Read_ErpDressFrom(Model.Model_ErpDressFrom _DressModel)
  164. {
  165. if (VerificationControlValue())
  166. {
  167. try
  168. {
  169. _DressModel.Dsfm_DressName = this.txtDressName.Text.Trim();
  170. _DressModel.Dsfm_DressBuyDate = this.dtpDressBuyDate.Value;
  171. _DressModel.Dsfm_ScrapDate = this.GetDateTimeToLong(this.dtpDressChuShouDate);
  172. _DressModel.Dsfm_ScrapDate= this.GetDateTimeToLong(this.dtpDressBaoFeiDate);
  173. _DressModel.Dsfm_PurchasePrice = this.nudGuoMaiJiaGe.Value;
  174. _DressModel.Dsfm_CostPrice = this.nudChenBenJiaGe.Value;
  175. _DressModel.Dsfm_SalePrice = this.nudChuShouJiage.Value;
  176. _DressModel.Dsfm_RentPrice = this.nudChuZhuJiage.Value;
  177. _DressModel.Dsfm_CustomizePrice = this.nudDingZhiJiage.Value;
  178. _DressModel.Dsfm_DressRemark = this.txtRemark.Text.Trim();
  179. _DressModel.Dsfm_DressIntroduce = this.txtLiFuMiaoShu.Text.Trim();
  180. _DressModel.Dsfm_DressQuantity = 1;
  181. _DressModel.Dsfm_IsEnabled = this.rdoShuangJia.Checked ? "1" : "0";
  182. _DressModel.Dsfm_DressStatus = this.GetLiFuZhuangTai();
  183. _DressModel.Dsfm_DressType = this.cbxLiFuLeiBei.GetSelectedNodeName().Trim();//BFAFDBAIEIFBDECH
  184. _DressModel.Dsfm_PlacedRegion = this.cbxBaiFangQuYu.GetSelectedNodeName().Trim();//BGBBCJBGEIEHHHFBD 白纱区
  185. return true;
  186. }
  187. catch (Exception ex)
  188. {
  189. MessageBoxCustom.Show(String.Format(ex.Message));
  190. }
  191. }
  192. return false;
  193. }
  194. long GetDateTimeToLong(ComponentLibrary.DateTimePickerEx dateTime)
  195. {
  196. return String.IsNullOrWhiteSpace(dateTime.DateValue.Trim()) ? 0 : dateTime.Value.ToJavaScriptTimeStamp();
  197. }
  198. /// <summary>
  199. /// 获取礼服状态
  200. /// </summary>
  201. /// <returns></returns>
  202. int GetLiFuZhuangTai()
  203. {
  204. foreach (Control con in this.plLiFuZhuangTai.Controls)
  205. {
  206. if (con.GetType() == typeof(ComponentLibrary.RadioButtonEx))
  207. {
  208. ComponentLibrary.RadioButtonEx radioButton = (ComponentLibrary.RadioButtonEx)con;
  209. if (radioButton.Checked)
  210. {
  211. return Convert.ToInt32(radioButton.Tag);
  212. }
  213. }
  214. }
  215. return 0;
  216. }
  217. /// <summary>
  218. /// 设置礼服状态
  219. /// </summary>
  220. /// <param name="status"></param>
  221. void SetLiFuZhuangTai(int status)
  222. {
  223. foreach (Control con in this.plLiFuZhuangTai.Controls)
  224. {
  225. if (con.GetType() == typeof(ComponentLibrary.RadioButtonEx))
  226. {
  227. ComponentLibrary.RadioButtonEx radioButton = (ComponentLibrary.RadioButtonEx)con;
  228. if (Convert.ToInt32(radioButton.Tag)==status)
  229. {
  230. radioButton.Checked = true;
  231. }
  232. }
  233. }
  234. }
  235. /// <summary>
  236. /// 验证必填控件的值是否已输入值
  237. /// </summary>
  238. /// <returns></returns>
  239. bool VerificationControlValue()
  240. {
  241. string verificationMsg = "";
  242. return VerificationControlValue(ref verificationMsg);
  243. }
  244. /// <summary>
  245. /// 验证必填控件的值是否已输入值
  246. /// </summary>
  247. /// <returns></returns>
  248. bool VerificationControlValue(ref string msg)
  249. {
  250. bool isBl = true;
  251. if (String.IsNullOrWhiteSpace(this.txtDressNumber.Text.Trim()))
  252. {
  253. isBl = false;
  254. msg = "礼服编号不能为空";
  255. }
  256. else if (String.IsNullOrWhiteSpace(this.txtDressName.Text.Trim()))
  257. {
  258. isBl = false;
  259. msg = "礼服名称不能为空";
  260. }
  261. else if (String.IsNullOrWhiteSpace(this.dtpDressBuyDate.DateValue.Trim()))
  262. {
  263. isBl = false;
  264. msg = "购买日期不能为空";
  265. }
  266. else if (String.IsNullOrWhiteSpace(this.cbxLiFuLeiBei.Text.Trim()))
  267. {
  268. isBl = false;
  269. msg = "礼服类别不能为空";
  270. }
  271. else if (String.IsNullOrWhiteSpace(this.cbxBaiFangQuYu.Text.Trim()))
  272. {
  273. isBl = false;
  274. msg = "礼服摆放区域不能为空";
  275. }
  276. return isBl;
  277. }
  278. private void TxtDressNumber_KeyUp(object sender, KeyEventArgs e)
  279. {
  280. int tempHeight = 14 * this.txtDressNumber.lines.Length + 27;
  281. if (tempHeight <= 41)
  282. {
  283. tempHeight = 41;
  284. }
  285. if (this.txtDressNumber.Height != tempHeight)
  286. {
  287. this.txtDressNumber.Height = tempHeight;
  288. this.groupLiFuInfo.Location = new Point(this.groupLiFuInfo.Location.X, this.txtDressNumber.Location.Y + this.txtDressNumber.Height + 3);
  289. }
  290. this.lbLiFuCount.Text = GetLiFuSerialNumberList().Count.ToString();
  291. }
  292. private void ListViewImage_DoubleClick(object sender, EventArgs e)
  293. {
  294. if (this.listViewImage.SelectedItems != null)
  295. {
  296. System.Drawing.Brush brush = System.Drawing.Brushes.Black;
  297. frmFullScreenPlay frmFull = new frmFullScreenPlay(getPhotoPathList(), brush);
  298. frmFull.IsAutoplayMovie = false;
  299. frmFull.CurrentIndex = 0;
  300. if (listViewImage.SelectedItems != null && listViewImage.SelectedItems.Count > 0)
  301. {
  302. frmFull.CurrentIndex = listViewImage.SelectedItems[0].Index;
  303. }
  304. // frmFull.CurrentIndex = getPhotoCurrentIndex();//lstvData.SelectedItems[lstvData.SelectedItems.Count - 1].Index;
  305. frmFull.ShowDialog();
  306. frmFull.Dispose();
  307. }
  308. }
  309. /// <summary>
  310. /// 获取要全屏显示的图片路径集合
  311. /// </summary>
  312. /// <returns></returns>
  313. List<string> getPhotoPathList()
  314. {
  315. List<string> photoPathList = new List<string>();
  316. /*for (int i = 0; i < this.listViewImage.Items.Count; i++)
  317. {
  318. if (this.listViewImage.Items[i].Tag != null)
  319. {
  320. photoPathList.Add(this.listViewImage.Items[i].Tag.ToString());
  321. }
  322. else
  323. {
  324. MessageBoxCustom.Show("相片加载出错!");
  325. break;
  326. }
  327. }*/
  328. photoPathList.Add(@"E:\测试相片\Preview_010.jpg");
  329. return photoPathList;
  330. }
  331. bool isEdit = false;
  332. private void FrmAddDress_Shown(object sender, EventArgs e)
  333. {
  334. if (isEdit)
  335. {
  336. this.txtDressNumber.Enabled = false;
  337. }
  338. else {
  339. this.txtDressNumber.Enabled = true;
  340. }
  341. SetEditInitialization();
  342. InitializationDropDownList();
  343. BindImageList();
  344. // this.cbxLiFuLeiBei.SetNodeNameToSelectItme("BFAFDBAIEIFBDECH");
  345. // this.cbxBaiFangQuYu.SetNodeTextToSelectItme("白纱区");
  346. }
  347. /// <summary>
  348. /// 初始化下拉列表
  349. /// </summary>
  350. void InitializationDropDownList()
  351. {
  352. BindTreeView(BLL.SysTemCategoryCodeType.礼服进货厂家, this.cbxJingHuoChuangJia.TreeView, isExpandAll: false);
  353. BindTreeView(BLL.SysTemCategoryCodeType.礼服类别, this.cbxLiFuLeiBei.TreeView, isExpandAll: false);
  354. BindTreeView(BLL.SysTemCategoryCodeType.礼服摆放区域, this.cbxBaiFangQuYu.TreeView, isExpandAll: false);
  355. BindTreeView(BLL.SysTemCategoryCodeType.礼服颜色, this.cbxYuangShi.TreeView, isExpandAll: false);
  356. BindTreeView(BLL.SysTemCategoryCodeType.礼服风格, this.cbxFengGe.TreeView, isExpandAll: false);
  357. BindTreeView(BLL.SysTemCategoryCodeType.礼服样式, this.cbxYuangShi.TreeView, isExpandAll: false);
  358. BindTreeView(BLL.SysTemCategoryCodeType.礼服袖长, this.cbxXiuChuang.TreeView, isExpandAll: false);
  359. BindTreeView(BLL.SysTemCategoryCodeType.礼服裙长, this.cbxQunChuang.TreeView, isExpandAll: false);
  360. BindTreeView(BLL.SysTemCategoryCodeType.礼服尺寸, this.cbxLiFuChiChun.TreeView, isExpandAll: false);
  361. BindTreeView(BLL.SysTemCategoryCodeType.礼服其它, this.cbxQiTa.TreeView, isExpandAll: false);
  362. }
  363. void BindTreeView(BLL.SysTemCategoryCodeType sysTemCategory, TreeView tvw, bool isExpandAll = true, string ExclusionsList = "", bool IsFirstNodeNull = false, BLL.SysTemCategoryCodeType codeType = BLL.SysTemCategoryCodeType.未知类别)
  364. {
  365. FinancialManagement.frmEditStatisticsProgram.BindTreeView_SystemCategory(BLL.BLL_ErpSystemCategory.GetSysTemCategoryCode(sysTemCategory).ToUpper(), tvw, isExpandAll: false,ExclusionsList: ExclusionsList,IsFirstNodeNull:IsFirstNodeNull,codeType:codeType);
  366. }
  367. List<string> GetLiFuSerialNumberList()
  368. {
  369. List<string> serialNumberList = new List<string>();
  370. string serialNumberString = this.txtDressNumber.Text.Trim()
  371. .Replace(",", ",")
  372. .Replace("+", ",")
  373. .Replace(":", ":")
  374. .Replace(".", ":")
  375. .Replace(" ", ",")
  376. .Replace(";",",")
  377. .Replace(System.Environment.NewLine, ",")
  378. .Trim(',').Trim(',');
  379. if (!String.IsNullOrWhiteSpace(serialNumberString))
  380. {
  381. serialNumberList.AddRange(serialNumberString.Split(',').ToList().FindAll(s=>!String.IsNullOrWhiteSpace(s)).Distinct());
  382. }
  383. return serialNumberList;
  384. }
  385. void SetEditInitialization()
  386. {
  387. if (isEdit && GetLiFuSerialNumberList().Count > 1)
  388. {
  389. this.likAllSelect.Show();
  390. this.likNoAllSelect.Show();
  391. }
  392. else {
  393. this.likAllSelect.Hide();
  394. this.likNoAllSelect.Hide();
  395. }
  396. }
  397. /// <summary>
  398. /// 显示相片集合
  399. /// </summary>
  400. ImageList LiFuImageList = new ImageList();
  401. void initialization()
  402. {
  403. this.LiFuImageList.Images.Clear();
  404. this.LiFuImageList.ColorDepth = ColorDepth.Depth32Bit;
  405. this.LiFuImageList.ImageSize = new Size(170, 180);
  406. this.LiFuImageList.Images.Add(new Bitmap(@"E:\测试相片\Preview_010.jpg"));
  407. this.LiFuImageList.Images.Add(LYFZ.PhotoSelectSystem.MainPhotoSelect.ImageJPGE);
  408. this.listViewImage.View = View.LargeIcon;
  409. }
  410. void BindImageList()
  411. {
  412. this.listViewImage.Items.Clear();
  413. this.listViewImage.LargeImageList = this.LiFuImageList;
  414. for (int i = 0; i < 4; i++)
  415. {
  416. ListViewItem lvi = new ListViewItem();
  417. lvi.Name = "vItem" + i.ToString();
  418. lvi.ImageIndex = 0;
  419. lvi.Text = lvi.Name;
  420. lvi.Tag = "";
  421. lvi.ToolTipText = lvi.Text;
  422. // lvi.SubItems.Add(index.ToString());
  423. //lvi.SubItems.Add(PhotoPath);
  424. this.listViewImage.Items.Add(lvi);
  425. }
  426. }
  427. private void LikNoAllSelect_Click(object sender, EventArgs e)
  428. {
  429. foreach (Control con in this.groupLiFuInfo.Controls)
  430. {
  431. if (con.GetType() == typeof(LabelEx))
  432. {
  433. if (con.Cursor == Cursors.Hand)
  434. {
  435. LabelEx labelEx = (LabelEx)con;
  436. labelEx.BorderStyle = BorderStyle.None;
  437. labelEx.BackColor = plExMainContainer.BackColor;
  438. }
  439. }
  440. }
  441. }
  442. private void LikAllSelect_Click(object sender, EventArgs e)
  443. {
  444. foreach (Control con in this.groupLiFuInfo.Controls)
  445. {
  446. if (con.GetType() == typeof(LabelEx))
  447. {
  448. if (con.Cursor == Cursors.Hand)
  449. {
  450. LabelEx labelEx = (LabelEx)con;
  451. labelEx.BorderStyle = BorderStyle.FixedSingle;
  452. labelEx.BackColor = System.Drawing.Color.LightPink;
  453. }
  454. }
  455. }
  456. }
  457. void BindFieldClickEvent()
  458. {
  459. foreach (Control con in this.groupLiFuInfo.Controls)
  460. {
  461. if (con.GetType() == typeof(LabelEx))
  462. {
  463. if (con.Cursor == Cursors.Hand)
  464. {
  465. con.Click += Con_Click;
  466. }
  467. }
  468. }
  469. }
  470. private void Con_Click(object sender, EventArgs e)
  471. {
  472. if (isEdit)
  473. {
  474. if (GetLiFuSerialNumberList().Count > 1)
  475. {
  476. LabelEx labelEx = (LabelEx)sender;
  477. if (labelEx.BorderStyle == BorderStyle.None)
  478. {
  479. labelEx.BorderStyle = BorderStyle.FixedSingle;
  480. labelEx.BackColor = System.Drawing.Color.LightPink;
  481. }
  482. else
  483. {
  484. labelEx.BorderStyle = BorderStyle.None;
  485. labelEx.BackColor = plExMainContainer.BackColor;
  486. }
  487. }
  488. }
  489. }
  490. void UploadProgress(UploadFileReport report)
  491. {
  492. if (report.UploadFileCompleted && report.UploadStatus)
  493. {
  494. Console.WriteLine(String.Format("已上传成功\r\n"));
  495. }
  496. else if (report.UploadFileCompleted && !report.UploadStatus)
  497. {
  498. Console.WriteLine(String.Format("上传失败:{0} {1}\r\n", report.ErrorMsg, report.GetReportMsgInfo()));
  499. }
  500. else
  501. {
  502. Console.WriteLine(String.Format("{0}\r\n", report.GetReportMsgInfo()));
  503. }
  504. }
  505. }
  506. }