Exemple #1
0
        /// <summary>
        /// Обновление выпадающих списков
        /// </summary>
        /// <returns>true - все списки успешно обновлены; false - ошибка</returns>
        public System.Boolean LoadComboBoxItems()
        {
            System.Boolean bRet = false;
            try
            {
                // Компании
                cboxCompany.Properties.Items.Clear();
                cboxCompany.Properties.Items.AddRange(CCompany.GetCompanyList(m_objProfile, null));

                // Клиенты
                cboxCustomer.Properties.Items.Clear();
                cboxCustomer.Properties.Items.AddRange(CCarrier.GetCarrierList(m_objProfile, null));

                // Состояние
                cboxAgreementState.Properties.Items.Clear();
                cboxAgreementState.Properties.Items.AddRange(CAgreementState.GetAgreementStateList(m_objProfile, null));

                bRet = true;
            }
            catch (System.Exception f)
            {
                SendMessageToLog("Ошибка обновления выпадающих списков. Текст ошибки: " + f.Message);
            }
            finally
            {
            }

            return(bRet);
        }
Exemple #2
0
        /// <summary>
        /// Построение столбцов и строк в дереве
        /// </summary>
        private void InitializeTreeList()
        {
            try
            {
                List <CCustomerCategory> objCustomerCategoryList = CCustomerCategory.GetCustomerCategoryList(m_objProfile, null);
                if (objCustomerCategoryList != null)
                {
                    DevExpress.XtraTreeList.Columns.TreeListColumn colCustomerCategory = null;
                    foreach (CCustomerCategory objCustomerCategory in objCustomerCategoryList)
                    {
                        colCustomerCategory            = this.treeList.Columns.Add();
                        colCustomerCategory.ColumnEdit = repItemCheckEdit;
                        colCustomerCategory.Caption    = objCustomerCategory.Code;
                        colCustomerCategory.FieldName  = objCustomerCategory.Code;
                        colCustomerCategory.MinWidth   = 50;
                        colCustomerCategory.Name       = objCustomerCategory.ID.ToString();
                        colCustomerCategory.OptionsColumn.AllowSort = false;
                        colCustomerCategory.Visible = true;
                        colCustomerCategory.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                        colCustomerCategory.Tag = objCustomerCategory;
                    }
                }
                objCustomerCategoryList = null;

                List <CCompany> objCompanyList = CCompany.GetCompanyList(m_objProfile, null);
                if (objCompanyList != null)
                {
                    foreach (CCompany objCompany in objCompanyList)
                    {
                        treeList.AppendNode(new object[] { objCompany.Abbr }, null).Tag = objCompany;
                    }
                }
                objCompanyList = null;
            }
            catch (System.Exception f)
            {
                SendMessageToLog("Ошибка установки начальных настроек дерева. Текст ошибки: " + f.Message);
            }
            finally
            {
            }

            return;
        }