public ConditionalAssignDialog(DashboardHelper dashboardHelper)
 {
     InitializeComponent();
     this.dashboardHelper = dashboardHelper;
     this.DataFilters = new DataFilters(dashboardHelper);
     FillComboBoxes();
 }
Example #2
0
        public RowFilterDialog(DashboardHelper dashboardHelper, FilterDialogMode pMode, DataFilters filters, bool includeUserDefinedVars)
        {
            InitializeComponent();
            this.includeUserDefinedVars = includeUserDefinedVars;
            this.dashboardHelper = dashboardHelper;
            this.Mode = pMode;
            Construct();

            rfc = new EpiDashboard.RowFilterControl(dashboardHelper, Mode, filters, includeUserDefinedVars);
            host.Child = rfc;
        }
        public ConditionalAssignDialog(DashboardHelper dashboardHelper, Rule_ConditionalAssign conditionalAssignRule)
        {
            InitializeComponent();
            this.dashboardHelper = dashboardHelper;
            this.DataFilters = conditionalAssignRule.DataFilters;

            editMode = true;

            FillComboBoxes();

            this.txtDestinationField.Text = conditionalAssignRule.DestinationColumnName;
            this.txtDestinationField.Enabled = false;

            SetAssignValue setAssignValue = new SetAssignValue(SetAssignmentValue);

            switch (conditionalAssignRule.DestinationColumnType)
            {
                case "System.SByte":
                case "System.Byte":
                case "System.Boolean":
                    this.cbxFieldType.SelectedItem = "Yes/No";
                    setAssignValue = new SetAssignValue(SetBooleanAssignmentValue);
                    break;
                case "System.String":
                    this.cbxFieldType.SelectedItem = "Text";
                    break;
                case "System.Single":
                case "System.Double":
                case "System.Decimal":
                case "System.Int32":
                case "System.Int16":
                    this.cbxFieldType.SelectedItem = "Numeric";
                    break;
            }

            cbxFieldType.Enabled = false;

            this.txtAssignCondition.Text = DataFilters.GenerateReadableDataFilterString();

            //foreach (KeyValuePair<string, object> kvp in conditionalAssignRule.Conditions)
            //{
            //    this.txtAssignValue.Text = kvp.Value.ToString();
            //    break;
            //}

            setAssignValue(conditionalAssignRule);
        }