DressEnteredManagedFormMain.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  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. namespace LYFZ.Software.MainBusiness.Dresses
  10. {
  11. public partial class DressEnteredManagedFormMain : LYFZ.Software.UI.Dresses.DressEnteredManagedFormMain
  12. {
  13. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  14. LYFZ.BLL.BLL_ErpDressFrom dfbll = new BLL.BLL_ErpDressFrom();
  15. public DressEnteredManagedFormMain()
  16. {
  17. this.Load += DressEnteredManagedFormMain_Load;
  18. this.Shown += DressEnteredManagedFormMain_Shown;
  19. this.chkUpperRack.Click += chkUpperRack_Click;
  20. this.chkDownRack.Click += chkDownRack_Click;
  21. this.btnQuery.Click += btnQuery_Click;
  22. this.btnAdded.Click += btnAdded_Click;
  23. this.btnUpdata.Click += btnUpdata_Click;
  24. this.btnDeleted.Click += btnDeleted_Click;
  25. this.btnUseRecord.Click += btnUseRecord_Click;
  26. this.btnExport.Click += btnExport_Click;
  27. this.btnClose.Click += btnClose_Click;
  28. this.listViewData_Dress.MouseDoubleClick += listViewData_Dress_MouseDoubleClick;
  29. this.Resize += DressEnteredManagedFormMain_Resize;
  30. this.ucPagerEx1.EventPaging += ucPagerEx1_EventPaging;
  31. this.listViewData_Dress.MouseClick += ListViewData_Dress_MouseClick;
  32. }
  33. private void ListViewData_Dress_MouseClick(object sender, MouseEventArgs e)
  34. {
  35. if(this.listViewData_Dress.SelectedItems.Count>0&& e.Location.X>0&& e.Location.X< this.listViewData_Dress.Columns[0].Width&& this.listViewData_Dress.SelectedItems[0].Bounds.Y< e.Location.Y &&
  36. this.listViewData_Dress.SelectedItems[0].Bounds.Y+ this.listViewData_Dress.SelectedItems[0].Bounds.Height > e.Location.Y)
  37. {
  38. if(this.listViewData_Dress.SelectedItems.Count>0)
  39. {
  40. LvItemImageModel model = this.listViewData_Dress.SelectedItems[0].Tag as LvItemImageModel;
  41. if (!model.bImageLoad)
  42. {
  43. string[] StrArray = model.ImagePath.Split('|');//dt.Rows[i]["Dsfm_DressPhotoNames"].ToString().Trim().Split('|');
  44. model.bImageLoad = true;
  45. if (!this.mlistImage.Images.Keys.Contains(model.Text))
  46. { //dt.Rows[i]["Dsfm_DressNumber"].ToString().Trim()
  47. string loadMessage = "";
  48. Image img = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDressImage_Small(StrArray[0].Trim(), ref loadMessage);
  49. model.ImageMessage = loadMessage;
  50. if (loadMessage != "加载成功")
  51. {
  52. model.bLoadStatus = false;
  53. //MessageBoxCustom.Show(model.ImageMessage, "提示消息", MessageBoxButtons.OK, null, false, 1);
  54. }
  55. else
  56. {
  57. model.bLoadStatus = true;
  58. this.mlistImage.Images.Add(model.Text, img);
  59. this.listViewData_Dress.SelectedItems[0].ImageKey = model.Text;
  60. }
  61. exToolTip1.RemoveAll();
  62. //tempModel = model;
  63. exToolTip1.SetToolTip(listViewData_Dress, model.ImageMessage);
  64. //timer.Enabled = true;
  65. }
  66. }
  67. else
  68. {
  69. exToolTip1.RemoveAll();
  70. //timer.Enabled = true;
  71. //tempModel = model;
  72. exToolTip1.SetToolTip(listViewData_Dress, model.ImageMessage);
  73. //MessageBoxCustom.Show(model.ImageMessage, "提示消息", MessageBoxButtons.OK, null, false, 1);
  74. }
  75. }
  76. }
  77. else
  78. {
  79. exToolTip1.SetToolTip(listViewData_Dress, "");
  80. }
  81. }
  82. /// <summary>
  83. /// 相片集合
  84. /// </summary>
  85. ImageList mlistImage = new ImageList();
  86. /// <summary>
  87. /// 窗体加载事件
  88. /// </summary>
  89. /// <param name="sender"></param>
  90. /// <param name="e"></param>
  91. void DressEnteredManagedFormMain_Load(object sender, EventArgs e)
  92. {
  93. this.listViewData_Dress.View = View.Details;
  94. this.listViewData_Dress.GridLines = true;
  95. string[] StrColumns = "礼服编号,礼服名称,摆放区域,礼服品牌,礼服尺寸,成本价格,出租价格,出售价格,礼服状态,出租次数,送洗次数,出售状态,购买日期,录入时间,礼服备注".Split(',');
  96. for (int i = 0; i < StrColumns.Length; i++)
  97. {
  98. ColumnHeader ch = new ColumnHeader();
  99. ch.Text = StrColumns[i].Trim();
  100. ch.TextAlign = HorizontalAlignment.Left;
  101. switch (StrColumns[i].Trim())
  102. {
  103. case "礼服编号":
  104. ch.Width = 150;
  105. break;
  106. case "礼服名称":
  107. ch.Width = 150;
  108. break;
  109. case "摆放区域":
  110. ch.Width = 120;
  111. break;
  112. case "礼服品牌":
  113. ch.Width = 120;
  114. break;
  115. case "礼服尺寸":
  116. ch.Width = 100;
  117. break;
  118. case "成本价格":
  119. ch.Width = 90;
  120. break;
  121. case "出租价格":
  122. ch.Width = 90;
  123. break;
  124. case "出售价格":
  125. ch.Width = 90;
  126. break;
  127. case "礼服状态":
  128. ch.Width = 120;
  129. break;
  130. case "出租次数":
  131. ch.Width = 80;
  132. break;
  133. case "送洗次数":
  134. ch.Width = 80;
  135. break;
  136. case "出售状态":
  137. ch.Width = 80;
  138. break;
  139. case "购买日期":
  140. ch.Width = 90;
  141. break;
  142. case "录入时间":
  143. ch.Width = 110;
  144. break;
  145. case "礼服备注":
  146. ch.Width = 300;
  147. break;
  148. }
  149. switch (StrColumns[i].Trim())
  150. {
  151. case "成本价格":
  152. case "出租价格":
  153. case "出售价格":
  154. ch.TextAlign = HorizontalAlignment.Right;
  155. break;
  156. case "礼服编号":
  157. case "礼服名称":
  158. case "摆放区域":
  159. case "礼服品牌":
  160. case "礼服尺寸":
  161. case "礼服备注":
  162. ch.TextAlign = HorizontalAlignment.Left;
  163. break;
  164. default:
  165. ch.TextAlign = HorizontalAlignment.Center;
  166. break;
  167. }
  168. this.listViewData_Dress.Columns.Add(ch);
  169. }
  170. this.mlistImage.ImageSize = new Size(60, 50);
  171. this.mlistImage.ColorDepth = ColorDepth.Depth32Bit;
  172. this.listViewData_Dress.SmallImageList = mlistImage;
  173. this.btnDeleted.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.DressEntry, CustomAttributes.OperatingAuthority.Delete);
  174. this.btnExport.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.DressEntry, CustomAttributes.OperatingAuthority.DataExport);
  175. this.btnUseRecord.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.DressView, CustomAttributes.OperatingAuthority.SeeView);
  176. }
  177. /// <summary>
  178. /// 窗体加载事件
  179. /// </summary>
  180. /// <param name="sender"></param>
  181. /// <param name="e"></param>
  182. void DressEnteredManagedFormMain_Shown(object sender, EventArgs e)
  183. {
  184. bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(VersionControl.VersionFunctionEnum.礼服管理);
  185. if (!b)
  186. {
  187. this.Close();
  188. return;
  189. }
  190. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BEAJBGADDCBAHFFA", this.cmbtreevCategory, IsFirstNodeNull: true, IsFirstNodeName: "全部");
  191. this.cmbtreevCategory.TextFindTag("全部");
  192. this.PublicFunctionRows();
  193. }
  194. /// <summary>
  195. /// 上架
  196. /// </summary>
  197. /// <param name="sender"></param>
  198. /// <param name="e"></param>
  199. void chkUpperRack_Click(object sender, EventArgs e)
  200. {
  201. this.chkDownRack.Checked = false;
  202. this.PublicFunctionRows();
  203. }
  204. /// <summary>
  205. /// 下架
  206. /// </summary>
  207. /// <param name="sender"></param>
  208. /// <param name="e"></param>
  209. void chkDownRack_Click(object sender, EventArgs e)
  210. {
  211. this.chkUpperRack.Checked = false;
  212. this.PublicFunctionRows();
  213. }
  214. /// <summary>
  215. /// 查询
  216. /// </summary>
  217. /// <param name="sender"></param>
  218. /// <param name="e"></param>
  219. void btnQuery_Click(object sender, EventArgs e)
  220. {
  221. this.PublicFunctionRows();
  222. }
  223. /// <summary>
  224. /// 添加
  225. /// </summary>
  226. /// <param name="sender"></param>
  227. /// <param name="e"></param>
  228. void btnAdded_Click(object sender, EventArgs e)
  229. {
  230. #if DEBUG
  231. LYFZ.Software.MainBusiness.NewDressSystem.frmAddDress addDress = new NewDressSystem.frmAddDress();
  232. addDress.ShowDialog();
  233. #else
  234. LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressEnteredAddedSmallForm frm = new SetSmallForm.DressEnteredAddedSmallForm();
  235. frm.ShowDialog();
  236. if (frm.IsSaveed)
  237. { this.PublicFunctionRows(); }
  238. #endif
  239. }
  240. /// <summary>
  241. /// 修改
  242. /// </summary>
  243. /// <param name="sender"></param>
  244. /// <param name="e"></param>
  245. void btnUpdata_Click(object sender, EventArgs e)
  246. {
  247. if (this.listViewData_Dress.Items.Count > 0 && this.listViewData_Dress.SelectedItems.Count > 0)
  248. {
  249. LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressEnteredUpdateSmallForm frm = new SetSmallForm.DressEnteredUpdateSmallForm();
  250. frm.StrDressNumber = this.listViewData_Dress.SelectedItems[0].Tag.ToString().Trim();
  251. frm.ShowDialog();
  252. if (frm.IsSaveed)
  253. { this.PublicFunctionRows(); }
  254. }
  255. }
  256. /// <summary>
  257. /// 删除
  258. /// </summary>
  259. /// <param name="sender"></param>
  260. /// <param name="e"></param>
  261. void btnDeleted_Click(object sender, EventArgs e)
  262. {
  263. if (this.listViewData_Dress.Items.Count > 0 && this.listViewData_Dress.SelectedItems.Count > 0)
  264. {
  265. string StrDressName = this.listViewData_Dress.SelectedItems[0].SubItems["礼服名称"].Text.Trim();
  266. string StrDressCustomNumber = this.listViewData_Dress.SelectedItems[0].Text.ToString().Trim();
  267. string StrDressNumber = this.listViewData_Dress.SelectedItems[0].Tag.ToString().Trim();
  268. string StrDressDeletePhotoName = "";
  269. if (MessageBoxCustom.Show("您选中的礼服名称:" + StrDressName + "\r\n礼服编号" + StrDressCustomNumber + "\r\n您确定要删除吗?", "", MessageBoxButtons.YesNo) == DialogResult.No)
  270. { return; }
  271. List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
  272. DataTable dt = orbll.GetView_Custom("tb_ErpDressFrom", StrWhere: "Dsfm_DressNumber = '" + StrDressNumber + "'", ShowColumnName: "ID,Dsfm_DressPhotoNames").Tables[0];
  273. if (dt.Rows.Count > 0)
  274. {
  275. if (!string.IsNullOrEmpty(dt.Rows[0]["Dsfm_DressPhotoNames"].ToString().Trim()))
  276. {
  277. string[] StrArrayPhotoNames = dt.Rows[0]["Dsfm_DressPhotoNames"].ToString().Trim().Split('|');
  278. for (int i = 0; i < StrArrayPhotoNames.Length; i++)
  279. {
  280. if (!string.IsNullOrEmpty(StrArrayPhotoNames[i].Trim()))
  281. {
  282. DataTable tbl = orbll.GetView_Custom("tb_ErpDressFrom", StrWhere: "Dsfm_DressNumber != '" + StrDressNumber + "' And Dsfm_DressPhotoNames like '%" + StrArrayPhotoNames[i].Trim() + "%'", ShowColumnName: "ID").Tables[0];
  283. if (tbl.Rows.Count <= 0)
  284. {
  285. //backgroundWorker.ReportProgress(0, "正在删除" + StrArrayPhotoNames[1].Trim() + "...");
  286. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.DeleteDressPhoto(StrArrayPhotoNames[i].Trim() + ".jpg", IsRecursion: true, DeleteDressType: 0);
  287. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.DeleteDressPhoto(StrArrayPhotoNames[i].Trim() + ".jpg", IsRecursion: true, DeleteDressType: 1);
  288. StrDressDeletePhotoName += StrArrayPhotoNames[i].Trim() + ",";
  289. }
  290. }
  291. }
  292. }
  293. }
  294. clist.Add(dfbll.GetDeleteCommandInfo("ID", "=", dt.Rows[0]["ID"].ToString().Trim()));
  295. string StrContent = "删除礼服名称:" + StrDressName + ";礼服编号:" + StrDressNumber + ";礼服自定义编号:" + StrDressCustomNumber;
  296. if (!string.IsNullOrEmpty(StrDressDeletePhotoName))
  297. { StrContent += ";删除的相片有:" + StrDressDeletePhotoName.TrimEnd(','); }
  298. clist.Add(new BLL.BLL_ErpACVBSYS().GetAddCommandInfo(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetModelLog(LYFZ.EnumPublic.SystemLogsType.删除礼服.ToString(), StrContent, StrContent, SDateTime.Now)));
  299. if (clist.Count > 0)
  300. {
  301. if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
  302. { MessageBoxCustom.Show("删除成功!"); this.listViewData_Dress.Items.Remove(this.listViewData_Dress.SelectedItems[0]); }
  303. else
  304. { MessageBoxCustom.Show("删除失败!"); }
  305. }
  306. }
  307. }
  308. /// <summary>
  309. /// 使用记录
  310. /// </summary>
  311. /// <param name="sender"></param>
  312. /// <param name="e"></param>
  313. void btnUseRecord_Click(object sender, EventArgs e)
  314. {
  315. if (this.listViewData_Dress.Items.Count > 0 && this.listViewData_Dress.SelectedItems.Count > 0)
  316. {
  317. LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressUseRecordSmallForm frm = new SetSmallForm.DressUseRecordSmallForm();
  318. frm.StrDressNumber = this.listViewData_Dress.SelectedItems[0].Tag.ToString().Trim();
  319. frm.Show();
  320. }
  321. }
  322. /// <summary>
  323. /// 导出
  324. /// </summary>
  325. /// <param name="sender"></param>
  326. /// <param name="e"></param>
  327. void btnExport_Click(object sender, EventArgs e)
  328. {
  329. this.listViewData_Dress.ListViewToDataTable(StrFileName: "礼服详情");
  330. }
  331. /// <summary>
  332. /// 关闭
  333. /// </summary>
  334. /// <param name="sender"></param>
  335. /// <param name="e"></param>
  336. void btnClose_Click(object sender, EventArgs e)
  337. {
  338. this.Close();
  339. }
  340. /// <summary>
  341. /// 列表双击修改礼服信息
  342. /// </summary>
  343. /// <param name="sender"></param>
  344. /// <param name="e"></param>
  345. void listViewData_Dress_MouseDoubleClick(object sender, MouseEventArgs e)
  346. {
  347. this.btnUpdata_Click(this, null);
  348. }
  349. /// <summary>
  350. /// 窗体大小发生变化
  351. /// </summary>
  352. /// <param name="sender"></param>
  353. /// <param name="e"></param>
  354. void DressEnteredManagedFormMain_Resize(object sender, EventArgs e)
  355. {
  356. switch (this.panelExport.Location.Y)
  357. {
  358. case 0: this.flowLayoutPanel1.Height = 32; break;
  359. case 32: this.flowLayoutPanel1.Height = 64; break;
  360. }
  361. }
  362. /// <summary>
  363. /// 创建行
  364. /// </summary>
  365. private void PublicFunctionRows()
  366. {
  367. this.CreateListViewGroup();
  368. this.ucPagerEx1.PageCurrent = 1;
  369. this.ucPagerEx1.PageSize = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPageSize();//3;分页条数
  370. this.ucPagerEx1.Bind();
  371. }
  372. /// <summary>
  373. /// 画分页
  374. /// </summary>
  375. /// <param name="e"></param>
  376. /// <returns></returns>
  377. private int ucPagerEx1_EventPaging(UCPager.EventPagingArg e)
  378. {
  379. this.listViewData_Dress.Items.Clear();
  380. string StrWhere = "";
  381. if (this.chkUpperRack.Checked)
  382. { StrWhere += "And Dsfm_IsEnabled = '1' "; }
  383. else if (this.chkDownRack.Checked)
  384. { StrWhere += "And Dsfm_IsEnabled = '0' "; }
  385. if (!string.IsNullOrEmpty(this.txtKeyWord.Text.Trim()))
  386. { StrWhere += "And (Dsfm_DressCustomNumber like '%" + this.txtKeyWord.Text.Trim() + "%' or Dsfm_DressName like '%" + this.txtKeyWord.Text.Trim() + "%') "; }
  387. if (!string.IsNullOrEmpty(this.cmbtreevCategory.Text.Trim()) && this.cmbtreevCategory.Text.Trim() != "全部")
  388. { StrWhere += "And Dsfm_DressTypeCode = '" + this.cmbtreevCategory.Tag.ToString().Trim() + "' "; }
  389. LYFZ.UCPager.PageData pageData = new LYFZ.UCPager.PageData();
  390. pageData.TableName = "BView_DressManaged";
  391. pageData.PageIndex = this.ucPagerEx1.PageCurrent;
  392. pageData.PageSize = this.ucPagerEx1.PageSize;
  393. pageData.QueryCondition = StrWhere.TrimStart('A', 'n', 'd');
  394. pageData.OrderStr = "Dsfm_CreateDateTime";
  395. pageData.OrderType = 1;
  396. pageData.QueryFieldName = "Dsfm_DressNumber,Dsfm_DressCustomNumber,Dsfm_DressTypeCode,Dsfm_DressType,Dsfm_DressName,Dsfm_DressBrand,Dsfm_DressSize,Dsfm_CostPrice,Dsfm_RentPrice,Dsfm_SalePrice,Dsfm_IsEnabled,Dsfm_PlacedRegion,Dsfm_DressPhotoNames,Dsfm_DressBuyDate,Dsfm_DressRemark,Dsfm_CreateDateTime,Dsfm_RentCount,Dsfm_SendWashCount,Dsfm_SaleStatus";
  397. DataTable dt = new DataTable();
  398. this.listViewData_Dress.BeginUpdate();
  399. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
  400. {
  401. dt = pageData.QueryDataTable().Tables[0];
  402. try
  403. {
  404. this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
  405. {
  406. for (int i = 0; i < dt.Rows.Count; i++)
  407. {
  408. string[] StrArray = "".Split('|');//dt.Rows[i]["Dsfm_DressPhotoNames"].ToString().Trim().Split('|');
  409. if (!this.mlistImage.Images.Keys.Contains(""))
  410. { //dt.Rows[i]["Dsfm_DressNumber"].ToString().Trim()
  411. Image img = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDressImage_Small(StrArray[0].Trim());
  412. this.mlistImage.Images.Add("defalut", img);
  413. }
  414. ListViewItem lvItem = new ListViewItem();
  415. lvItem.Tag = new LvItemImageModel()
  416. {
  417. Text = dt.Rows[i]["Dsfm_DressNumber"].ToString().Trim(),
  418. bImageLoad = false,
  419. bLoadStatus = false,
  420. ImagePath = dt.Rows[i]["Dsfm_DressPhotoNames"].ToString().Trim(),
  421. ImageMessage = ""
  422. } ;
  423. lvItem.ImageKey = "defalut";
  424. lvItem.Text = dt.Rows[i]["Dsfm_DressCustomNumber"].ToString().Trim();
  425. ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
  426. ListSubItem.Name = "礼服名称";
  427. ListSubItem.Text = dt.Rows[i]["Dsfm_DressName"].ToString().Trim();
  428. lvItem.SubItems.Add(ListSubItem);
  429. ListSubItem = new ListViewItem.ListViewSubItem();
  430. ListSubItem.Name = "摆放区域";
  431. ListSubItem.Text = dt.Rows[i]["Dsfm_PlacedRegion"].ToString().Trim();
  432. lvItem.SubItems.Add(ListSubItem);
  433. ListSubItem = new ListViewItem.ListViewSubItem();
  434. ListSubItem.Name = "礼服品牌";
  435. ListSubItem.Text = dt.Rows[i]["Dsfm_DressBrand"].ToString().Trim();
  436. lvItem.SubItems.Add(ListSubItem);
  437. ListSubItem = new ListViewItem.ListViewSubItem();
  438. ListSubItem.Name = "礼服尺寸";
  439. ListSubItem.Text = dt.Rows[i]["Dsfm_DressSize"].ToString().Trim();
  440. lvItem.SubItems.Add(ListSubItem);
  441. ListSubItem = new ListViewItem.ListViewSubItem();
  442. ListSubItem.Name = "成本价格";
  443. ListSubItem.Text = dt.Rows[i]["Dsfm_CostPrice"].ToString().Trim();
  444. lvItem.SubItems.Add(ListSubItem);
  445. ListSubItem = new ListViewItem.ListViewSubItem();
  446. ListSubItem.Name = "出租价格";
  447. ListSubItem.Text = dt.Rows[i]["Dsfm_RentPrice"].ToString().Trim();
  448. lvItem.SubItems.Add(ListSubItem);
  449. ListSubItem = new ListViewItem.ListViewSubItem();
  450. ListSubItem.Name = "出售价格";
  451. ListSubItem.Text = dt.Rows[i]["Dsfm_SalePrice"].ToString().Trim();
  452. lvItem.SubItems.Add(ListSubItem);
  453. ListSubItem = new ListViewItem.ListViewSubItem();
  454. ListSubItem.Name = "礼服状态";
  455. ListSubItem.Text = dt.Rows[i]["Dsfm_IsEnabled"].ToString().Trim() == "0" ? "下架" : "上架";
  456. lvItem.SubItems.Add(ListSubItem);
  457. ListSubItem = new ListViewItem.ListViewSubItem();
  458. ListSubItem.Name = "出租次数";
  459. ListSubItem.Text = dt.Rows[i]["Dsfm_RentCount"].ToString().Trim();
  460. lvItem.SubItems.Add(ListSubItem);
  461. ListSubItem = new ListViewItem.ListViewSubItem();
  462. ListSubItem.Name = "送洗次数";
  463. ListSubItem.Text = dt.Rows[i]["Dsfm_SendWashCount"].ToString().Trim();
  464. lvItem.SubItems.Add(ListSubItem);
  465. ListSubItem = new ListViewItem.ListViewSubItem();
  466. ListSubItem.Name = "出售状态";
  467. ListSubItem.Text = Convert.ToInt32(dt.Rows[i]["Dsfm_SaleStatus"]) == 0 ? "" : "已售";
  468. lvItem.SubItems.Add(ListSubItem);
  469. ListSubItem = new ListViewItem.ListViewSubItem();
  470. ListSubItem.Name = "购买日期";
  471. ListSubItem.Text = LYFZ.Command.Command_Validate.DateTimeToString(dt.Rows[i]["Dsfm_DressBuyDate"]);
  472. lvItem.SubItems.Add(ListSubItem);
  473. ListSubItem = new ListViewItem.ListViewSubItem();
  474. ListSubItem.Name = "录入时间";
  475. ListSubItem.Text = LYFZ.Command.Command_Validate.DateTimeToString(dt.Rows[i]["Dsfm_CreateDateTime"], "yyyy-MM-dd HH:mm");
  476. lvItem.SubItems.Add(ListSubItem);
  477. ListSubItem = new ListViewItem.ListViewSubItem();
  478. ListSubItem.Name = "礼服备注";
  479. ListSubItem.Text = dt.Rows[i]["Dsfm_DressRemark"].ToString().Trim();
  480. lvItem.SubItems.Add(ListSubItem);
  481. if (this.listViewData_Dress.Groups.Count > 0)
  482. { this.listViewData_Dress.Groups[dt.Rows[i]["Dsfm_DressTypeCode"].ToString().Trim()].Items.Add(lvItem); }
  483. this.listViewData_Dress.Items.Add(lvItem);
  484. }
  485. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Dress);
  486. }));
  487. }
  488. catch
  489. { }
  490. });
  491. this.listViewData_Dress.EndUpdate();
  492. try
  493. {
  494. this.ucPagerEx1.TbDataSource = dt;
  495. }
  496. catch { }
  497. return pageData.TotalCount;
  498. }
  499. /// <summary>
  500. /// 创建默认分组
  501. /// </summary>
  502. void CreateListViewGroup()
  503. {
  504. DataTable dtGroup = orbll.GetView_Custom("tb_ErpDressFrom Left Join tb_ErpSystemCategory on Dsfm_DressType = Sc_ClassCode", StrWhere: "", ShowColumnName: "Sc_ClassName,Dsfm_DressType", GroupBy: "Sc_ClassName,Dsfm_DressType").Tables[0];
  505. if (dtGroup.Rows.Count > 0)
  506. {
  507. for (int i = 0; i < dtGroup.Rows.Count; i++)
  508. {
  509. if (this.listViewData_Dress.Groups[dtGroup.Rows[i]["Dsfm_DressType"].ToString().Trim()] == null)
  510. {
  511. ListViewGroup man_lvg = new ListViewGroup();
  512. man_lvg.Name = dtGroup.Rows[i]["Dsfm_DressType"].ToString().Trim();
  513. man_lvg.Header = dtGroup.Rows[i]["Sc_ClassName"].ToString().Trim();
  514. man_lvg.HeaderAlignment = HorizontalAlignment.Left;
  515. this.listViewData_Dress.Groups.Add(man_lvg);
  516. }
  517. }
  518. if (!this.listViewData_Dress.ShowGroups)
  519. { this.listViewData_Dress.ShowGroups = true; }
  520. }
  521. }
  522. }
  523. class LvItemImageModel {
  524. /// <summary>
  525. /// 内容
  526. /// </summary>
  527. public string Text { get; set; }
  528. public string ImagePath { get; set; }
  529. /// <summary>
  530. /// 是否加载图片
  531. /// </summary>
  532. public bool bImageLoad { get; set; }
  533. /// <summary>
  534. /// 加载状态
  535. /// </summary>
  536. public bool bLoadStatus { get; set; }
  537. /// <summary>
  538. /// 图片加载信息
  539. /// </summary>
  540. public string ImageMessage { get; set; }
  541. public override string ToString()
  542. {
  543. return Text;
  544. }
  545. }
  546. }