123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- 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.CameraControlBook.SuperSmallForm
- {
- public partial class SelectDressSuperSmallForm : LYFZ.Software.UI.CameraControlBook.SuperSmallForm.SelectDressSuperSmallForm
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- public SelectDressSuperSmallForm()
- {
- this.Shown += SelectDressSuperSmallForm_Shown;
- this.btnQuery.Click += btnQuery_Click;
- this.txtQuery.KeyDown += txtQuery_KeyDown;
- this.cmbtreevCategory.ComboBoxTree_NodeMouseClick += cmbtreevCategory_ComboBoxTree_NodeMouseClick;
- this.btnSaveed.Click += btnSaveed_Click;
- this.btnCancel.Click += btnCancel_Click;
- this.dgvData.CellMouseDoubleClick += dgvData_CellMouseDoubleClick;
- this.dgvData2.CellMouseDoubleClick += dgvData2_CellMouseDoubleClick;
- }
- public bool IsSaveed = false;
- public string StrValue;
-
-
-
-
-
- void SelectDressSuperSmallForm_Shown(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BEAJBGADDCBAHFFA", this.cmbtreevCategory, IsFirstNodeNull: true);
- this.dgvData.DataColumns("礼服编号,礼服类别,礼服名称,礼服品牌,礼服尺寸,摆放区域,礼服说明");
- this.dgvData2.DataColumns("礼服编号,礼服名称");
- this.PublicFunctionRows();
- this.PublicFunctionRows2();
- }
-
-
-
-
-
- void btnQuery_Click(object sender, EventArgs e)
- {
- this.PublicFunctionRows();
- }
-
-
-
-
-
- void txtQuery_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- { this.PublicFunctionRows(); }
- }
-
-
-
-
-
- void cmbtreevCategory_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
- {
- this.PublicFunctionRows();
- }
-
-
-
-
-
- void btnSaveed_Click(object sender, EventArgs e)
- {
- string strDataRows = "";
- for (int i = 0; i < this.dgvData2.Rows.Count; i++)
- { strDataRows += this.dgvData2.Rows[i].Cells["礼服编号"].Value.ToString().Trim() + ","; }
- this.StrValue = strDataRows.TrimEnd(',');
- this.IsSaveed = true;
- this.Close();
- }
-
-
-
-
-
- void dgvData_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
- {
- if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
- {
- if (this.dgvData.Rows.Count > 0)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewTextBoxCell();
- cell.Value = this.dgvData.Rows[e.RowIndex].Cells["礼服编号"].Value.ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = this.dgvData.Rows[e.RowIndex].Cells["礼服名称"].Value.ToString().Trim();
- dgvr.Cells.Add(cell);
- this.dgvData2.Rows.Add(dgvr);
- }
- }
- }
-
-
-
-
-
- void dgvData2_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
- {
- if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
- {
- if (this.dgvData.Rows.Count > 0)
- {
- this.dgvData2.Rows.RemoveAt(e.RowIndex);
- }
- }
- }
-
-
-
-
-
- void btnCancel_Click(object sender, EventArgs e)
- {
- this.Close();
- }
-
-
-
- private void PublicFunctionRows()
- {
- this.dgvData.Rows.Clear();
- string strWhere = "";
- if (!string.IsNullOrEmpty(this.txtQuery.Text.Trim()))
- { strWhere += " And (Dsfm_DressNumber like '%" + this.txtQuery.Text.Trim() + "%' Or Dsfm_DressName like '%" + this.txtQuery.Text.Trim() + "%')"; }
- if (!string.IsNullOrEmpty(this.cmbtreevCategory.Text.Trim()))
- { strWhere += " And Dsfm_DressType = '" + this.cmbtreevCategory.Tag.ToString().Trim() + "'"; }
- DataTable tbl = orbll.GetView_Custom("tb_ErpDressFrom left Join tb_ErpSystemCategory AS SystemDressType on Dsfm_DressType = SystemDressType.Sc_ClassCode left Join tb_ErpSystemCategory AS SystemPlacedRegion on Dsfm_PlacedRegion = SystemPlacedRegion.Sc_ClassCode", StrWhere: "Dsfm_IsEnabled = '1'" + strWhere, ShowColumnName: "Dsfm_DressNumber AS 礼服编号,SystemDressType.Sc_ClassName AS 礼服类别,Dsfm_DressName AS 礼服名称,Dsfm_DressBrand AS 礼服品牌,Dsfm_DressSize AS 礼服尺寸,SystemPlacedRegion.Sc_ClassName AS 摆放区域,Dsfm_DressRemark AS 礼服说明,Dsfm_PicturePath").Tables[0];
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["礼服编号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["礼服类别"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["礼服名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["礼服品牌"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["礼服尺寸"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["摆放区域"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["礼服说明"].ToString().Trim();
- dgvr.Cells.Add(cell);
- this.dgvData.Rows.Add(dgvr);
- }
- this.dgvData.Columns["礼服编号"].Frozen = true;
- }
-
-
-
- private void PublicFunctionRows2()
- {
- if (!string.IsNullOrEmpty(this.StrValue))
- {
- string StrWhere = this.StrValue.Replace(",", "','");
- StrWhere = " Dsfm_DressNumber in ('" + StrWhere + "') ";
- DataTable tbl = orbll.GetView_Custom("tb_ErpDressFrom", StrWhere: StrWhere, ShowColumnName: "Dsfm_DressNumber AS 礼服编号,Dsfm_DressName AS 礼服名称").Tables[0];
- tbl.PrimaryKey = new DataColumn[] { tbl.Columns["礼服编号"] };
- string[] strArray = StrValue.Trim().Split(',');
- for (int i = 0; i < strArray.Length; i++)
- {
- DataRow dtRow = tbl.Rows.Find(strArray[i].Trim());
- if (dtRow != null)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewTextBoxCell();
- cell.Value = dtRow["礼服编号"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dtRow["礼服名称"].ToString().Trim();
- dgvr.Cells.Add(cell);
- this.dgvData2.Rows.Add(dgvr);
- }
- }
- }
- }
- }
- }
|