Esempio n. 1
0
        public LegalValuesDialog(MainForm frm, string name, Page currentPage)
            : base(frm)
        {
            InitializeComponent();
            InitContextMenu();
            fieldName = name;
            page = currentPage;
            ddlField = new DDLFieldOfLegalValues(page);
            ddlField.Name = name;
            //dgCodes.CaptionText += "  " + name;
            //dgCodes.PreferredColumnWidth = Convert.ToInt32(dgCodes.Width * COLUMN_WIDTH_MULTIPLE);

            if (!string.IsNullOrEmpty(ddlField.SourceTableName))
            {
                codeTable = ddlField.GetSourceData();
                sourceTableName = ddlField.SourceTableName;
                textColumnName = ddlField.TextColumnName;
            }
        }
Esempio n. 2
0
        public LegalValuesDialog(TableBasedDropDownField field, MainForm frm, string name, Page currentPage)
            : base(frm)
        {
            InitializeComponent();
            fieldName = name;
            page = currentPage;
            creationMode = CreationMode.Edit;
            //dgCodes.CaptionText += "  " + name;
            //dgCodes.PreferredColumnWidth = Convert.ToInt32(dgCodes.Width * COLUMN_WIDTH_MULTIPLE);
            ddlField = field;

            if (!string.IsNullOrEmpty(field.SourceTableName))
            {
                codeTable = field.GetSourceData();
                sourceTableName = field.SourceTableName;
                textColumnName = field.TextColumnName;
            }

            InitContextMenu();
        }
Esempio n. 3
0
 public LegalValuesDialog(MainForm frm, RenderableField field, Page currentPage)
     : base(frm)
 {
     InitializeComponent();
     page = currentPage;
     ddlField = (DDLFieldOfLegalValues)field;
     codeTable = ddlField.GetSourceData();
     cbxSort.Checked = ddlField.ShouldSort;
     fieldName = ddlField.Name;
     //dgCodes.PreferredColumnWidth = Convert.ToInt32(dgCodes.Width * COLUMN_WIDTH_MULTIPLE);
 }
Esempio n. 4
0
        public LegalValuesDialog(RenderableField field, Page currentPage)
        {
            InitializeComponent();

            if (string.IsNullOrEmpty(field.ToString()))
            {
                throw new ArgumentNullException("field");
            }
            if (string.IsNullOrEmpty(currentPage.ToString()))
            {
                throw new ArgumentNullException("currentPage");
            }

            ddlField = (DDLFieldOfLegalValues)field;
            page = currentPage;
            codeTable = ddlField.GetSourceData();
            cbxSort.Checked = ddlField.ShouldSort;
            fieldName = ddlField.Name;
            sourceTableName = ddlField.SourceTableName;
            textColumnName = ddlField.TextColumnName;
        }
Esempio n. 5
0
        /// <summary>
        /// Constructor for the class
        /// </summary>
        /// <param name="field">field</param>
        /// <param name="currentFieldName">The name of the field</param>
        /// <param name="frm">Form</param>
        /// <param name="currentPage">Page</param>
        public DataSourceSelector(TableBasedDropDownField field, string currentFieldName, MainForm frm, Page currentPage)
            : base(frm)
        {
            #region Input Validation
            if (string.IsNullOrEmpty(currentFieldName))
            {
                throw new ArgumentNullException("currentFieldName");
            }
            #endregion Input validation

            InitializeComponent();
            page = currentPage;
            TableBasedDropDownField ddlField = (TableBasedDropDownField)field;

            if (!string.IsNullOrEmpty(field.SourceTableName))
            {
                codeTable = ddlField.GetSourceData();
            }

            this.field = field;

            if (field.FieldType == MetaFieldType.CommentLegal)
            {
                isCommentLegal = true;
            }
            else
            {
                isCommentLegal = false;
            }

            this.fieldName = currentFieldName;
            dgCodeTable.CaptionText += currentFieldName;

            try
            {
                if (!string.IsNullOrEmpty(field.SourceTableName))
                {
                    tableName = field.SourceTableName;
                    columnName = field.TextColumnName;
                    dgCodeTable.PreferredColumnWidth = Convert.ToInt32(dgCodeTable.Width * .87);
                    dgCodeTable.DataSource = field.GetSourceData();
                    btnCreate.Enabled = false;
                    btnExisting.Enabled = false;
                }
                else
                {
                    btnCreate.Enabled = true;
                    btnExisting.Enabled = true;
                }
            }
            catch
            {
                //TODO: move string to sharedstrings.resx
                throw new SystemException("Error loading data.");
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Constructor for the class
        /// </summary>
        /// <param name="field">The field</param>
        /// <param name="currentFieldName">The name of the field</param>
        public DataSourceSelector(DDLFieldOfLegalValues field, string currentFieldName)
        {
            #region Input Validation
            if (string.IsNullOrEmpty(currentFieldName))
            {
                throw new ArgumentNullException("currentFieldName");
            }
            #endregion Input validation

            InitializeComponent();
            this.field = field;
            this.fieldName = currentFieldName;
            dgCodeTable.CaptionText += currentFieldName;

            try
            {
                if (!string.IsNullOrEmpty(field.SourceTableName))
                {
                    tableName = field.SourceTableName;
                    columnName = field.TextColumnName;
                    dgCodeTable.PreferredColumnWidth = Convert.ToInt32(dgCodeTable.Width * .87);
                    dgCodeTable.DataSource = field.GetSourceData();
                    btnCreate.Enabled = false;
                    btnExisting.Enabled = false;
                }
            }
            catch
            {
                //TODO: move string to sharedstrings.resx
                throw new SystemException("Error loading data.");
            }
        }