private void Addfilters()
        {
            string sfilterOperand = string.Empty;

            string[] shilowvars;
            string   svarname;

            this.datafilters = rowfiltercontrol.DataFilters;

            List <string> sconditionval        = datafilters.GetFilterConditionsAsList();
            string        strreadablecondition = datafilters.GenerateReadableDataFilterString().Trim();

            if (!(string.IsNullOrEmpty(strreadablecondition)))
            {
                if (strreadablecondition.Contains(SharedStrings.FRIENDLY_OPERATOR_EQUAL_TO))
                {
                    sfilterOperand = SharedStrings.FRIENDLY_OPERATOR_EQUAL_TO;
                }
                else if (strreadablecondition.Contains(SharedStrings.FRIENDLY_OPERATOR_GREATER_THAN))
                {
                    sfilterOperand = SharedStrings.FRIENDLY_OPERATOR_GREATER_THAN;
                }
                else if (strreadablecondition.Contains(SharedStrings.FRIENDLY_OPERATOR_GREATER_THAN_OR_EQUAL))
                {
                    sfilterOperand = SharedStrings.FRIENDLY_OPERATOR_GREATER_THAN_OR_EQUAL;
                }
                else if (strreadablecondition.Contains(SharedStrings.FRIENDLY_OPERATOR_LESS_THAN))
                {
                    sfilterOperand = SharedStrings.FRIENDLY_OPERATOR_LESS_THAN;
                }
                else if (strreadablecondition.Contains(SharedStrings.FRIENDLY_OPERATOR_LESS_THAN_OR_EQUAL))
                {
                    sfilterOperand = SharedStrings.FRIENDLY_OPERATOR_LESS_THAN_OR_EQUAL;
                }
                else if (strreadablecondition.Contains(SharedStrings.FRIENDLY_OPERATOR_NOT_MISSING))
                {
                    sfilterOperand = SharedStrings.FRIENDLY_OPERATOR_NOT_MISSING;
                }
                else if (strreadablecondition.Contains(SharedStrings.FRIENDLY_OPERATOR_MISSING))
                {
                    sfilterOperand = SharedStrings.FRIENDLY_OPERATOR_MISSING;
                }

                if (!(strreadablecondition.Contains(SharedStrings.FRIENDLY_OPERATOR_BETWEEN)))
                {
                    svarname = strreadablecondition.Substring(strreadablecondition.IndexOf("[") + 1, strreadablecondition.IndexOf("]") - strreadablecondition.IndexOf("[") - 1);
                    dashboardHelper.AddDataFilterCondition(sfilterOperand, sconditionval[0].ToString(), svarname, ConditionJoinType.And);
                }
                else if (strreadablecondition.Contains(SharedStrings.FRIENDLY_OPERATOR_BETWEEN))
                {
                    sfilterOperand = SharedStrings.FRIENDLY_OPERATOR_BETWEEN;
                    string   strcondition  = strreadablecondition.Substring(0, strreadablecondition.IndexOf(sfilterOperand)).Trim();
                    string[] strVarstrings = strcondition.Split(' ');
                    svarname = strVarstrings[3].ToString();
                    string sValues = strreadablecondition.ToString().Substring(strreadablecondition.IndexOf(sfilterOperand) + sfilterOperand.Length, (strreadablecondition.ToString().Length) - (strreadablecondition.ToString().IndexOf(sfilterOperand) + sfilterOperand.Length)).Trim();
                    shilowvars = sValues.Split(' ');
                    dashboardHelper.AddDataFilterCondition(sfilterOperand, shilowvars[0].ToString(), shilowvars[2].ToString(), svarname, ConditionJoinType.And);
                }
            }
        }
Exemple #2
0
        private void btnIfCondition_Click(object sender, EventArgs e)
        {
            RowFilterDialog rfd    = new RowFilterDialog(this.dashboardHelper, FilterDialogMode.ConditionalMode, DataFilters, true);
            DialogResult    result = rfd.ShowDialog();

            if (result == DialogResult.OK)
            {
                this.DataFilters             = rfd.DataFilters;
                this.txtAssignCondition.Text = DataFilters.GenerateReadableDataFilterString();//this.DataFilters.GenerateDataFilterString();
            }
        }
 private void btnDenominatorRule_Click(object sender, RoutedEventArgs e)
 {
     Dialogs.RowFilterDialog           rowFilterDialog = new Dialogs.RowFilterDialog(this.DashboardHelper, Dialogs.FilterDialogMode.ConditionalMode, Parameters.DenomFilter, true);
     System.Windows.Forms.DialogResult result          = rowFilterDialog.ShowDialog();
     if (result == System.Windows.Forms.DialogResult.OK)
     {
         _denomFilter            = rowFilterDialog.DataFilters;
         Parameters.DenomFilter  = rowFilterDialog.DataFilters;
         denominatorRule.Content = _denomFilter.GenerateReadableDataFilterString();
     }
 }
Exemple #4
0
        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);
        }
        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);
        }
 private void btnIfCondition_Click(object sender, EventArgs e)
 {
     RowFilterDialog rfd = new RowFilterDialog(this.dashboardHelper, FilterDialogMode.ConditionalMode, DataFilters, true);
     DialogResult result = rfd.ShowDialog();
     if (result == DialogResult.OK)
     {
         this.DataFilters = rfd.DataFilters;
         this.txtAssignCondition.Text = DataFilters.GenerateReadableDataFilterString();//this.DataFilters.GenerateDataFilterString();
     }
 }