Ejemplo n.º 1
0
        public void InitValues(StorageValues storageValues, bool initInvisible)
        {
            if (Plugin == null)
            {
                throw new Exception("Свойство Plugin не может быть равен null");
            }

            foreach (var filter in Plugin.Conditions)
            {
                if (!filter.Visible && !initInvisible)
                {
                    continue;
                }
                var storage = filter.ColumnFilter.GetStorage();
                storageValues.SetStorage(storage);
                filter.ColumnFilter.SetStorage(storage);
            }
            Plugin.SetCountCircleFillConditions(storageValues.CountListValues, true);
            for (int i = 0; i < storageValues.CountListValues; i++)
            {
                foreach (var filter in Plugin.CircleFillConditions[i])
                {
                    if (!filter.Visible && !initInvisible)
                    {
                        continue;
                    }
                    var storage = filter.ColumnFilter.GetStorage();
                    storageValues.SetListStorage(storage, i);
                    filter.ColumnFilter.SetStorage(storage);
                }
            }
        }
Ejemplo n.º 2
0
        public static void CreateReportSubscriptionParams(
            DBDataContext db,
            long refReportSubscriptions,
            List <BaseReportCondition> conditionsRu,
            List <BaseReportCondition> conditionsKz,
            PlaceHolder ph,
            StorageValues values,
            int?index)
        {
            var i = -1;

            foreach (var conditionRu in conditionsRu)
            {
                i++;
                if (!conditionRu.Visible)
                {
                    continue;
                }
                var conditionKz = conditionsKz[i];

                ph.Controls.Add((Control)conditionRu.ColumnFilter);
                var storageRu = conditionRu.ColumnFilter.GetStorage();
                if (index == null)
                {
                    values.SetStorage(storageRu);
                }
                else
                {
                    values.SetListStorage(storageRu, index.Value);
                }
                conditionRu.ColumnFilter.SetStorage(storageRu);

                ph.Controls.Add((Control)conditionKz.ColumnFilter);
                var storageKz = conditionKz.ColumnFilter.GetStorage();
                if (index == null)
                {
                    values.SetStorage(storageKz);
                }
                else
                {
                    values.SetListStorage(storageKz, index.Value);
                }
                conditionKz.ColumnFilter.SetStorage(storageKz);

                string[] textValues        = conditionsKz[i].ColumnFilter.GetTexts();
                var      paramTextValuesKz = string.Empty;
                if (textValues != null)
                {
                    paramTextValuesKz = string.Join(", ", textValues);
                }
                var paramCaptionKz = storageKz.Caption;

                var paramTextValuesRu = string.Empty;
                textValues = conditionRu.ColumnFilter.GetTexts();
                if (textValues != null)
                {
                    paramTextValuesRu = string.Join(", ", textValues);
                }
                var paramCaptionRu = storageRu.Caption;

                var record = new ReportSubscriptions_Param
                {
                    refReportSubscriptions = refReportSubscriptions,
                    ParamName             = storageRu.Name,
                    ParamCaptionKz        = paramCaptionKz,
                    ParamCaptionRu        = paramCaptionRu,
                    ParamTextValuesKz     = paramTextValuesKz,
                    ParamTextValuesRu     = paramTextValuesRu,
                    DynamicAttributeIndex = index,
                    ParamDataType         = storageRu.DataType.Name,
                    ParamFilterType       = storageRu.FilterType.ToString()
                };
                db.ReportSubscriptions_Params.InsertOnSubmit(record);

                ph.Controls.Remove((Control)conditionRu.ColumnFilter);
                ph.Controls.Remove((Control)conditionKz.ColumnFilter);
            }
        }