Пример #1
0
        /// <summary>
        /// 窗体加载事件
        /// </summary>
        private void FrmStnSummary_Load(object sender, EventArgs e)
        {
            try
            {
                LookUpCreator.Properties.DataSource = commonDAO.QueryUserInfo(false);

                repLookUpCreator.DataSource = LookUpCreator.Properties.DataSource;

                if (queryAutoQuotationNoStr == "")
                {
                    ssDAO.QueryStnSummary(TableStnSummary, "", "", true);
                    ssDAO.QueryStnSummaryList(TableStnList, "", true);
                    Set_ButtonEditGrid_State(true);
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(this.Text + "--窗体加载事件错误。", ex);
            }
        }
Пример #2
0
        /// <summary>
        /// 刷新工位的明细信息
        /// </summary>
        private void RefreshStnSummaryList(string ssNoStr)
        {
            int    lastAutoIdInt = 0;
            string lastSSNoStr   = "";

            if (bindingSource_StnList.Current != null)
            {
                DataRow headRow = ((DataRowView)bindingSource_StnList.Current).Row;
                lastAutoIdInt = DataTypeConvert.GetInt(headRow["AutoId"]);
                lastSSNoStr   = DataTypeConvert.GetString(headRow["SSNo"]);

                if (lastNewStnListAutoId != 0)
                {
                    lastAutoIdInt        = lastNewStnListAutoId;
                    lastNewStnListAutoId = 0;
                }
            }

            TableStnList.Rows.Clear();
            ssDAO.QueryStnSummaryList(TableStnList, ssNoStr);

            if (queryStnSummaryListAutoIdInt > 0)
            {
                for (int i = 0; i < gridViewStnList.DataRowCount; i++)
                {
                    if (DataTypeConvert.GetInt(gridViewStnList.GetDataRow(i)["AutoId"]) == queryStnSummaryListAutoIdInt)
                    {
                        gridViewStnList.FocusedRowHandle = i;
                        break;
                    }
                }
                queryStnSummaryListAutoIdInt = 0;
            }
            else if (lastSSNoStr == ssNoStr && lastAutoIdInt > 0)
            {
                for (int i = 0; i < gridViewStnList.DataRowCount; i++)
                {
                    if (DataTypeConvert.GetInt(gridViewStnList.GetDataRow(i)["AutoId"]) == lastAutoIdInt)
                    {
                        gridViewStnList.FocusedRowHandle = i;
                        break;
                    }
                }
            }
        }