本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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
)));
//.........这里部分代码省略.........
示例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;
}
}