Esempio n. 1
0
        public static ReporterParameter CreateTextBox(this ReporterParameter param, string placeHolder = "")
        {
            param.ValueType = ParameterValueType.String;

            if (placeHolder.isNotNullOrWhiteSpace())
            {
                placeHolder = $"placeholder: '{placeHolder}',";
            }

            param.Html = $@"<div class='option'><span>parameter_text</span><div id='parameter_name'></div></div>";
            param.Js   = @"
                <script>$(function() {
                    $('#parameter_name').dxTextBox({
                        valueChangeEvent: 'keyup',
                        " + placeHolder + @"
                        onValueChanged: function (e) {
                            jQuery.data(document.body, 'parameter_name_value', e.value);
                        }
                    });
                    jQuery.data(document.body, 'parameter_name_value', getTextBox('parameter_name').option('value'));
                    }
                    )
                </script>
                ";
            return(param.ReplaceParamTextName());
        }
Esempio n. 2
0
        public ReporterParameter SetParameterReporterValue(string parameterName, object value)
        {
            ReporterParameter teknisyenReporterParameter = GetParameter(parameterName);

            if (teknisyenReporterParameter.isNotNull())
            {
                teknisyenReporterParameter.ReporterValue = value;
            }
            return(teknisyenReporterParameter);
        }
Esempio n. 3
0
        public virtual ReporterParameter SetParameterIncomingValue(string parameterName, object value)
        {
            ReporterParameter teknisyenReporterParameter = GetParameter(parameterName);

            if (teknisyenReporterParameter.isNotNull())
            {
                teknisyenReporterParameter.IncomingValue = value;
            }
            return(teknisyenReporterParameter);
        }
Esempio n. 4
0
 static ReporterParameter ReplaceParamTextName(this ReporterParameter param)
 {
     param.Html = param.Html
                  .Replace("parameter_name", param.Name)
                  .Replace("parameter_text", param.Text);
     param.Js = param.Js
                .Replace("parameter_name", param.Name)
                .Replace("parameter_text", param.Text);
     return(param);
 }
Esempio n. 5
0
        static ReporterParameter CreateDateTime(this ReporterParameter param, DateTimeTypes dateTimeType, string displayFormat, bool roller = false)
        {
            param.ValueType = ParameterValueType.DateTime;

            string typeString       = "";
            string defDisplayFormat = "";

            switch (dateTimeType)
            {
            default:
            case DateTimeTypes.Date:
                typeString       = "date";
                defDisplayFormat = "dd.MM.yyyy";
                break;

            case DateTimeTypes.Time:
                typeString       = "time";
                defDisplayFormat = "HH:mm";
                break;

            case DateTimeTypes.DateTime:
                typeString       = "datetime";
                defDisplayFormat = "dd.MM.yyyy HH:mm";
                break;
            }
            if (displayFormat.isNullOrWhiteSpace())
            {
                displayFormat = defDisplayFormat;
            }

            param.Html = $@"<div class='option'><span>parameter_text</span><div id='parameter_name'></div></div>";
            param.Js   = @"
                <script>$(function() {
                    $('#parameter_name').dxDateBox({
                        type: '" + typeString + @"',
                        displayFormat:'" + displayFormat + @"',
                        value: new Date(),
                        onValueChanged: function (e) {
                            var previousValue = e.previousValue;
                            var newValue = e.value;
                            jQuery.data(document.body, 'parameter_name_value', dateToString(e.value));
                        }
                    });
                    jQuery.data(document.body, 'parameter_name_value', dateToString(getDate('parameter_name').option('value')));
                    }
                    )
                </script>
                ";
            return(param.ReplaceParamTextName());
        }
Esempio n. 6
0
 protected void AddParameter(ReporterParameter parameter)
 {
     dictionary.set(parameter.Name, parameter);
 }
Esempio n. 7
0
        public static ReporterParameter CreateAcikKalmaGunu(this ReporterParameter param, bool multipleSelect)
        {
            string selectType = (multipleSelect ? "multiple" : "single");

            param.Html = $@"<div class='option'><span>parameter_text</span><div id='parameter_name'></div></div>";
            param.Js   = @"
            <script>$(function() {

                var dataGrid = $('#parameter_name').dxDataGrid({
                    //dataSource: sales,
                    selection:
                        {
                            mode: '" + selectType + @"'
                    },
                    paging:
                        {
                            pageSize: 12
                    },
                    filterRow:
                        {
                            visible: true
                    },
                    columns: [
                        {
                            dataField: 'ID', 
                            caption: 'ID',
                            width: 90,
                            visible: false
                        },
                        {
                            dataField:'AD',
                            caption:'Ne kadar zamandır açık?',
                            width:400
                        }
                        ],
                    onSelectionChanged: function (selectedItems) {
                                var servisIds = '';
                                $.each(selectedItems.selectedRowKeys, function(index, item) {
                                    servisIds += item.ID + ','; 
                                });
                                jQuery.data(document.body, 'parameter_name_value', servisIds);
                        }
                }).dxDataGrid('instance');

                jQuery.data(document.body, 'parameter_name_value', '');

                dataGrid.option('selection.selectAllMode', 'allPages');
                dataGrid.option('selection.showCheckBoxesMode', 'onClick');

                action('Sason', 'GetAcikKalmaGunu', null, function (res) {
                    if (res.Ok) {
                       getGrid('parameter_name').option('dataSource', res.Data);
                    }
                }
                );
 
            }
            )   
            </script>
            ";
            return(param.ReplaceParamTextName());
        }
Esempio n. 8
0
 public static ReporterParameter CreateDateTime(this ReporterParameter param)
 {
     return(param.CreateDateTime(DateTimeTypes.DateTime, "", false));
 }
Esempio n. 9
0
        public static ReporterParameter CreateTeknisyenSelect(this ReporterParameter param, bool multipleSelect)
        {
            param.ValueType = ParameterValueType.TeknisyenSecimi;

            string selectType = (multipleSelect ? "multiple" : "single");

            param.Html = $@"<div class='option'><span>parameter_text</span><div id='parameter_name'></div></div>";
            param.Js   = @"
            <script>$(function() {

                var dataGrid = $('#parameter_name').dxDataGrid({
                    //dataSource: sales,
                    selection:
                        {
                            mode: '" + selectType + @"'
                    },
                    paging:
                        {
                            pageSize: 10
                    },
                    filterRow:
                        {
                            visible: true
                    },
                    columns: [
                        {
                            dataField: 'ID', 
                            caption: 'ID',
                            width: 90,
                            visible: false
                        },
                        {
                            dataField:'AdSoyad',
                            caption:'Adi Soyadi',
                            width:200
                        }
                        ],
                    onSelectionChanged: function (selectedItems) {
                                var teknisyenIds = '';
                                $.each(selectedItems.selectedRowKeys, function(index, item) {
                                    teknisyenIds += item.ID + ','; 
                                });
                                jQuery.data(document.body, 'parameter_name_value', teknisyenIds);
                        }
                }).dxDataGrid('instance');

                jQuery.data(document.body, 'parameter_name_value', '');        

                dataGrid.option('selection.selectAllMode', 'allPages');
                dataGrid.option('selection.showCheckBoxesMode', 'onClick');
                    
                action('Teknisyen', 'GetServisTeknisyenListesi', { servisId: jQuery.data(document.body, 'ServisId') }, function (res) {
                    if (res.Ok) {
                       getGrid('parameter_name').option('dataSource', res.Data);    
                    }
                }
                );
 
            }
            )   
            </script>
            ";
            return(param.ReplaceParamTextName());
        }