Beispiel #1
0
        //private void GenFromClause(ref GenOsqlParamInfo paramInfo)
        //{
        //    paramInfo.FormClause = paramInfo.DomainInfo.DSDomainData.GetFromClause(paramInfo.DSRelationRow, AppDbTypes.Oracle);
        //}
        #endregion

        #region gen for xml clause
        private void GenForXmlClause(ref GenOsqlParamInfo paramInfo)
        {
            paramInfo.OsqlXmlItem       = new OsqlXmlItem();
            paramInfo.OsqlXmlItem.Paths = new List <OsqlXmlItemPath>();
            foreach (OsqlStringBuilder item in paramInfo.OsqlStringBuilders)
            {
                OsqlXmlItemPath osqlXmlItemPath = new OsqlXmlItemPath();
                osqlXmlItemPath.Osql = item.Osql.ToString().TrimEnd();
                osqlXmlItemPath.JSql = item.JOsql.ToString().TrimEnd();
                if (!string.IsNullOrWhiteSpace(item.SelectedColumns))
                {
                    if (item.SelectedColumns.StartsWith(","))
                    {
                        osqlXmlItemPath.SelectedColumns = item.SelectedColumns.Remove(0, 1);
                    }
                    else
                    {
                        osqlXmlItemPath.SelectedColumns = item.SelectedColumns;
                    }
                }

                paramInfo.OsqlXmlItem.Paths.Add(osqlXmlItemPath);
            }
            paramInfo.OsqlXmlItem.Index            = paramInfo.IndexOfDomain;
            paramInfo.OsqlXmlItem.DomainName       = paramInfo.DomainInfo.DSDomainData.Name;
            paramInfo.OsqlXmlItem.EncodeDomainName = BaseMarkupUtilities.XmlEncode(paramInfo.DomainInfo.DSDomainData.Name);
        }
Beispiel #2
0
        //private void GenFromClause(ref GenOsqlParamInfo paramInfo)
        //{
        //    paramInfo.FormClause = paramInfo.DomainInfo.DSDomainData.GetFromClause(paramInfo.DSRelationRow);
        //}
        #endregion

        #region gen for xml clause
        private void GenForXmlClause(ref GenOsqlParamInfo paramInfo)
        {
            //For XML Auto
            string forXml        = string.Empty;
            string domainEncoded = BaseMarkupUtilities.XmlEncode(paramInfo.IbmDomain.DomainName);

            if (paramInfo.HasField)
            {
                if (!paramInfo.IsNeedInKeyword)
                {
                    forXml = string.Format(Sql08QueryConstants.XmlAuto.ForXMLAuto, domainEncoded);
                }
                else
                {
                    forXml = string.Format(Sql08QueryConstants.XmlAuto.ForXMLAutoIn, domainEncoded);
                }
            }
            else
            {
                string rootTable = paramInfo.SelectedTables[0][0];
                if (!paramInfo.IsNeedInKeyword)
                {
                    forXml = string.Format(Sql08QueryConstants.XmlAuto.ForXMLAutoIn, rootTable, domainEncoded);
                }
                else
                {
                    forXml = string.Format(Sql08QueryConstants.XmlAuto.ForXMLRawIn, rootTable, domainEncoded);
                }
            }

            paramInfo.OsqlXmlItem       = new OsqlXmlItem();
            paramInfo.OsqlXmlItem.Paths = new List <OsqlXmlItemPath>();
            foreach (OsqlStringBuilder item in paramInfo.OsqlStringBuilders)
            {
                item.AppendLine(forXml);

                //Prepare for return
                if (paramInfo.HasImage)
                {
                    item.Append(Sql08QueryConstants.SQLBase64);
                }

                OsqlXmlItemPath osqlXmlItemPath = new OsqlXmlItemPath();
                osqlXmlItemPath.Osql = item.Osql.ToString().TrimEnd();
                osqlXmlItemPath.JSql = item.JOsql.ToString().TrimEnd();

                if (paramInfo.IsNeedInKeyword)
                {
                    osqlXmlItemPath.Osql = string.Format(Sql08QueryConstants.SQLWithIn, osqlXmlItemPath.Osql);
                    osqlXmlItemPath.JSql = string.Format(Sql08QueryConstants.SQLWithIn, osqlXmlItemPath.JSql);
                }
                paramInfo.OsqlXmlItem.Paths.Add(osqlXmlItemPath);
            }
            paramInfo.OsqlXmlItem.Index            = paramInfo.IndexOfDomain;
            paramInfo.OsqlXmlItem.DomainName       = paramInfo.DomainInfo.DSDomainData.Name;
            paramInfo.OsqlXmlItem.EncodeDomainName = BaseMarkupUtilities.XmlEncode(paramInfo.DomainInfo.DSDomainData.Name);
        }
Beispiel #3
0
        private string ImportPdeChart(Word.Document wDoc, string chartName, string chartContent)
        {
            string chartPath = AssetManager.FileAdapter.GenRandomFilePath(ChartExtension);
            string bmValue   = MarkupUtilities.GenTextXslTag(chartName, XsltType.Select, true);
            string bmName    = BaseMarkupUtilities.XmlEncode(chartName);

            // create temporary image
            bmName = string.Format("{0}{1}{2}", MarkupConstant.MarkupPdeTag, bmName, MarkupConstant.MarkupPdeChart);
            ProntoDoc.Framework.Utils.FileHelper.FileFromBase64(chartContent, chartPath);

            // delete old bm
            Word.Bookmark oldBm = null;
            foreach (Word.Bookmark bookmark in wDoc.Bookmarks)
            {
                if (string.Equals(bmName, bookmark.Name, StringComparison.OrdinalIgnoreCase))
                {
                    oldBm = bookmark;
                    break;
                }
            }
            if (oldBm != null)
            {
                oldBm.Delete();
            }

            // add image into word
            wDoc.Application.Selection.TypeText(" ");
            Word.InlineShape inlineShape = wDoc.Application.Selection.InlineShapes.AddPicture(chartPath, false, true);
            inlineShape.AlternativeText = MarkupUtilities.CreateAlternativeText(bmName, bmValue);

            // add bookmark
            wDoc.Application.Selection.MoveLeft(Word.WdUnits.wdCharacter, 1);
            wDoc.Application.Selection.MoveRight(Word.WdUnits.wdCharacter, 1, Word.WdMovementType.wdExtend);
            wDoc.Bookmarks.Add(bmName, wDoc.Application.Selection.Range);
            wDoc.Application.Selection.MoveRight(Word.WdUnits.wdCharacter);

            // delete temporary file
            System.IO.File.Delete(chartPath);

            return(bmName);
        }
Beispiel #4
0
        private List <string> GetPdeSelectedTables(string key, bool includeKey = true)
        {
            List <string>  paths      = new List <string>();
            PdeDataTagInfo pdeTagInfo = _ibm.GetPdeDataTagInfo(key);

            // root node
            paths.Add(ProntoDoc.Framework.CoreObject.FrameworkConstants.PdeExportedRootName);

            // stn node
            paths.Add(pdeTagInfo.STN);

            // kind of data
            switch (pdeTagInfo.MapType)
            {
            case MapType.Table:
                paths.Add(MarkupConstant.PdeExportTable);
                paths.Add(pdeTagInfo.ParentName);
                break;

            case MapType.SingleCell:
                paths.Add(MarkupConstant.PdeExportField);
                break;

            case MapType.Chart:
                paths.Add(MarkupConstant.PdeExportChart);
                break;

            default:
                break;
            }

            // its path
            if (includeKey)
            {
                paths.Add(pdeTagInfo.MapType == MapType.Chart ? BaseMarkupUtilities.XmlEncode(pdeTagInfo.ExcelName) : pdeTagInfo.ExcelName);
            }

            return(paths);
        }
Beispiel #5
0
        /// <summary>
        /// gen key of Icon
        /// </summary>
        /// <param name="dbid"></param>
        /// <param name="customerIconID"></param>
        /// <returns></returns>
        public static string GenKey(string dbid, string customerIconID)
        {
            string key = string.Format("img{0}{1}{2}", dbid, (char)27, customerIconID);

            return(BaseMarkupUtilities.XmlEncode(key));
        }