/// <summary> /// 刷新订单信息DataGridView /// </summary> /// <param name="findStore"></param> void RefreshOrderFormDataGridView() { string strSql = "select * from View_B_OrderFormInfo order by 订货日期 desc, 订单号 desc "; DataTable dataSource = GlobalObject.DatabaseServer.QueryInfo(strSql); dataGridView1.DataSource = dataSource; // 添加数据定位控件 if (m_orderFormLocalizer == null) { m_orderFormLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); groupBoxOrderFormInfo.Controls.Add(m_orderFormLocalizer); m_orderFormLocalizer.Dock = DockStyle.Bottom; m_orderFormLocalizer.Visible = true; } this.dataGridView1.ColumnWidthChanged -= new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); ColumnWidthControl.SetDataGridView(labelTitle.Text, dataGridView1); this.dataGridView1.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); dataGridView1.Columns["权限控制用登录名"].Visible = false; dataGridView1.Refresh(); }
/// <summary> /// 窗体载入 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FormChoseConfectAccessorySpecCode_Load(object sender, EventArgs e) { if (!m_choseConfectServer.GetAllChoseConfectTableHead(out m_findTable, out m_err)) { MessageDialog.ShowErrorMessage(m_err); return; } RefreshDataGridView(m_findTable); for (int i = 2; i < dataGridView1.Columns.Count; i++) { dataGridView1.Columns[i].Visible = false; } ColumnWidthControl.SetDataGridView(this.Text, dataGridView1); // 添加数据定位控件 if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer( dataGridView1, this.Name, UniversalFunction.SelectHideFields( this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelTop.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; m_dataLocalizer.Visible = true; } }
/// <summary> /// 刷新DataGridView /// </summary> /// <param name="findBill">数据集</param> void RefreshDataGridView(IQueryResult findBill) { ClearForm(); dataGridView1.DataSource = GetDataSource(findBill); if (dataGridView1.DataSource == null) { return; } this.dataGridView1.ColumnWidthChanged -= new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); ColumnWidthControl.SetDataGridView(labelTitle.Text, dataGridView1); this.dataGridView1.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); #region 隐藏不允许查看的列 for (int i = 0; i < dataGridView1.Columns.Count; i++) { if (findBill.HideFields.Contains(dataGridView1.Columns[i].Name)) { dataGridView1.Columns[i].Visible = false; } } #endregion dataGridView1.Columns["申请人编码"].Visible = false; dataGridView1.Columns["申请部门编码"].Visible = false; dataGridView1.Columns["知会检验名编码"].Visible = false; // 添加查询用的列 if (m_findField == null) { List <string> lstColumnName = new List <string>(); for (int i = 0; i < dataGridView1.Columns.Count; i++) { if (dataGridView1.Columns[i].Visible) { lstColumnName.Add(dataGridView1.Columns[i].Name); } } m_findField = lstColumnName.ToArray(); } if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelPara.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; } dataGridView1.Refresh(); }
/// <summary> /// 构造函数 /// </summary> /// <param name="operateMode">操作模式</param> /// <param name="billNo">普通入库单号</param> public 普通入库物品清单(CE_BusinessOperateMode operateMode, string billNo) { InitializeComponent(); SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true); UpdateStyles(); m_operateMode = operateMode; m_billNo = billNo; m_billInfo = ServerModuleFactory.GetServerModule <IOrdinaryInDepotBillServer>().GetBill(billNo); if (m_operateMode == CE_BusinessOperateMode.仓库核实) { btnAdd.Enabled = false; btnDelete.Enabled = false; btnDeleteAll.Enabled = false; } else { txtShelf.ReadOnly = true; txtColumn.ReadOnly = true; txtLayer.ReadOnly = true; if (m_operateMode == CE_BusinessOperateMode.查看) { toolStrip1.Visible = false; } } m_queryResult = m_goodsServer.GetGoodsViewInfo(m_billNo); RefreshDataGridView(m_queryResult); StapleInfo.InitUnitComboBox(cmbUnit); // 添加数据定位控件 m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelTop.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; if (BasicInfo.ListRoles.Contains(CE_RoleEnum.采购账务管理员.ToString()) || BasicInfo.ListRoles.Contains(CE_RoleEnum.会计.ToString())) { label19.Visible = true; label20.Visible = true; numUnitPrice.Visible = true; numPrice.Visible = true; } else { label19.Visible = false; label20.Visible = false; numUnitPrice.Visible = false; numPrice.Visible = false; } }
/// <summary> /// 刷新 /// </summary> /// <param name="source">数据集</param> void RefreshDataGirdView(DataTable source) { m_drSQE = source.NewRow(); dataGridView1.DataSource = source; if (m_findField == null) { List <string> lstColumnName = new List <string>(); for (int i = 0; i < dataGridView1.Columns.Count; i++) { if (dataGridView1.Columns[i].Visible) { lstColumnName.Add(dataGridView1.Columns[i].Name); } } m_findField = lstColumnName.ToArray(); } if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelPara.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; } }
/// <summary> /// 刷新DataGridView /// </summary> /// <param name="findAccessoryInfo">数据集合</param> void RefreshDataGridView(IQueryable findAccessoryInfo) { dataGridView1.DataSource = findAccessoryInfo; // 添加数据定位控件 if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); m_dataLocalizer.OnlyLocalize = true; panelPara.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; m_dataLocalizer.Visible = true; } this.dataGridView1.ColumnWidthChanged -= new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); ColumnWidthControl.SetDataGridView(labelTitle.Text, dataGridView1); this.dataGridView1.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); dataGridView1.Refresh(); }
/// <summary> /// 窗体载入 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FormGoods_Load(object sender, EventArgs e) { if (!m_storeServer.GetAllStore(null, true, out m_findStore, out m_err)) { MessageDialog.ShowErrorMessage(m_err); return; } RefreshDataGridView(m_findStore); for (int i = 0; i < dataGridView1.Columns.Count; i++) { dataGridView1.Columns[i].Visible = false; } dataGridView1.Columns[1].Visible = true; dataGridView1.Columns[2].Visible = true; dataGridView1.Columns[3].Visible = true; dataGridView1.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; ColumnWidthControl.SetDataGridView(this.Text, dataGridView1); // 添加数据定位控件 if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer( dataGridView1, this.Name, UniversalFunction.SelectHideFields( this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelTop.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; m_dataLocalizer.Visible = true; } }
public FormHomemadeRejectlist(OperateMode operateMode, string vProvider, string billNo) { InitializeComponent(); SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true); UpdateStyles(); m_operateMode = operateMode; m_strProvider = vProvider; m_strBillID = billNo; if (m_operateMode == OperateMode.查看) { toolStrip1.Visible = false; } m_queryGoodsInfo = m_goodsServer.GetBillView(m_strBillID); RefreshDataGridView(m_queryGoodsInfo); // 添加数据定位控件 m_dataLocalizer = new UserControlDataLocalizer( dataGridView1, this.Name, UniversalFunction.SelectHideFields( this.Name, dataGridView1.Name, BasicInfo.LoginID)); txtProvider.Text = m_strProvider; panelTop.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; m_strStorage = m_serverStorageInfo.GetStorageID(billNo, "S_HomemadeRejectBill", "Bill_ID"); }
/// <summary> /// 刷新 /// </summary> void RefreshDataGirdView() { DataTable dt = new DataTable(); if (BasicInfo.ListRoles.Contains(CE_RoleEnum.采购员.ToString()) && !BasicInfo.ListRoles.Contains(CE_RoleEnum.采购主管.ToString()) && !BasicInfo.ListRoles.Contains(CE_RoleEnum.采购账务管理员.ToString())) { dt = m_orderFormAffrim.GetListInfo(m_strNy, BasicInfo.LoginName); } else { dt = m_orderFormAffrim.GetListInfo(m_strNy); } dgvOrderFormList.DataSource = dt; dgvOrderFormList.Columns["序号"].Visible = false; dgvOrderFormList.Columns["单据号"].Visible = false; dgvOrderFormList.Columns["物品ID"].Visible = false; if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dgvOrderFormList, this.Name, UniversalFunction.SelectHideFields(this.Name, dgvOrderFormList.Name, BasicInfo.LoginID)); m_dataLocalizer.OnlyLocalize = true; panelPara.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; } }
public FormSeeInsulate(AuthorityFlag m_authFlag) { InitializeComponent(); FaceAuthoritySetting.SetEnable(this.Controls, m_authFlag); FaceAuthoritySetting.SetVisibly(this.toolStrip1, m_authFlag); DataBind(); if (BasicInfo.ListRoles.Contains(CE_RoleEnum.成品仓库管理员.ToString()) || BasicInfo.ListRoles.Contains(CE_RoleEnum.售后库房管理员.ToString())) { dataGridView1.Columns["选"].Visible = true; dataGridView1.Columns["选"].ReadOnly = false; } if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer( dataGridView1, this.Name, UniversalFunction.SelectHideFields( this.Name, dataGridView1.Name, BasicInfo.LoginID)); m_dataLocalizer.OnlyLocalize = true; panel1.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; } toolStrip1.Visible = true; }
/// <summary> /// 刷新数据显示控件 /// </summary> /// <param name="dt">数据源</param> private void RefreshDataGridView(DataTable dt) { dataGridView1.DataSource = dt; dataGridView1.Refresh(); if (dataGridView1.Rows.Count > 0) { dataGridView1.Columns[6].Visible = false; } // 添加数据定位控件 if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelTop.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; m_dataLocalizer.Visible = true; this.dataGridView1.ColumnWidthChanged -= new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); ColumnWidthControl.SetDataGridView(labelTitle.Text, dataGridView1); this.dataGridView1.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); } }
/// <summary> /// 构造函数 /// </summary> /// <param name="operateMode">操作模式</param> /// <param name="billNo">领料退库单号</param> public FormMaterialListReturnedInTheDepot(CE_BusinessOperateMode operateMode, string billNo) { InitializeComponent(); S_MaterialReturnedInTheDepot tempBill = m_serverBill.GetBill(billNo); m_lnqWSCode = tempBill == null? m_serverWSBasic.GetPersonnelWorkShop(BasicInfo.LoginID) : m_serverWSBasic.GetPersonnelWorkShop(tempBill.FillInPersonnelCode); SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true); UpdateStyles(); m_operateMode = operateMode; m_billNo = billNo; if (m_operateMode == CE_BusinessOperateMode.查看) { toolStrip1.Visible = false; } else if (m_operateMode == CE_BusinessOperateMode.仓库核实) { btnAdd.Enabled = false; btnDelete.Enabled = false; btnDeleteAll.Enabled = false; txtShelf.ReadOnly = false; txtColumn.ReadOnly = false; txtLayer.ReadOnly = false; } m_queryGoodsInfo = m_goodsServer.GetGoods(m_billNo); RefreshDataGridView(m_queryGoodsInfo); // 添加数据定位控件 m_dataLocalizer = new UserControlDataLocalizer( dataGridView1, this.Name, UniversalFunction.SelectHideFields( this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelTop.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; m_strStorage = m_serverStorageInfo.GetStorageID(billNo, "S_MaterialReturnedInTheDepot", "Bill_ID"); if (m_strStorage == "05") { label11.Visible = true; cmbProductStatus.Visible = true; } if (!Convert.ToBoolean(BasicInfo.BaseSwitchInfo[(int)GlobalObject.CE_SwitchName.开启车间管理模块]) || m_strStorage == "11") { btnProvider.Visible = false; btnBatchNo.Visible = false; } }
/// <summary> /// 绑定datagridview /// </summary> /// <param name="dtbinding">绑定的数据源</param> void BindingDataGridView(DataGridView dgv, UserControlDataLocalizer ud, DataTable dtBinding) { if (dgv == null || ud == null || dtBinding == null) { return; } dgv.DataSource = dtBinding; ud.Init(dgv, this.Name, UniversalFunction.SelectHideFields(this.Name, dgv.Name, BasicInfo.LoginID)); }
/// <summary> /// 刷新DataGridView /// </summary> /// <param name="findStore">数据集</param> void RefreshDataGridView(IQueryable findStore) { DataTable dt = GlobalObject.GeneralFunction.ConvertToDataTable(findStore); DataTable dataSource = dt.Clone(); for (int i = 0; i < m_depotForPersonnel.Count; i++) { DataRow[] dr = dt.Select("仓库 = '" + m_depotForPersonnel[i].类型ID + "'"); if (dr.Length > 0) { for (int a = 0; a <= dr.Length - 1; a++) { dataSource.ImportRow(dr[a]); } } } dataGridView1.DataSource = dataSource; this.dataGridView1.ColumnWidthChanged -= new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); ColumnWidthControl.SetDataGridView(labelTitle.Text, dataGridView1); this.dataGridView1.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); dataGridView1.Columns["序号"].Visible = false; dataGridView1.Columns["物品ID"].Visible = false; dataGridView1.Columns["单位ID"].Visible = false; if (dataGridView1.Rows.Count > 0) { panelTop.Visible = true; if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer( dataGridView1, this.Name, UniversalFunction.SelectHideFields( this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelTop.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; } } else { panelTop.Visible = false; } dataGridView1.Refresh(); }
/// <summary> /// 刷新 /// </summary> /// <param name="source">数据集</param> void RefreshDataGirdView(DataTable source) { dataGridView1.DataSource = source; if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelPara.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; } }
/// <summary> /// 刷新DataGridView /// </summary> /// <param name="findBill">数据集</param> void RefreshDataGridView(IQueryResult findBill) { ClearForm(); if (findBill.DataCollection == null || findBill.DataCollection.Tables.Count == 0) { return; } dataGridView1.DataSource = findBill.DataCollection.Tables[0]; #region 隐藏不允许查看的列 if (findBill.HideFields != null && findBill.HideFields.Length > 0) { for (int i = 0; i < dataGridView1.Columns.Count; i++) { if (findBill.HideFields.Contains(dataGridView1.Columns[i].Name)) { dataGridView1.Columns[i].Visible = false; } } } #endregion // 添加查询用的列 if (m_findField == null) { List <string> lstColumnName = new List <string>(); for (int i = 0; i < dataGridView1.Columns.Count; i++) { if (dataGridView1.Columns[i].Visible) { lstColumnName.Add(dataGridView1.Columns[i].Name); } } m_findField = lstColumnName.ToArray(); } if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelPara.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; } dataGridView1.Refresh(); }
/// <summary> /// 刷新 /// </summary> /// <param name="source">数据集</param> void DataBindGirdView() { m_serverFeedBack.QueryResultFilter = QueryFilterControl.GetFilterString(labelTitle.Text) + checkBillDateAndStatus1.GetSqlString("反馈日期", "单据状态"); IQueryResult result; if (!m_serverFeedBack.GetAllBillFeedBack(out result, out error)) { MessageDialog.ShowErrorMessage(error); return; } dataGridView1.DataSource = result.DataCollection.Tables[0]; if (dataGridView1.Rows.Count > 0) { dataGridView1.Columns["反馈人编号"].Visible = false; dataGridView1.Columns["责任人编号"].Visible = false; dataGridView1.Columns["营销售后审核人编号"].Visible = false; dataGridView1.Columns["质管意见提出人编号"].Visible = false; dataGridView1.Columns["责任部门主管编号"].Visible = false; dataGridView1.Columns["部门编码"].Visible = false; dataGridView1.Columns["质管检查人编号"].Visible = false; } if (m_findField == null) { List <string> lstColumnName = new List <string>(); for (int i = 0; i < dataGridView1.Columns.Count; i++) { if (dataGridView1.Columns[i].Visible) { lstColumnName.Add(dataGridView1.Columns[i].Name); } } m_findField = lstColumnName.ToArray(); } if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelPara.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; } }
/// <summary> /// 刷新DataGirdView /// </summary> private void RefreshDataGridView() { DataTable dt = m_safeStockServer.GetAllInfo(); dataGridView1.DataSource = dt; if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); m_dataLocalizer.OnlyLocalize = true; panelPara.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; } }
public 成品档案查询(string strProductCode) { InitializeComponent(); dataGridView1.DataSource = m_serverElectronFile.GetProductElectronFile(strProductCode); if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); m_dataLocalizer.OnlyLocalize = true; panel1.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; } }
public 仓库_直接入库(FunctionTreeNodeInfo nodeInfo) { InitializeComponent(); m_authorityFlag = nodeInfo.Authority; StapleInfo.InitUnitComboBox(cmbUnit); StapleInfo.InitStoreStateComboBox(cmbGoodsStatus); DisableControl(); if ((m_authorityFlag & AuthorityFlag.Edit) == AuthorityFlag.Nothing) { numFactUnitPrice.Visible = false; numFactPrice.Visible = false; lblFactPrice.Visible = false; lblFactUnitPrice.Visible = false; } else { numFactUnitPrice.Visible = true; numFactPrice.Visible = true; lblFactPrice.Visible = true; lblFactUnitPrice.Visible = true; } QueryStock(); // 添加数据定位控件 m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelPara.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; txtColumn.Enabled = true; txtLayer.Enabled = true; txtShelf.Enabled = true; txtRemark.Enabled = true; DataTable dt = UniversalFunction.GetStorageTb(); for (int i = 0; i < dt.Rows.Count; i++) { cmbStorage.Items.Add(dt.Rows[i]["StorageName"].ToString()); } cmbStorage.SelectedIndex = -1; }
private void ShowDate(DateTime dtStart, DateTime dtEnd) { try { DataTable dt = new DataTable(); IQueryable <View_S_PrintBill> printInfo = m_printManagement.GetPrintInfo(dtStart, dtEnd, cmbDept.Text); if (printInfo.Count() > 0) { dataGridView1.DataSource = GlobalObject.GeneralFunction.ConvertToDataTable <View_S_PrintBill>(printInfo); } else { dataGridView1.DataSource = null; } if (dataGridView1.Rows.Count > 0) { if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelTop.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; } panelTop.Visible = true; this.dataGridView1.ColumnWidthChanged -= new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); ColumnWidthControl.SetDataGridView(labelTitle.Text, dataGridView1); this.dataGridView1.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); } else { panelTop.Visible = false; } } catch (Exception ex) { MessageDialog.ShowErrorMessage(ex.Message); } }
/// <summary> /// 刷新DataGridView /// </summary> /// <param name="findBill">数据集</param> void RefreshDataGridView(IQueryResult findBill) { ClearForm(); dataGridView1.DataSource = findBill.DataCollection.Tables[0]; // 添加查询用的列 if (m_findField == null) { List <string> lstColumnName = new List <string>(); for (int i = 0; i < dataGridView1.Columns.Count; i++) { if (dataGridView1.Columns[i].Visible) { lstColumnName.Add(dataGridView1.Columns[i].Name); } } m_findField = lstColumnName.ToArray(); } if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelPara.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; } this.dataGridView1.ColumnWidthChanged -= new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); ColumnWidthControl.SetDataGridView(labelTitle.Text, dataGridView1); this.dataGridView1.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); dataGridView1.Columns["材料编码"].Visible = false; dataGridView1.Columns["采购员编码"].Visible = false; dataGridView1.Columns["质检员编码"].Visible = false; dataGridView1.Columns["仓管员编码"].Visible = false; dataGridView1.Columns["申请人编码"].Visible = false; dataGridView1.Columns["设计人编码"].Visible = false; dataGridView1.Columns["工装管理员编码"].Visible = false; dataGridView1.Refresh(); }
/// <summary> /// 刷新DataGridView /// </summary> /// <param name="edition">版本</param> void RefreshDataGridView() { try { this.dataGridView1.CellEnter -= new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellEnter); DataTable dataTable; if (!m_bomServer.GetBom(cmbProductType.Text, cmbDBOMVersion.Text, out dataTable, out m_err)) { MessageDialog.ShowErrorMessage(m_err); return; } dataGridView1.DataSource = dataTable; dataGridView1.Columns["序号"].Visible = false; // 添加数据定位控件 if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelSearch.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; m_dataLocalizer.Visible = true; } this.dataGridView1.ColumnWidthChanged -= new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); ColumnWidthControl.SetDataGridView(labelTitle.Text, dataGridView1); this.dataGridView1.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); dataGridView1.Refresh(); } catch (Exception err) { MessageDialog.ShowErrorMessage(err.Message); } finally { this.dataGridView1.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellEnter); } }
/// <summary> /// 刷新 /// </summary> /// <param name="source">数据集</param> void RefreshDataGirdView() { DataTable dt = new DataTable(); dt = m_orderFormAffrim.GetAllInfo(dateTimePicker1.Value, dateTimePicker2.Value, comboBox1.Text); dataGridView1.DataSource = dt; if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); m_dataLocalizer.OnlyLocalize = true; panelPara.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; } }
/// <summary> /// 窗体载入 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void FormFindGoods_Load(object sender, EventArgs e) { if (m_StoreServer.GetAllStore(null, false, out m_findAllSock, out m_err)) { dateStore = GlobalObject.GeneralFunction.ConvertToDataTable <View_S_Stock>(m_findAllSock); dataGridView1.DataSource = dateStore; } m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); panel3.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; m_findDepotType = m_DepotTypeForPersonnel.GetDepotTypeBill(); GlobalObject.GeneralFunction.LoadTreeViewDt(treeView1, m_DepotTypeForPersonnel.ChangeDataTable(GlobalObject.GeneralFunction.ConvertToDataTable <S_Depot>(m_findDepotType)), "DepotName", "DepotCode", "RootSign", "RootSign = 'Root'"); }
/// <summary> /// 刷新 DataGridView /// </summary> /// <param name="productName">产品名称</param> void RefreshDataGridView(string productName) { try { this.dataGridView1.CellEnter -= new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellEnter); ResetAssemblyPanelParams(); dataGridView1.DataSource = m_bomMappingServer.GetBomMapping(productName); dataGridView1.Columns["序号"].Visible = false; // 添加数据定位控件 if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelSearch.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; m_dataLocalizer.Visible = true; } this.dataGridView1.ColumnWidthChanged -= new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); ColumnWidthControl.SetDataGridView(labelTitle.Text, dataGridView1); this.dataGridView1.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler( this.dataGridView1_ColumnWidthChanged); dataGridView1.Refresh(); ChangeBomMappingPanelPara(); } catch (Exception err) { MessageDialog.ShowErrorMessage(err.Message); } finally { this.dataGridView1.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellEnter); } }
/// <summary> /// 刷新 /// </summary> /// <param name="source">数据集</param> void RefreshDataGirdView(DataTable source) { txtBill_ID.Text = ""; cmbStorage.SelectedIndex = -1; cmbPDFS.SelectedIndex = -1; dataGridView1.DataSource = source; dataGridView1.Columns["单据号"].Width = 120; dataGridView1.Columns["单据状态"].Width = 120; dataGridView1.Columns["所属库房"].Width = 120; if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dataGridView1, this.Name, UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelPara.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; } }
public FormProductStock(string GoodsID, string storage) { InitializeComponent(); DataTable dtStock = s_quarantine.GetProductStockInfo(GoodsID, storage, out error); dataGridView1.DataSource = dtStock; dataGridView1.Columns["GoodsID"].Visible = false; if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer( dataGridView1, this.Name, UniversalFunction.SelectHideFields( this.Name, dataGridView1.Name, BasicInfo.LoginID)); m_dataLocalizer.OnlyLocalize = true; panel1.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; } }
/// <summary> /// 刷新DataGridView /// </summary> /// <param name="findStore"></param> void RefreshDataGridView(IQueryable <View_Client> findProvider) { dataGridView1.DataSource = findProvider; ColumnWidthControl.SetDataGridView(this.Text, dataGridView1); // 添加数据定位控件 if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer( dataGridView1, this.Name, UniversalFunction.SelectHideFields( this.Name, dataGridView1.Name, BasicInfo.LoginID)); panelTop.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; m_dataLocalizer.Visible = true; } dataGridView1.Refresh(); }
/// <summary> /// 刷新 /// </summary> void RefreshDataGridView() { dgvERecord.DataSource = m_allTable; if (m_allTable != null) { dgvERecord.Columns[0].Visible = false; } if (m_dataLocalizer == null) { m_dataLocalizer = new UserControlDataLocalizer(dgvERecord, this.Name, UniversalFunction.SelectHideFields(this.Name, dgvERecord.Name, BasicInfo.LoginID)); panelLocalizer.Controls.Add(m_dataLocalizer); m_dataLocalizer.Dock = DockStyle.Bottom; } dgvERecord.Refresh(); }