Esempio n. 1
0
        void initFilters(ISettings sInfoFilters)
        {
            _filters.Clear();
            if (sInfoFilters != null)
            {
                string[] filters = sInfoFilters.getAllSettings();
                foreach (string filter in filters)
                {
                    FilterInfo fInfo = new FilterInfo();
                    //
                    fInfo.type            = sInfoFilters.getStringAttr(filter, _attrFType);
                    fInfo.code            = filter;
                    fInfo.desc            = _environment.translate(sInfoFilters.getStringAttr(filter, _attrName));
                    fInfo.dataReference   = _environment.getRefFactory().get(sInfoFilters.getStringAttr(filter, _attrRef));
                    fInfo.valueColumns    = ToolString.explodeList(sInfoFilters.getStringAttr(filter, _attrRefColsVal));
                    fInfo.showColumns     = ToolString.explodeList(sInfoFilters.getStringAttr(filter, _attrRefColsShow));
                    fInfo.showColumnsDesc = _environment.translate(ToolString.explodeList(sInfoFilters.getStringAttr(filter, _attrRefColsShowDesc)));

                    fInfo.sqlPlaces     = ToolString.explodeList(sInfoFilters.getStringAttr(filter, _attrSqlPlace));
                    fInfo.sqlTables     = ToolString.explodeList(sInfoFilters.getStringAttr(filter, _attrSqlTable));
                    fInfo.sqlColumns    = ToolString.explodeGroupList(sInfoFilters.getStringAttr(filter, _attrSqlCols));
                    fInfo.sqlParameters = ToolString.explodeList(sInfoFilters.getStringAttr(filter, _attrSqlParams));;
                    fInfo.sqlParameter  = sInfoFilters.getStringAttr(filter, _attrSqlParam);
                    Type type = ToolType.parse(sInfoFilters.getStringAttr(filter, _attrSqlParamType));
                    fInfo.sqlParameterValue = sInfoFilters.getAttr(filter, _attrSqlParamValue, type, DBNull.Value);

                    fInfo.flagRequire = sInfoFilters.getBoolAttr(filter, _attrRequire);
                    fInfo.flagMulti   = sInfoFilters.getBoolAttr(filter, _attrMulti);
                    //
                    _filters.Add(new ImplFilter(_environment, this, fInfo));
                }
            }
        }
Esempio n. 2
0
        public string formatlistarr(string[] vars)
        {
            if (vars.Length < 3)
            {
                throw new MyException.MyExceptionError(MessageCollection.T_MSG_ERROR_INVALID_ARGS_COUNT);
            }

            StringBuilder sb = new StringBuilder();


            string format_ = getVar(vars[0]).ToString();
            string arr_    = getVar(vars[1]).ToString();

            if (!string.IsNullOrEmpty(arr_))
            {
                string join_ = getVar(vars[2]).ToString();

                string[] typesTmp_ = ToolArray.sub <string>(vars, 3);
                Type[]   types_    = new Type[typesTmp_.Length];

                for (int i = 0; i < types_.Length; ++i)
                {
                    types_[i] = ToolType.parse(typesTmp_[i]);
                }


                string[][] values_ = ToolString.explodeGroupList(arr_);


                for (int x = 0; x < values_.Length; ++x)
                {
                    string[] itms  = values_[x];
                    object[] data_ = new object[itms.Length];

                    for (int i = 0; i < data_.Length; ++i)
                    {
                        Type type_ = i < types_.Length ? types_[i] : ToolTypeSet.helper.tString;

                        data_[i] = PARSE(itms[i], type_);
                    }

                    sb.Append(string.Format(format_, data_));
                    if (x < values_.Length - 1)
                    {
                        sb.Append(join_);
                    }
                }
            }

            return(sb.ToString());
        }
Esempio n. 3
0
 private void initRenders(string pLocation, ISettings sInfoFilters)
 {
     _reports      = new List <IReport>();
     _reportsNames = new List <string>();
     string[][] repData = ToolString.explodeGroupList(sInfoFilters.getString(_varListRender));
     foreach (string[] grp in repData)
     {
         if (grp.Length == 2)
         {
             _reportsNames.Add(_environment.translate(grp[0]));
             _reports.Add(new ImplXmlReport(Path.Combine(pLocation, grp[1]), _environment));
         }
     }
 }
        void outToPrinter()
        {
            string text_ = renderingData;

            if (isHtml(text_))
            {
                share();
                return;
            }



            text_ = openSpeChar(text_);

            Encoding enc = this.renderingInfo.encoding != string.Empty ? Encoding.GetEncoding(this.renderingInfo.encoding) : Encoding.ASCII;

            if (this.renderingInfo.replace != string.Empty)
            {
                StringBuilder sb       = new StringBuilder(text_);
                string[][]    arrItems = ToolString.explodeGroupList(this.renderingInfo.replace);
                foreach (string[] arr in arrItems)
                {
                    if (arr.Length == 2)
                    {
                        sb.Replace(arr[0], arr[1]);
                    }
                }

                text_ = sb.ToString();
            }

            //
            for (int i = 0; i < renderingInfo.count; ++i)
            {
                ToolPrint.print(text_, enc);
            }
        }