Exemple #1
0
        private DataTable repertoryLocationInfoTable_false = null; //不包含全部选项

        /// <summary>
        /// SearchLookUpEdit仓位信息控件初始化
        /// </summary>
        public void SearchLookUpEdit_RepertoryLocationInfo(SearchLookUpEdit searchLookUp, bool addAllItem, string valueMemberStr = "AutoId", string displayMemberStr = "LocationName")
        {
            if (DataTypeConvert.GetString(searchLookUp.Properties.View.Tag) == "Init")
            {
                return;
            }

            GridColumn grdColAutoId = new GridColumn();

            grdColAutoId.Caption   = "AutoId";
            grdColAutoId.FieldName = "AutoId";
            grdColAutoId.Name      = "grdColAutoId";

            GridColumn grdColLocationNo = new GridColumn();

            grdColLocationNo.Caption   = "仓位号";
            grdColLocationNo.FieldName = "LocationNo";
            grdColLocationNo.Name      = "grdColLocationNo";
            grdColLocationNo.AppearanceHeader.Options.UseTextOptions = true;
            grdColLocationNo.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            grdColLocationNo.Visible      = true;
            grdColLocationNo.VisibleIndex = 0;

            GridColumn grdColLocationName = new GridColumn();

            grdColLocationName.Caption   = "仓位名称";
            grdColLocationName.FieldName = "LocationName";
            grdColLocationName.Name      = "grdColLocationName";
            grdColLocationName.AppearanceHeader.Options.UseTextOptions = true;
            grdColLocationName.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            grdColLocationName.Visible      = true;
            grdColLocationName.VisibleIndex = 1;

            GridColumn grdColRepertoryName = new GridColumn();

            grdColRepertoryName.Caption   = "仓库名称";
            grdColRepertoryName.FieldName = "RepertoryName";
            grdColRepertoryName.Name      = "grdColRepertoryName";
            grdColRepertoryName.AppearanceHeader.Options.UseTextOptions = true;
            grdColRepertoryName.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            grdColRepertoryName.Visible      = true;
            grdColRepertoryName.VisibleIndex = 2;

            searchLookUp.Properties.View.Columns.AddRange(new GridColumn[] { grdColAutoId, grdColLocationNo, grdColLocationName, grdColRepertoryName });

            searchLookUp.Properties.NullText      = "";
            searchLookUp.EnterMoveNextControl     = true;
            searchLookUp.Properties.ValueMember   = valueMemberStr;
            searchLookUp.Properties.DisplayMember = displayMemberStr;

            if (addAllItem)
            {
                if (repertoryLocationInfoTable_True == null)
                {
                    repertoryLocationInfoTable_True = commonDAO.QueryRepertoryLocationInfo(true);
                }
                searchLookUp.Properties.DataSource = repertoryLocationInfoTable_True;
            }
            else
            {
                if (repertoryLocationInfoTable_false == null)
                {
                    repertoryLocationInfoTable_false = commonDAO.QueryRepertoryLocationInfo(false);
                }
                searchLookUp.Properties.DataSource = repertoryLocationInfoTable_false;
            }

            searchLookUp.Properties.View.IndicatorWidth          = 60;
            searchLookUp.Properties.View.CustomDrawRowIndicator += searchLookUpView_CustomDrawRowIndicator;

            searchLookUp.Properties.View.Tag = "Init";
        }
        /// <summary>
        /// 窗体加载事件错误
        /// </summary>
        private void FrmOrderListAndWarehouseWarrantList_Load(object sender, EventArgs e)
        {
            try
            {
                ControlCommonInit ctlInit = new ControlCommonInit();

                DateTime nowDate = BaseSQL.GetServerDateTime();
                dateOrderDateBegin.DateTime = nowDate.Date.AddDays(-SystemInfo.OrderQueryDate_DateIntervalDays);
                dateOrderDateEnd.DateTime   = nowDate.Date;

                DataTable departmentTable_t = commonDAO.QueryDepartment(true);
                DataTable bussInfoTable_t   = commonDAO.QueryBussinessBaseInfo(true);
                DataTable purCateTable_t    = commonDAO.QueryPurCategory(true);

                lookUpReqDep.Properties.DataSource = departmentTable_t;
                lookUpReqDep.ItemIndex             = 0;
                searchLookUpBussinessBaseNo.Properties.DataSource = bussInfoTable_t;
                searchLookUpBussinessBaseNo.Text        = "全部";
                lookUpPurCategory.Properties.DataSource = purCateTable_t;
                lookUpPurCategory.ItemIndex             = 0;
                //searchLookUpProjectNo.Properties.DataSource = projectTable_t;
                //searchLookUpProjectNo.Text = "全部";
                ctlInit.SearchLookUpEdit_ProjectList(searchLookUpProjectNo, true);
                searchLookUpProjectNo.Text = "全部";
                //searchLookUpCodeFileName.Properties.DataSource = commonDAO.QueryPartsCode(true);
                //searchLookUpCodeFileName.EditValue = 0;
                ctlInit.SearchLookUpEdit_PartsCode(searchLookUpCodeFileName, true);
                searchLookUpCodeFileName.EditValue = 0;
                ctlInit.ComboBoxEdit_OrderState_Submit(comboBoxReqState);
                comboBoxReqState.SelectedIndex = 0;

                //repLookUpReqDep.DataSource = commonDAO.QueryDepartment(false);
                //repSearchBussinessBaseNo.DataSource = commonDAO.QueryBussinessBaseInfo(false);
                //repLookUpPurCategory.DataSource = commonDAO.QueryPurCategory(false);
                //repSearchProjectNo.DataSource = commonDAO.QueryProjectList(false);
                repLookUpReqDep.DataSource              = departmentTable_t;
                repSearchBussinessBaseNo.DataSource     = bussInfoTable_t;
                repLookUpPurCategory.DataSource         = purCateTable_t;
                repSearchProjectNo.DataSource           = searchLookUpProjectNo.Properties.DataSource;
                repLookUpRepertoryId.DataSource         = commonDAO.QueryRepertoryInfo(false);
                repLookUpRepertoryLocationId.DataSource = commonDAO.QueryRepertoryLocationInfo(false);
                repSearchShelfId.DataSource             = commonDAO.QueryShelfInfo(false);

                if (SystemInfo.DisableProjectNo)
                {
                    labProjectNo.Visible          = false;
                    searchLookUpProjectNo.Visible = false;
                    colProjectNo.Visible          = false;
                    colStnNo.Visible = false;
                }

                gridBottomOrderHead.pageRowCount = SystemInfo.OrderQueryGrid_PageRowCount;

                btnQuery_Click(null, null);
            }
            catch (Exception ex)
            {
                //ExceptionHandler.HandleException(this.Text + "--窗体加载事件错误。", ex);
                ExceptionHandler.HandleException(this.Text + "--" + f.tsmiCtjzsjcw.Text, ex);
            }
        }