private string GetSettingFonts(string fontType, string fontDefault)
        {
            var font = _settingsProvider.GetSetting(fontType);

            if (font == null || string.IsNullOrEmpty(font.Value))
            {
                AppSettingRecord setFont = new AppSettingRecord();
                // todo: maybe it would be better to gather all label/envelopes settings in specific table
                if (fontType == Settings.LabelsFont)
                {
                    setFont.SettingID = 7;
                }
                else if (fontType == Settings.EnvelopesFont)
                {
                    setFont.SettingID = 8;
                }
                else
                {
                    return(fontDefault);
                }
                setFont.Setting  = fontType;
                setFont.Value    = fontDefault;
                setFont.ParentID = null;
                _settingsProvider.CreateSetting(setFont);
                return(fontDefault);
            }
            return(font.Value);
        }
示例#2
0
        public bool CreateSetting(AppSettingRecord NewSetting)
        {
            var query = QueryProvider.CreateQuery <InsertSettingStoredProcedure>(_schema);

            // applying parameters
            query.SettingID = NewSetting.SettingID;
            query.Setting   = NewSetting.Setting;
            query.Value     = NewSetting.Value;
            query.ParentID  = NewSetting.ParentID;
            return(!query.Execute().NonZeroReturnCode);
        }
示例#3
0
        public LetterFieldsDto GetLetterFields(int transactionId, int?[] subCategoryIds = null, bool includeSubCats = true, string currency = "$")
        {
            AppSettingRecord defClasses = _settingsProvider.GetSetting(Settings.DefaultClasses);

            var select = QueryProvider.CreateQuery <SelectFieldsForLetterStoredProcedure>(_schema);

            select.TransactionId  = transactionId;
            select.ClassesOn      = Convert.ToBoolean(defClasses.Value);
            select.SubCategoryIds = subCategoryIds;
            select.SubCatInclude  = includeSubCats;

            LetterFieldsDto fields = select.Execute().FirstRow <LetterFieldsDto>();

            ParseXMLFields(ref fields);

            MakeFieldsInRegionalStandarts(ref fields, currency);

            return(fields);
        }