Пример #1
0
        /// <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();
        }
Пример #2
0
        /// <summary>
        /// 刷新数据
        /// </summary>
        private void RefreshControl()
        {
            if (!m_providerServer.GetAllBill(out m_queryResult, out m_error))
            {
                MessageDialog.ShowErrorMessage(m_error);
                return;
            }

            m_queryResult.DataGridView = dataGridView1;

            DataTable dt = m_queryResult.DataCollection.Tables[0];

            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);

            userControlDataLocalizer1.Init(dataGridView1, this.Name,
                                           UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID));

            dataGridView1.Refresh();

            dataGridView1.Columns[0].Frozen = true;
            dataGridView1.Columns[1].Frozen = true;
        }
        /// <summary>
        /// 刷新DataGridView
        /// </summary>
        /// <param name="goods">物品信息</param>
        void RefreshDataGridView(IEnumerable <View_S_MaterialListRejectBill> goods)
        {
            if (goods == null)
            {
                return;
            }

            this.dataGridView1.Visible             = false;
            this.dataGridView1.ColumnWidthChanged -= new System.Windows.Forms.DataGridViewColumnEventHandler(
                this.dataGridView1_ColumnWidthChanged);
            this.dataGridView1.CellEnter -= new DataGridViewCellEventHandler(this.dataGridView1_CellEnter);

            dataGridView1.DataSource             = goods;
            dataGridView1.Columns["单价"].Visible  = false;
            dataGridView1.Columns["金额"].Visible  = false;
            dataGridView1.Columns["总金额"].Visible = false;

            ColumnWidthControl.SetDataGridView(labelTitle.Text, dataGridView1);

            this.dataGridView1.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler(
                this.dataGridView1_ColumnWidthChanged);
            this.dataGridView1.CellEnter += new DataGridViewCellEventHandler(this.dataGridView1_CellEnter);

            dataGridView1.Refresh();

            dataGridView1.Columns["序号"].Visible   = false;
            dataGridView1.Columns["退货单号"].Visible = false;
            dataGridView1.Columns["物品ID"].Visible = false;

            this.dataGridView1.Visible = true;
            lblAmount.Text             = goods.Count().ToString();
        }
        /// <summary>
        /// 刷新
        /// </summary>
        void RefreshDataGridView()
        {
            if (!m_attendanceServer.GetAllSummary(out m_queryResult, out m_error))
            {
                MessageDialog.ShowPromptMessage(m_error);
                return;
            }

            DataTable dt = m_queryResult.DataCollection.Tables[0];

            DataTable dtTemp = dt.Clone();

            DataRow[] dr = dt.Select("年份='" + numYear.Value + "'");

            for (int i = 0; i < dr.Length; i++)
            {
                dtTemp.ImportRow(dr[i]);
            }

            dataGridView1.DataSource = dtTemp;

            if (dataGridView1.Rows.Count > 0)
            {
                dataGridView1.Columns["部门编码"].Visible = false;
                dataGridView1.Columns["序号"].Visible   = false;
            }

            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);

            // 添加查询用的列
            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();
            }

            userControlDataLocalizer1.Init(dataGridView1, this.Name,
                                           UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID));

            dataGridView1.Refresh();

            dataGridView1.Columns[0].Frozen = true;
            dataGridView1.Columns[1].Frozen = true;
            dataGridView1.Columns[2].Frozen = true;
        }
Пример #5
0
        /// <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);
            }
        }
Пример #6
0
        /// <summary>
        /// 刷新DataGridView
        /// </summary>
        /// <param name="goods">物品信息</param>
        void RefreshDataGridView(DataTable goods)
        {
            if (goods == null)
            {
                return;
            }

            this.dataGridView1.Visible             = false;
            this.dataGridView1.ColumnWidthChanged -= new System.Windows.Forms.DataGridViewColumnEventHandler(
                this.dataGridView1_ColumnWidthChanged);
            this.dataGridView1.CellEnter -= new DataGridViewCellEventHandler(this.dataGridView1_CellEnter);

            dataGridView1.DataSource = goods; //GlobalObject.GeneralFunction.ConvertToDataTable<S_MaterialDetainList>(goods);
            ColumnWidthControl.SetDataGridView(labelTitle.Text, dataGridView1);

            this.dataGridView1.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler(
                this.dataGridView1_ColumnWidthChanged);
            this.dataGridView1.CellEnter += new DataGridViewCellEventHandler(this.dataGridView1_CellEnter);

            dataGridView1.Refresh();

            dataGridView1.Columns["序号"].Visible   = false;
            dataGridView1.Columns["扣货单号"].Visible = false;
            dataGridView1.Columns["物品ID"].Visible = false;

            this.dataGridView1.Visible = true;
            lblAmount.Text             = goods.Rows.Count.ToString();
        }
Пример #7
0
        /// <summary>
        /// 刷新
        /// </summary>
        private void RefreshDataGridView()
        {
            DataTable dt = m_dayBookServer.GetDayBookView(dtpSelectStar.Value.ToString(), dtpSelectEnd.Value.ToString());

            dataGridView1.DataSource = dt;

            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);

            // 添加查询用的列
            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();
            }

            userControlDataLocalizer1.Init(dataGridView1, this.Name,
                                           UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID));

            dataGridView1.Refresh();
        }
Пример #8
0
        /// <summary>
        /// 刷新
        /// </summary>
        /// <param name="source">数据集</param>
        void RefreshDataGirdView(DataTable source)
        {
            m_dtDS = source;

            m_lstFindField.Clear();

            DataColumnCollection columns = source.Columns;

            if (columns.Count > 0)
            {
                for (int i = 0; i < columns.Count; i++)
                {
                    m_lstFindField.Add(columns[i].ColumnName);
                }
            }

            dataGridView1.DataSource = source;

            lbCount.Text = dataGridView1.Rows.Count.ToString();

            dataGridView1.Columns["序号"].Visible   = false;
            dataGridView1.Columns["物品ID"].Visible = false;

            userControlDataLocalizer.Init(dataGridView1, this.Name,
                                          UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID));

            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);
        }
Пример #9
0
        /// <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;
            }
        }
Пример #10
0
        /// <summary>
        /// 刷新DataGridView
        /// </summary>
        /// <param name="goods">物品信息</param>
        void RefreshDataGridView(IEnumerable <View_S_FrockInDepotGoodsBill> goods)
        {
            ClearControl();

            if (goods == null)
            {
                return;
            }

            this.dataGridView1.Visible             = false;
            this.dataGridView1.ColumnWidthChanged -= new System.Windows.Forms.DataGridViewColumnEventHandler(
                this.dataGridView1_ColumnWidthChanged);
            this.dataGridView1.CellEnter -= new DataGridViewCellEventHandler(this.dataGridView1_CellEnter);

            dataGridView1.DataSource = goods; //GlobalObject.GeneralFunction.ConvertToDataTable<View_S_OrdinaryInDepotGoodsBill>(goods);
            ColumnWidthControl.SetDataGridView(labelTitle.Text, dataGridView1);

            this.dataGridView1.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler(
                this.dataGridView1_ColumnWidthChanged);
            this.dataGridView1.CellEnter += new DataGridViewCellEventHandler(this.dataGridView1_CellEnter);

            dataGridView1.Refresh();

            dataGridView1.Columns["序号"].Visible   = false;
            dataGridView1.Columns["单据号"].Visible  = false;
            dataGridView1.Columns["库房代码"].Visible = false;
            dataGridView1.Columns["物品类别"].Visible = false;

            this.dataGridView1.Visible = true;
        }
        /// <summary>
        /// 刷新DataGridView
        /// </summary>
        /// <param name="findPlanCostBill">计划金额信息</param>
        void RefreshDataGridView(IQueryable <View_BASE_GoodsPlanCost> findPlanCostBill)
        {
            lblAmount.Text = findPlanCostBill.Count().ToString();

            DataTable tempTable = GlobalObject.GeneralFunction.ConvertToDataTable <View_BASE_GoodsPlanCost>(findPlanCostBill);

            if (tempTable.Columns.Contains("单价"))
            {
                tempTable.Columns.Remove("单价");
            }

            if (tempTable.Columns.Contains("单位ID"))
            {
                tempTable.Columns.Remove("单位ID");
            }

            dataGridView1.DataSource = tempTable;
            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();

            userControlDataLocalizer1.Init(dataGridView1, this.Name,
                                           UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID));
        }
        /// <summary>
        /// 刷新
        /// </summary>
        void RefreshDataGridView()
        {
            m_list = m_offlineFailServer.GetBillByProductType(cmbQuery.Text);
            dataGridView1.DataSource = GlobalObject.GeneralFunction.ConvertToDataTable(m_list);

            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);

            // 添加查询用的列
            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();
            }

            userControlDataLocalizer1.Init(dataGridView1, this.Name,
                                           UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID));

            dataGridView1.Refresh();
        }
Пример #13
0
        /// <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();
        }
Пример #14
0
        /// <summary>
        /// 刷新DataGridView
        /// </summary>
        /// <param name="goods">物品信息</param>
        void RefreshDataGridView(DataTable goods)
        {
            if (goods == null)
            {
                return;
            }

            this.dataGridView1.Visible    = false;
            this.dataGridView1.CellEnter -= new DataGridViewCellEventHandler(this.dataGridView1_CellEnter);

            dataGridView1.DataSource = goods;
            ColumnWidthControl.SetDataGridView(labelTitle.Text, dataGridView1);

            this.dataGridView1.CellEnter += new DataGridViewCellEventHandler(this.dataGridView1_CellEnter);

            dataGridView1.Refresh();

            dataGridView1.Columns["序号"].Visible   = false;
            dataGridView1.Columns["退货单号"].Visible = false;
            dataGridView1.Columns["物品ID"].Visible = false;

            this.dataGridView1.Visible = true;

            if (goods.Rows.Count > 0)
            {
                lblAmount.Text = Convert.ToString(goods.Rows.Count);
            }
            else
            {
                lblAmount.Text = "0";
            }
        }
Пример #15
0
        /// <summary>
        /// 刷新
        /// </summary>
        private void RefreshDataGridView()
        {
            DataTable dt = m_LowestPriceServer.GetAllInfo();

            if (dt != null)
            {
                dataGridView1.DataSource = dt;

                dataGridView1.Columns["GoodsID"].Visible = false;
            }

            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);

            userControlDataLocalizer1.Init(dataGridView1, this.Name,
                                           UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID));

            dataGridView1.Columns["ClientID"].Visible      = false;
            dataGridView1.Columns["CommunicateID"].Visible = false;
        }
Пример #16
0
        /// <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;
            }
        }
        /// <summary>
        /// 刷新DataGridView
        /// </summary>
        /// <param name="findDepartmentBill">数据集</param>
        void RefreshDataGridView(IQueryable findDepartmentBill)
        {
            dataGridView1.DataSource = findDepartmentBill;

            //// 添加数据定位控件
            //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.OnlyLocalize = true;
            //    m_dataLocalizer.Dock = DockStyle.Bottom;
            //    m_dataLocalizer.Visible = true;
            //}

            userControlDataLocalizer1.Init(dataGridView1, this.Name,
                                           UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID));

            dataGridView1.Columns["五笔码"].Visible = false;
            dataGridView1.Columns["拼音码"].Visible = false;

            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();
        }
Пример #18
0
        /// <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>
        void RefreshDataGridView()
        {
            m_overTimeServer.QueryResultFilter = QueryFilterControl.GetFilterString(labelTitle.Text)
                                                 + checkBillDateAndStatus1.GetSqlString("申请时间", "单据状态");

            IQueryResult result;

            if (!m_overTimeServer.GetAllOverTimeBill(out result, out error))
            {
                MessageDialog.ShowErrorMessage(error);
                return;
            }

            //if (result.DataCollection.Tables[0].Rows.Count == 0)
            //{
            //    if (!m_overTimeServer.GetAllOverTimeBillByWorkID(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;
            }

            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);

            // 添加查询用的列
            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();
            }

            userControlDataLocalizer1.Init(dataGridView1, this.Name,
                                           UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID));

            //dataGridView1.Refresh();
        }
Пример #20
0
        /// <summary>
        /// 刷新DataGridView2
        /// </summary>
        void RefreshDataGridView2()
        {
            dataGridView2.DataSource = m_returnTable2;

            ColumnWidthControl.SetDataGridView(labelTitle.Text, dataGridView2);

            dataGridView2.Refresh();
        }
        /// <summary>
        /// 刷新
        /// </summary>
        void RefreshControl()
        {
            ClearControl();

            DataTable statusDt = m_laborServer.GetContractStatus();

            if (statusDt.Rows.Count > 0)
            {
                for (int i = 0; i < statusDt.Rows.Count; i++)
                {
                    cmbStatus.Items.Add(statusDt.Rows[i]["状态"].ToString());
                }
            }

            if (!m_laborServer.GetAllPersonnelContarct(out m_queryResult, out error))
            {
                MessageDialog.ShowErrorMessage(error);
                return;
            }

            DataTable dt = m_queryResult.DataCollection.Tables[0];

            dataGridView1.DataSource = dt;

            dataGridView1.Columns["员工编号"].Visible = false;

            dataGridView1.Refresh();

            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);

            // 添加查询用的列
            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();
            }

            userControlDataLocalizer1.Init(dataGridView1, this.Name,
                                           UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID));
        }
Пример #22
0
        /// <summary>
        /// 刷新DataGridView
        /// </summary>
        /// <param name="findStore">数据集</param>
        void RefreshDataGridView(DataTable findStore)
        {
            if (findStore != null)
            {
                DataTable table = findStore.Copy();
                dataGridView1.DataSource = table;

                ColumnWidthControl.SetDataGridView(this.Text, dataGridView1);
                dataGridView1.Refresh();
            }
        }
        private void RefreshDataGridView(DataTable dt)
        {
            dataGridView1.DataSource = dt;

            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);

            userControlDataLocalizer1.Init(dataGridView1, this.Name,
                                           UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, GlobalObject.BasicInfo.LoginID));
        }
Пример #24
0
        /// <summary>
        /// 刷新数据控件
        /// </summary>
        /// <param name="dt"></param>
        private void RefreshDataGridView(DataTable dt)
        {
            dataGridView1.DataSource = dt;

            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="data">数据集</param>
        private void RefreshDataGridView(IEnumerable <View_ZPX_CVTOffLineTestResult> data)
        {
            dataGridView1.DataSource = data.ToList();

            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>
        /// 刷新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();
        }
Пример #27
0
        /// <summary>
        /// 刷新
        /// </summary>
        void RefreshControl()
        {
            ClearControl();

            DataTable dt = m_leaveServer.GetAllLeaveType();

            if (dt != null && dt.Rows.Count > 0)
            {
                dataGridView1.DataSource = dt;
            }

            DataTable dtLeaveType = m_leaveServer.GetLeaveTypeByCode(null);

            if (dtLeaveType != null && dtLeaveType.Rows.Count > 0)
            {
                for (int i = 0; i < dtLeaveType.Rows.Count; i++)
                {
                    cmbParentTypeCode.Items.Add(dtLeaveType.Rows[i]["请假类别"].ToString());
                }
            }

            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);

            // 添加查询用的列
            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();
            }

            userControlDataLocalizer1.Init(dataGridView1, this.Name,
                                           UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID));

            dataGridView1.Refresh();
        }
        /// <summary>
        /// 刷新DataGridView
        /// </summary>
        void RefreshDataGridView()
        {
            dataGridView1.DataSource = m_returnProductType;

            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>
        void RefreshControl()
        {
            if (!m_personnerServer.GetAllBill(out m_queryResult, out error))
            {
                MessageDialog.ShowErrorMessage(error);
                return;
            }

            m_queryResult.DataGridView = dataGridView1;

            DataTable dt = m_queryResult.DataCollection.Tables[0];

            if (dt != null && dt.Rows.Count > 0)
            {
                dataGridView1.Columns["拼音"].Visible = false;
                dataGridView1.Columns["五笔"].Visible = false;
            }

            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);

            // 添加查询用的列
            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();
            }

            userControlDataLocalizer1.Init(dataGridView1, this.Name,
                                           UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID));

            dataGridView1.Refresh();

            dataGridView1.Columns[0].Frozen = true;
            dataGridView1.Columns[1].Frozen = true;
        }
Пример #30
0
        /// <summary>
        /// 刷新DataGridView
        /// </summary>
        /// <param name="findStore">数据集</param>
        void RefreshDataGridView(IQueryable findClient)
        {
            dataGridView1.DataSource = findClient;

            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();
        }