当前位置: 首页>>代码示例>>C#>>正文


C# CY.GetAnnexs方法代码示例

本文整理汇总了C#中CY.GetAnnexs方法的典型用法代码示例。如果您正苦于以下问题:C# CY.GetAnnexs方法的具体用法?C# CY.GetAnnexs怎么用?C# CY.GetAnnexs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CY的用法示例。


在下文中一共展示了CY.GetAnnexs方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConstructorImgUrlManu

 protected string ConstructorImgUrlManu(CY.CSTS.Core.Business.ManufacturerRepository manu)
 {
     string url = string.Empty;
     try
     {
         IEnumerable<CY.CSTS.Core.Business.Annex> annexes = manu.GetAnnexs(CY.Utility.Common.AnnexUtility.ImgAnnexType);
         if (annexes != null && annexes.Count() > 0)
         {
             url = annexes.First().AnnexURI;
         }
         return url;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:17,代码来源:ExhibitionIndex.aspx.cs

示例2: ConstructorImgUrl

 protected string ConstructorImgUrl(CY.CSTS.Core.Business.view_INSTRUMENT inst)
 {
     string url = string.Empty;
     try
     {
         IEnumerable<CY.CSTS.Core.Business.Annex> annexes = inst.GetAnnexs(CY.Utility.Common.AnnexUtility.ImgAnnexType);
         if (annexes != null && annexes.Count() > 0)
         {
             url = annexes.First().AnnexURI;
         }
         return url;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:17,代码来源:ExhibitionIndex.aspx.cs

示例3: VideosDataBind

 /********************************中间***********************************/
 /// <summary>
 /// 视频信息绑定
 /// </summary>
 /// <param name="instrument"></param>
 protected void VideosDataBind(CY.CSTS.Core.Business.view_INSTRUMENT instrument)
 {
     try
     {
         if (instrument != null)
         {
             IEnumerable<CY.CSTS.Core.Business.Annex> videos = instrument.GetAnnexs(CY.Utility.Common.AnnexUtility.VideoAnneType);
             if (videos != null)
             {
                 rpVideo.DataSource = videos;
                 rpVideo.DataBind();
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:24,代码来源:InstrumentDetail.aspx.cs

示例4: InitialCarolImg

 protected void InitialCarolImg(ref  CY.CSTS.Core.Business.view_INSTRUMENT instrument, ref  IEnumerable<CY.CSTS.Core.Business.Annex> imgs, ref int count)
 {
     try
     {
         if (instrument != null)
         {
             imgs = instrument.GetAnnexs(CY.Utility.Common.AnnexUtility.ImgAnnexType);
             if (imgs != null)
             {
                 count = imgs.Count();
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:18,代码来源:InstrumentDetail.aspx.cs

示例5: ConstructorUrl

        protected string ConstructorUrl(CY.CSTS.Core.Business.view_INSTRUMENT instrument)
        {
            StringBuilder sbResult = new StringBuilder();
            string defaultPath = CY.Utility.Common.CodeInterface.DefaultImg.InstrumentDefaultImg.Dir +
                CY.Utility.Common.CodeInterface.DefaultImg.InstrumentDefaultImg.Name +
                CY.Utility.Common.CodeInterface.DefaultImg.InstrumentDefaultImg.Extention;
            string physicalRootPath = CY.Utility.Common.RequestUtility.CurPhysicalApplicationPath;
            try
            {
                sbResult.Append("[");

                if (instrument != null)
                {
                    CY.CSTS.Core.Business.AnnexType type = CY.CSTS.Core.Business.AnnexType.SelectAnnexTypeByTypeName(
                          CY.Utility.Common.AnnexUtility.ImgAnnexType
                        );

                    if (type == null)
                    {
                        type = new CY.CSTS.Core.Business.AnnexType() { TypeName = CY.Utility.Common.AnnexUtility.ImgAnnexType };
                        type.Save();
                    }

                    IEnumerable<CY.CSTS.Core.Business.Annex> imgs = instrument.GetAnnexs(CY.Utility.Common.AnnexUtility.ImgAnnexType);

                    if (imgs != null && imgs.Count() > 0)
                    {
                        string smallPath = string.Empty;

                        string middlePath = string.Empty;

                        string bigPath = string.Empty;

                        string virtualPath = string.Empty;

                        defaultPath = imgs.First().AnnexURI;

                        foreach (CY.CSTS.Core.Business.Annex i in imgs)
                        {
                            sbResult.Append("{");

                            virtualPath = CY.Utility.Common.SiteUtility.CurHttpContext.Server.MapPath(i.AnnexURI);

                            if (!string.IsNullOrEmpty(CY.Utility.Common.FileUtility.GetFileExtension(i.AnnexURI)))

                            smallPath = CY.Utility.Common.FileUtility.GetFileDirPath(virtualPath) +
                                CY.Utility.Common.FileUtility.GetFileName(virtualPath) +
                                CY.Utility.Common.CodeInterface.ImgInfo.SmallImg +
                                CY.Utility.Common.FileUtility.GetFileExtension(virtualPath);

                            middlePath = CY.Utility.Common.FileUtility.GetFileDirPath(virtualPath) +
                                CY.Utility.Common.FileUtility.GetFileName(virtualPath) +
                                CY.Utility.Common.CodeInterface.ImgInfo.MiddleImg +
                                CY.Utility.Common.FileUtility.GetFileExtension(virtualPath);

                            bigPath = CY.Utility.Common.FileUtility.GetFileDirPath(virtualPath) +
                                CY.Utility.Common.FileUtility.GetFileName(virtualPath) +
                                CY.Utility.Common.CodeInterface.ImgInfo.BigImg +
                                CY.Utility.Common.FileUtility.GetFileExtension(virtualPath);

                            if (string.IsNullOrEmpty(CY.Utility.Common.FileUtility.GetFileExtension(i.AnnexURI)))
                            {

                                smallPath = "/Content/Default/InstrumentDefault.jpg";

                            }

                            if (string.IsNullOrEmpty(CY.Utility.Common.FileUtility.GetFileExtension(i.AnnexURI)))
                            {

                                middlePath = "/Content/Default/InstrumentDefault.jpg";

                            }

                            if (string.IsNullOrEmpty(CY.Utility.Common.FileUtility.GetFileExtension(i.AnnexURI)))
                            {

                                bigPath = "/Content/Default/InstrumentDefault.jpg";

                            }

                            if (!string.IsNullOrEmpty(CY.Utility.Common.FileUtility.GetFileExtension(i.AnnexURI)))
                            {
                                sbResult.Append(string.Format("small:'{0}'", CY.Utility.Common.StringUtility.EscapeString(
                                    File.Exists(smallPath) ? CY.Utility.Common.FileUtility.GetHttpDirPath(@i.AnnexURI.Replace("\\", "/")) + @i.Name + "_small" + CY.Utility.Common.FileUtility.GetFileExtension(@i.AnnexURI) : defaultPath
                                    )));

                                sbResult.Append(string.Format(",middle:'{0}'", CY.Utility.Common.StringUtility.EscapeString(
                                    File.Exists(middlePath) ? CY.Utility.Common.FileUtility.GetHttpDirPath(@i.AnnexURI.Replace("\\", "/")) + @i.Name + "_middle" + CY.Utility.Common.FileUtility.GetFileExtension(@i.AnnexURI) : defaultPath
                                   )));

                                sbResult.Append(string.Format(",big:'{0}'", CY.Utility.Common.StringUtility.EscapeString(
                                    File.Exists(bigPath) ? CY.Utility.Common.FileUtility.GetHttpDirPath(@i.AnnexURI.Replace("\\", "/")) + @i.Name + "_big" + CY.Utility.Common.FileUtility.GetFileExtension(@i.AnnexURI) : defaultPath
                                   )));
                            }
                            else {
                                sbResult.Append(string.Format("small:'{0}'", CY.Utility.Common.StringUtility.EscapeString(
                                   smallPath
                                   )));

//.........这里部分代码省略.........
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:101,代码来源:GetInstrumentImgs.ashx.cs

示例6: ConstructorImgUrl

        private string ConstructorImgUrl(CY.CSTS.Core.Business.view_INSTRUMENT inst, ref Guid imgid)
        {
            string url = string.Empty;
            try
            {
                IEnumerable<CY.CSTS.Core.Business.Annex> annexes = inst.GetAnnexs(CY.Utility.Common.AnnexUtility.ImgAnnexType);
                if (annexes != null && annexes.Count() > 0)
                {

                    url = annexes.First().AnnexURI.Replace("\\", "/");
                    if (string.IsNullOrEmpty(CY.Utility.Common.FileUtility.GetFileExtension(url))) {
                        url = "/Content/Default/InstrumentDefault.jpg";
                    }
                    imgid = annexes.First().Id;
                }
                else
                {
                    url = "/Content/Default/InstrumentDefault.jpg";
                }
                return url;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:26,代码来源:GetInstrumentList.ashx.cs


注:本文中的CY.GetAnnexs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。