123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.Dresses
- {
- public partial class DressEnteredManagedFormMain : LYFZ.Software.UI.Dresses.DressEnteredManagedFormMain
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
-
- LYFZ.BLL.BLL_ErpDressFrom dfbll = new BLL.BLL_ErpDressFrom();
- public DressEnteredManagedFormMain()
- {
- this.Load += DressEnteredManagedFormMain_Load;
- this.Shown += DressEnteredManagedFormMain_Shown;
- this.chkUpperRack.Click += chkUpperRack_Click;
- this.chkDownRack.Click += chkDownRack_Click;
- this.btnQuery.Click += btnQuery_Click;
- this.btnAdded.Click += btnAdded_Click;
- this.btnUpdata.Click += btnUpdata_Click;
- this.btnDeleted.Click += btnDeleted_Click;
- this.btnUseRecord.Click += btnUseRecord_Click;
- this.btnExport.Click += btnExport_Click;
- this.btnClose.Click += btnClose_Click;
- this.listViewData_Dress.MouseDoubleClick += listViewData_Dress_MouseDoubleClick;
- this.Resize += DressEnteredManagedFormMain_Resize;
- this.ucPagerEx1.EventPaging += ucPagerEx1_EventPaging;
- this.listViewData_Dress.MouseClick += ListViewData_Dress_MouseClick;
-
- }
-
- private void ListViewData_Dress_MouseClick(object sender, MouseEventArgs e)
- {
- 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 &&
- this.listViewData_Dress.SelectedItems[0].Bounds.Y+ this.listViewData_Dress.SelectedItems[0].Bounds.Height > e.Location.Y)
- {
- if(this.listViewData_Dress.SelectedItems.Count>0)
- {
- LvItemImageModel model = this.listViewData_Dress.SelectedItems[0].Tag as LvItemImageModel;
- if (!model.bImageLoad)
- {
- string[] StrArray = model.ImagePath.Split('|');//dt.Rows[i]["Dsfm_DressPhotoNames"].ToString().Trim().Split('|');
- model.bImageLoad = true;
- if (!this.mlistImage.Images.Keys.Contains(model.Text))
- { //dt.Rows[i]["Dsfm_DressNumber"].ToString().Trim()
- string loadMessage = "";
- Image img = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDressImage_Small(StrArray[0].Trim(), ref loadMessage);
- model.ImageMessage = loadMessage;
- if (loadMessage != "加载成功")
- {
- model.bLoadStatus = false;
-
- //MessageBoxCustom.Show(model.ImageMessage, "提示消息", MessageBoxButtons.OK, null, false, 1);
- }
- else
- {
- model.bLoadStatus = true;
- this.mlistImage.Images.Add(model.Text, img);
- this.listViewData_Dress.SelectedItems[0].ImageKey = model.Text;
- }
-
- exToolTip1.RemoveAll();
- //tempModel = model;
- exToolTip1.SetToolTip(listViewData_Dress, model.ImageMessage);
- //timer.Enabled = true;
- }
- }
- else
- {
- exToolTip1.RemoveAll();
- //timer.Enabled = true;
- //tempModel = model;
- exToolTip1.SetToolTip(listViewData_Dress, model.ImageMessage);
- //MessageBoxCustom.Show(model.ImageMessage, "提示消息", MessageBoxButtons.OK, null, false, 1);
- }
- }
- }
- else
- {
- exToolTip1.SetToolTip(listViewData_Dress, "");
- }
-
- }
- /// <summary>
- /// 相片集合
- /// </summary>
- ImageList mlistImage = new ImageList();
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void DressEnteredManagedFormMain_Load(object sender, EventArgs e)
- {
- this.listViewData_Dress.View = View.Details;
- this.listViewData_Dress.GridLines = true;
- string[] StrColumns = "礼服编号,礼服名称,摆放区域,礼服品牌,礼服尺寸,成本价格,出租价格,出售价格,礼服状态,出租次数,送洗次数,出售状态,购买日期,录入时间,礼服备注".Split(',');
- for (int i = 0; i < StrColumns.Length; i++)
- {
- ColumnHeader ch = new ColumnHeader();
- ch.Text = StrColumns[i].Trim();
- ch.TextAlign = HorizontalAlignment.Left;
- switch (StrColumns[i].Trim())
- {
- case "礼服编号":
- ch.Width = 150;
- break;
- case "礼服名称":
- ch.Width = 150;
- break;
- case "摆放区域":
- ch.Width = 120;
- break;
- case "礼服品牌":
- ch.Width = 120;
- break;
- case "礼服尺寸":
- ch.Width = 100;
- break;
- case "成本价格":
- ch.Width = 90;
- break;
- case "出租价格":
- ch.Width = 90;
- break;
- case "出售价格":
- ch.Width = 90;
- break;
- case "礼服状态":
- ch.Width = 120;
- break;
- case "出租次数":
- ch.Width = 80;
- break;
- case "送洗次数":
- ch.Width = 80;
- break;
- case "出售状态":
- ch.Width = 80;
- break;
- case "购买日期":
- ch.Width = 90;
- break;
- case "录入时间":
- ch.Width = 110;
- break;
- case "礼服备注":
- ch.Width = 300;
- break;
- }
- switch (StrColumns[i].Trim())
- {
- case "成本价格":
- case "出租价格":
- case "出售价格":
- ch.TextAlign = HorizontalAlignment.Right;
- break;
- case "礼服编号":
- case "礼服名称":
- case "摆放区域":
- case "礼服品牌":
- case "礼服尺寸":
- case "礼服备注":
- ch.TextAlign = HorizontalAlignment.Left;
- break;
- default:
- ch.TextAlign = HorizontalAlignment.Center;
- break;
- }
- this.listViewData_Dress.Columns.Add(ch);
- }
- this.mlistImage.ImageSize = new Size(60, 50);
- this.mlistImage.ColorDepth = ColorDepth.Depth32Bit;
- this.listViewData_Dress.SmallImageList = mlistImage;
- this.btnDeleted.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.DressEntry, CustomAttributes.OperatingAuthority.Delete);
- this.btnExport.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.DressEntry, CustomAttributes.OperatingAuthority.DataExport);
- this.btnUseRecord.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.DressView, CustomAttributes.OperatingAuthority.SeeView);
- }
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void DressEnteredManagedFormMain_Shown(object sender, EventArgs e)
- {
- bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(VersionControl.VersionFunctionEnum.礼服管理);
- if (!b)
- {
- this.Close();
- return;
- }
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BEAJBGADDCBAHFFA", this.cmbtreevCategory, IsFirstNodeNull: true, IsFirstNodeName: "全部");
- this.cmbtreevCategory.TextFindTag("全部");
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 上架
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkUpperRack_Click(object sender, EventArgs e)
- {
- this.chkDownRack.Checked = false;
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 下架
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkDownRack_Click(object sender, EventArgs e)
- {
- this.chkUpperRack.Checked = false;
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnQuery_Click(object sender, EventArgs e)
- {
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 添加
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnAdded_Click(object sender, EventArgs e)
- {
- #if DEBUG
- LYFZ.Software.MainBusiness.NewDressSystem.frmAddDress addDress = new NewDressSystem.frmAddDress();
- addDress.ShowDialog();
- #else
- LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressEnteredAddedSmallForm frm = new SetSmallForm.DressEnteredAddedSmallForm();
- frm.ShowDialog();
- if (frm.IsSaveed)
- { this.PublicFunctionRows(); }
- #endif
- }
- /// <summary>
- /// 修改
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnUpdata_Click(object sender, EventArgs e)
- {
- if (this.listViewData_Dress.Items.Count > 0 && this.listViewData_Dress.SelectedItems.Count > 0)
- {
- LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressEnteredUpdateSmallForm frm = new SetSmallForm.DressEnteredUpdateSmallForm();
- frm.StrDressNumber = this.listViewData_Dress.SelectedItems[0].Tag.ToString().Trim();
- frm.ShowDialog();
- if (frm.IsSaveed)
- { this.PublicFunctionRows(); }
- }
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnDeleted_Click(object sender, EventArgs e)
- {
- if (this.listViewData_Dress.Items.Count > 0 && this.listViewData_Dress.SelectedItems.Count > 0)
- {
- string StrDressName = this.listViewData_Dress.SelectedItems[0].SubItems["礼服名称"].Text.Trim();
- string StrDressCustomNumber = this.listViewData_Dress.SelectedItems[0].Text.ToString().Trim();
- string StrDressNumber = this.listViewData_Dress.SelectedItems[0].Tag.ToString().Trim();
- string StrDressDeletePhotoName = "";
- if (MessageBoxCustom.Show("您选中的礼服名称:" + StrDressName + "\r\n礼服编号" + StrDressCustomNumber + "\r\n您确定要删除吗?", "", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
- DataTable dt = orbll.GetView_Custom("tb_ErpDressFrom", StrWhere: "Dsfm_DressNumber = '" + StrDressNumber + "'", ShowColumnName: "ID,Dsfm_DressPhotoNames").Tables[0];
- if (dt.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(dt.Rows[0]["Dsfm_DressPhotoNames"].ToString().Trim()))
- {
- string[] StrArrayPhotoNames = dt.Rows[0]["Dsfm_DressPhotoNames"].ToString().Trim().Split('|');
- for (int i = 0; i < StrArrayPhotoNames.Length; i++)
- {
- if (!string.IsNullOrEmpty(StrArrayPhotoNames[i].Trim()))
- {
- DataTable tbl = orbll.GetView_Custom("tb_ErpDressFrom", StrWhere: "Dsfm_DressNumber != '" + StrDressNumber + "' And Dsfm_DressPhotoNames like '%" + StrArrayPhotoNames[i].Trim() + "%'", ShowColumnName: "ID").Tables[0];
- if (tbl.Rows.Count <= 0)
- {
- //backgroundWorker.ReportProgress(0, "正在删除" + StrArrayPhotoNames[1].Trim() + "...");
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.DeleteDressPhoto(StrArrayPhotoNames[i].Trim() + ".jpg", IsRecursion: true, DeleteDressType: 0);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.DeleteDressPhoto(StrArrayPhotoNames[i].Trim() + ".jpg", IsRecursion: true, DeleteDressType: 1);
- StrDressDeletePhotoName += StrArrayPhotoNames[i].Trim() + ",";
- }
- }
- }
- }
- }
- clist.Add(dfbll.GetDeleteCommandInfo("ID", "=", dt.Rows[0]["ID"].ToString().Trim()));
- string StrContent = "删除礼服名称:" + StrDressName + ";礼服编号:" + StrDressNumber + ";礼服自定义编号:" + StrDressCustomNumber;
- if (!string.IsNullOrEmpty(StrDressDeletePhotoName))
- { StrContent += ";删除的相片有:" + StrDressDeletePhotoName.TrimEnd(','); }
- clist.Add(new BLL.BLL_ErpACVBSYS().GetAddCommandInfo(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetModelLog(LYFZ.EnumPublic.SystemLogsType.删除礼服.ToString(), StrContent, StrContent, SDateTime.Now)));
- if (clist.Count > 0)
- {
- if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
- { MessageBoxCustom.Show("删除成功!"); this.listViewData_Dress.Items.Remove(this.listViewData_Dress.SelectedItems[0]); }
- else
- { MessageBoxCustom.Show("删除失败!"); }
- }
- }
- }
- /// <summary>
- /// 使用记录
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnUseRecord_Click(object sender, EventArgs e)
- {
- if (this.listViewData_Dress.Items.Count > 0 && this.listViewData_Dress.SelectedItems.Count > 0)
- {
- LYFZ.Software.MainBusiness.Dresses.SetSmallForm.DressUseRecordSmallForm frm = new SetSmallForm.DressUseRecordSmallForm();
- frm.StrDressNumber = this.listViewData_Dress.SelectedItems[0].Tag.ToString().Trim();
- frm.Show();
- }
- }
- /// <summary>
- /// 导出
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnExport_Click(object sender, EventArgs e)
- {
- this.listViewData_Dress.ListViewToDataTable(StrFileName: "礼服详情");
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- /// <summary>
- /// 列表双击修改礼服信息
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void listViewData_Dress_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- this.btnUpdata_Click(this, null);
- }
- /// <summary>
- /// 窗体大小发生变化
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void DressEnteredManagedFormMain_Resize(object sender, EventArgs e)
- {
- switch (this.panelExport.Location.Y)
- {
- case 0: this.flowLayoutPanel1.Height = 32; break;
- case 32: this.flowLayoutPanel1.Height = 64; break;
- }
- }
- /// <summary>
- /// 创建行
- /// </summary>
- private void PublicFunctionRows()
- {
- this.CreateListViewGroup();
- this.ucPagerEx1.PageCurrent = 1;
- this.ucPagerEx1.PageSize = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPageSize();//3;分页条数
- this.ucPagerEx1.Bind();
- }
- /// <summary>
- /// 画分页
- /// </summary>
- /// <param name="e"></param>
- /// <returns></returns>
- private int ucPagerEx1_EventPaging(UCPager.EventPagingArg e)
- {
- this.listViewData_Dress.Items.Clear();
- string StrWhere = "";
- if (this.chkUpperRack.Checked)
- { StrWhere += "And Dsfm_IsEnabled = '1' "; }
- else if (this.chkDownRack.Checked)
- { StrWhere += "And Dsfm_IsEnabled = '0' "; }
- if (!string.IsNullOrEmpty(this.txtKeyWord.Text.Trim()))
- { StrWhere += "And (Dsfm_DressCustomNumber like '%" + this.txtKeyWord.Text.Trim() + "%' or Dsfm_DressName like '%" + this.txtKeyWord.Text.Trim() + "%') "; }
- if (!string.IsNullOrEmpty(this.cmbtreevCategory.Text.Trim()) && this.cmbtreevCategory.Text.Trim() != "全部")
- { StrWhere += "And Dsfm_DressTypeCode = '" + this.cmbtreevCategory.Tag.ToString().Trim() + "' "; }
- LYFZ.UCPager.PageData pageData = new LYFZ.UCPager.PageData();
- pageData.TableName = "BView_DressManaged";
- pageData.PageIndex = this.ucPagerEx1.PageCurrent;
- pageData.PageSize = this.ucPagerEx1.PageSize;
- pageData.QueryCondition = StrWhere.TrimStart('A', 'n', 'd');
- pageData.OrderStr = "Dsfm_CreateDateTime";
- pageData.OrderType = 1;
- 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";
- DataTable dt = new DataTable();
- this.listViewData_Dress.BeginUpdate();
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- dt = pageData.QueryDataTable().Tables[0];
- try
- {
- this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
- {
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- string[] StrArray = "".Split('|');//dt.Rows[i]["Dsfm_DressPhotoNames"].ToString().Trim().Split('|');
- if (!this.mlistImage.Images.Keys.Contains(""))
- { //dt.Rows[i]["Dsfm_DressNumber"].ToString().Trim()
- Image img = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDressImage_Small(StrArray[0].Trim());
- this.mlistImage.Images.Add("defalut", img);
- }
- ListViewItem lvItem = new ListViewItem();
- lvItem.Tag = new LvItemImageModel()
- {
- Text = dt.Rows[i]["Dsfm_DressNumber"].ToString().Trim(),
- bImageLoad = false,
- bLoadStatus = false,
- ImagePath = dt.Rows[i]["Dsfm_DressPhotoNames"].ToString().Trim(),
- ImageMessage = ""
- } ;
- lvItem.ImageKey = "defalut";
- lvItem.Text = dt.Rows[i]["Dsfm_DressCustomNumber"].ToString().Trim();
- ListViewItem.ListViewSubItem ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "礼服名称";
- ListSubItem.Text = dt.Rows[i]["Dsfm_DressName"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "摆放区域";
- ListSubItem.Text = dt.Rows[i]["Dsfm_PlacedRegion"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "礼服品牌";
- ListSubItem.Text = dt.Rows[i]["Dsfm_DressBrand"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "礼服尺寸";
- ListSubItem.Text = dt.Rows[i]["Dsfm_DressSize"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "成本价格";
- ListSubItem.Text = dt.Rows[i]["Dsfm_CostPrice"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "出租价格";
- ListSubItem.Text = dt.Rows[i]["Dsfm_RentPrice"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "出售价格";
- ListSubItem.Text = dt.Rows[i]["Dsfm_SalePrice"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "礼服状态";
- ListSubItem.Text = dt.Rows[i]["Dsfm_IsEnabled"].ToString().Trim() == "0" ? "下架" : "上架";
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "出租次数";
- ListSubItem.Text = dt.Rows[i]["Dsfm_RentCount"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "送洗次数";
- ListSubItem.Text = dt.Rows[i]["Dsfm_SendWashCount"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "出售状态";
- ListSubItem.Text = Convert.ToInt32(dt.Rows[i]["Dsfm_SaleStatus"]) == 0 ? "" : "已售";
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "购买日期";
- ListSubItem.Text = LYFZ.Command.Command_Validate.DateTimeToString(dt.Rows[i]["Dsfm_DressBuyDate"]);
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "录入时间";
- ListSubItem.Text = LYFZ.Command.Command_Validate.DateTimeToString(dt.Rows[i]["Dsfm_CreateDateTime"], "yyyy-MM-dd HH:mm");
- lvItem.SubItems.Add(ListSubItem);
- ListSubItem = new ListViewItem.ListViewSubItem();
- ListSubItem.Name = "礼服备注";
- ListSubItem.Text = dt.Rows[i]["Dsfm_DressRemark"].ToString().Trim();
- lvItem.SubItems.Add(ListSubItem);
- if (this.listViewData_Dress.Groups.Count > 0)
- { this.listViewData_Dress.Groups[dt.Rows[i]["Dsfm_DressTypeCode"].ToString().Trim()].Items.Add(lvItem); }
- this.listViewData_Dress.Items.Add(lvItem);
- }
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ListViewDrawSingleOrDoubleRows(this.listViewData_Dress);
- }));
- }
- catch
- { }
- });
- this.listViewData_Dress.EndUpdate();
- try
- {
- this.ucPagerEx1.TbDataSource = dt;
- }
- catch { }
- return pageData.TotalCount;
- }
- /// <summary>
- /// 创建默认分组
- /// </summary>
- void CreateListViewGroup()
- {
- 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];
- if (dtGroup.Rows.Count > 0)
- {
- for (int i = 0; i < dtGroup.Rows.Count; i++)
- {
- if (this.listViewData_Dress.Groups[dtGroup.Rows[i]["Dsfm_DressType"].ToString().Trim()] == null)
- {
- ListViewGroup man_lvg = new ListViewGroup();
- man_lvg.Name = dtGroup.Rows[i]["Dsfm_DressType"].ToString().Trim();
- man_lvg.Header = dtGroup.Rows[i]["Sc_ClassName"].ToString().Trim();
- man_lvg.HeaderAlignment = HorizontalAlignment.Left;
- this.listViewData_Dress.Groups.Add(man_lvg);
- }
- }
- if (!this.listViewData_Dress.ShowGroups)
- { this.listViewData_Dress.ShowGroups = true; }
- }
- }
-
- }
- class LvItemImageModel {
- /// <summary>
- /// 内容
- /// </summary>
- public string Text { get; set; }
- public string ImagePath { get; set; }
- /// <summary>
- /// 是否加载图片
- /// </summary>
- public bool bImageLoad { get; set; }
- /// <summary>
- /// 加载状态
- /// </summary>
- public bool bLoadStatus { get; set; }
- /// <summary>
- /// 图片加载信息
- /// </summary>
- public string ImageMessage { get; set; }
- public override string ToString()
- {
- return Text;
- }
- }
- }
|