本文整理汇总了C#中Lfx.FieldInt方法的典型用法代码示例。如果您正苦于以下问题:C# Lfx.FieldInt方法的具体用法?C# Lfx.FieldInt怎么用?C# Lfx.FieldInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lfx
的用法示例。
在下文中一共展示了Lfx.FieldInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProductImage
public static System.Drawing.Image ProductImage(Lfx.Data.Connection dataBase, int productId, DownloadImage downloadImage)
{
string CachePath = Lfx.Environment.Folders.CacheFolder;
string ImageFileName = "product_" + productId.ToString() + ".jpg";
bool ImageInCache = System.IO.File.Exists(CachePath + ImageFileName);
if(downloadImage == DownloadImage.Always
|| (downloadImage == DownloadImage.OnlyIfNotInCache && ImageInCache == false)
|| ((downloadImage == DownloadImage.PreferCacheOnSlowLinks && ImageInCache == false) || Lfx.Workspace.Master.SlowLink == false))
{
//Download image and save to cache
Lfx.Data.Row ImagenDB = dataBase.Row("articulos_imagenes", "imagen", "id_articulo", productId);
if (ImagenDB != null && ImagenDB.Fields["imagen"].Value != null && ((byte[])(ImagenDB.Fields["imagen"].Value)).Length > 5)
{
//Guardar imagen en cache
System.IO.BinaryWriter wr = new System.IO.BinaryWriter(System.IO.File.OpenWrite(CachePath + ImageFileName), System.Text.Encoding.Default);
wr.Write(((byte[])(ImagenDB.Fields["imagen"].Value)));
wr.Close();
byte[] ByteArr = ((byte[])(ImagenDB.Fields["imagen"].Value));
System.Drawing.Image Img;
using (System.IO.MemoryStream loStream = new System.IO.MemoryStream(ByteArr)) {
Img = System.Drawing.Image.FromStream(loStream);
}
return Img;
}
else
{
//Devuelve la imagen de la categoría, en lugar de la del artículo
int CategoriaArticulo = dataBase.FieldInt("SELECT id_categoria FROM articulos WHERE id_articulo=" + productId.ToString());
return CategoryImage(dataBase, CategoriaArticulo, downloadImage);
}
}
//Serve only from cache
if(ImageInCache)
{
return System.Drawing.Image.FromFile(CachePath + ImageFileName);
}
return null;
}
示例2: Cupon
public Cupon(Lfx.Data.Connection dataBase, Lbl.Comprobantes.ComprobanteConArticulos factura)
: this(dataBase)
{
m_ItemId = dataBase.FieldInt("SELECT MAX(id_cupon) FROM tarjetas_cupones WHERE id_comprob=" + factura.Id.ToString());
this.Cargar();
}