本文整理汇总了C#中Lfx类的典型用法代码示例。如果您正苦于以下问题:C# Lfx类的具体用法?C# Lfx怎么用?C# Lfx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Lfx类属于命名空间,在下文中一共展示了Lfx类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MostrarProgreso
public void MostrarProgreso(IList<Lfx.Types.OperationProgress> operaciones, Lfx.Types.OperationProgress progreso)
{
this.Progreso = progreso;
this.TopMost = progreso.Modal;
ProgressBar.Maximum = progreso.Max;
if (ProgressBar.Value > 0)
ProgressBar.Style = ProgressBarStyle.Continuous;
else
ProgressBar.Style = ProgressBarStyle.Marquee;
EtiquetaNombreOperacion.Text = progreso.Name;
if (operaciones.Count > 1)
EtiquetaOtrasOperaciones.Text = "(Hay otras operaciones pendientes)";
EtiquetaEstado.Text = progreso.Status;
EtiquetaDescripcion.Text = progreso.Description;
if (progreso.Value < ProgressBar.Minimum)
ProgressBar.Value = ProgressBar.Minimum;
else if (progreso.Value > ProgressBar.Maximum)
ProgressBar.Value = ProgressBar.Maximum;
else
ProgressBar.Value = progreso.Value;
BotonCancelar.Visible = progreso.Cancelable;
this.Refresh();
}
示例2: OnItemAdded
protected override void OnItemAdded(ListViewItem item, Lfx.Data.Row row)
{
string TamanoPapel = row["tamanopapel"].ToString();
switch(TamanoPapel) {
case "a4":
item.SubItems["sys_plantillas.tamanopapel"].Text = "A4";
break;
case "a5":
item.SubItems["sys_plantillas.tamanopapel"].Text = "A5";
break;
case "letter":
item.SubItems["sys_plantillas.tamanopapel"].Text = "Carta";
break;
case "legal":
item.SubItems["sys_plantillas.tamanopapel"].Text = "Oficio";
break;
case "cont":
item.SubItems["sys_plantillas.tamanopapel"].Text = "Continuo";
break;
default:
item.SubItems["sys_plantillas.tamanopapel"].Text = TamanoPapel.ToTitleCase();
break;
}
base.OnItemAdded(item, row);
}
示例3: OnItemAdded
protected override void OnItemAdded(ListViewItem item, Lfx.Data.Row row)
{
switch (row.Fields["conceptos.es"].ValueInt) {
case 1:
item.SubItems["conceptos.es"].Text = "Entrada";
break;
case 2:
item.SubItems["conceptos.es"].Text = "Salida";
break;
case 0:
item.SubItems["conceptos.es"].Text = "Entrada/Salida";
break;
default:
item.SubItems["conceptos.es"].Text = "???";
break;
}
switch (row.Fields["conceptos.grupo"].ValueInt) {
case 0:
item.SubItems["conceptos.grupo"].Text = "-";
break;
case 110:
item.SubItems["conceptos.grupo"].Text = "Cobros";
break;
case 100:
item.SubItems["conceptos.grupo"].Text = "Otros ingresos";
break;
case 230:
item.SubItems["conceptos.grupo"].Text = "Gastos fijos";
break;
case 240:
item.SubItems["conceptos.grupo"].Text = "Gastos variables";
break;
case 200:
item.SubItems["conceptos.grupo"].Text = "Otros gastos";
break;
case 260:
item.SubItems["conceptos.grupo"].Text = "Pérdida";
break;
case 250:
item.SubItems["conceptos.grupo"].Text = "Reinversión";
break;
case 210:
item.SubItems["conceptos.grupo"].Text = "Costo materiales";
break;
case 220:
item.SubItems["conceptos.grupo"].Text = "Costo capital";
break;
case 231:
item.SubItems["conceptos.grupo"].Text = "Sueldos y salarios";
break;
case 300:
item.SubItems["conceptos.grupo"].Text = "Movimientos y ajustes";
break;
default:
item.SubItems["conceptos.grupo"].Text = "???";
break;
}
}
示例4: Desduplicador
public Desduplicador(Lfx.Data.Connection dataBase, string tablaOriginal, string campoIdOriginal, int idOriginal, int idDuplicado)
{
this.DataBase = dataBase;
this.TablaOriginal = tablaOriginal;
this.CampoIdOriginal = campoIdOriginal;
this.IdOriginal = idOriginal;
this.IdDuplicado = idDuplicado;
}
示例5: Field
public Field(string name, string label, Lfx.Data.InputFieldTypes dataType)
: this(name, label)
{
this.DataType = dataType;
if (this.Width < 28) {
this.Visible = false;
this.Printable = false;
}
}
示例6: Cupon
public Cupon(Lfx.Data.Connection dataBase, decimal importe, Pagos.FormaDePago tarjeta, Pagos.Plan plan, string numero, string autorizacion)
: this(dataBase)
{
Importe = importe;
FormaDePago = tarjeta;
Plan = plan;
Numero = numero;
Autorizacion = autorizacion;
}
示例7: Connection
public Connection(Lfx.Workspace workspace, string ownerName)
{
this.RequiresTransaction = true;
Lfx.Workspace.Master.ActiveConnections.Add(this);
this.Handle = LastHandle++;
this.Name = ownerName;
if (Lfx.Data.DataBaseCache.DefaultCache == null)
Lfx.Data.DataBaseCache.DefaultCache = new DataBaseCache(this);
}
示例8: RegisteredType
public RegisteredType(Type tipo, Lfx.Components.ActionCollection actions)
{
if (tipo.GetInterface("Lbl.IElementoDeDatos", false) == null)
throw new ArgumentException("tipo debe ser un derivado de Lbl.ElementoDeDatos");
this.LblType = tipo;
this.Actions = new ActionCollection();
if (actions != null)
this.Actions.AddRange(actions);
}
示例9: Cheque
public Cheque(Lfx.Data.Connection dataBase, decimal importe, int numero, string emisor, NullableDateTime fechaEmision, NullableDateTime fechaCobro, Bancos.Banco banco)
: this(dataBase)
{
this.Importe = importe;
this.Numero = numero;
this.Emisor = emisor;
this.FechaEmision = fechaEmision;
this.FechaCobro = fechaCobro;
this.Banco = banco;
}
示例10: FromRow
protected void FromRow(Lfx.Data.Row fromRow)
{
this.Id = System.Convert.ToInt32(fromRow["id_usuario"]);
int IdUsuario = System.Convert.ToInt32(fromRow["id_usuario"]);
if (IdUsuario != 0)
this.Persona = new Personas.Persona(Lfx.Workspace.Master.MasterConnection, IdUsuario);
this.Nombre = fromRow["nombre"].ToString();
this.Estacion = fromRow["estacion"].ToString();
this.Estado = System.Convert.ToInt32(fromRow["estado"]);
this.Fecha = System.Convert.ToDateTime(fromRow["fecha"]);
}
示例11: Tag
public Tag(Connection dataBase, string tableName, Lfx.Data.Row fromRow)
{
this.DataBase = dataBase;
this.TableName = tableName;
this.Id = System.Convert.ToInt32(fromRow["id_tag"]);
this.FieldName = fromRow["fieldname"].ToString();
this.Label = fromRow["label"].ToString();
if (fromRow["extra"] != null)
this.Extra = fromRow["extra"].ToString();
string FldType = fromRow["fieldtype"].ToString();
switch(FldType) {
case "relation":
this.FieldType = DbTypes.Integer;
string[] RelationFields = this.Extra.Split(new char[] { ',' });
string ReferenceTable = RelationFields[0], ReferenceColumn, DetailColumn;
if(RelationFields.Length >= 2)
ReferenceColumn = RelationFields[1];
else
ReferenceColumn = dataBase.Tables[ReferenceTable].PrimaryKey;
if(RelationFields.Length >= 3)
DetailColumn = RelationFields[2];
else
DetailColumn = "nombre";
this.Relation = new Relation(this.FieldName, ReferenceTable, ReferenceColumn, DetailColumn);
if (RelationFields.Length >= 4)
LblType = RelationFields[3];
else
LblType = null;
break;
default:
this.FieldType = Lfx.Data.Types.FromSqlType(FldType);
break;
}
if (fromRow["inputtype"] != null && fromRow["inputtype"].ToString() != string.Empty)
this.InputFieldType = (Lfx.Data.InputFieldTypes)(Enum.Parse(typeof(Lfx.Data.InputFieldTypes), fromRow["inputtype"].ToString()));
this.Nullable = System.Convert.ToBoolean(fromRow["fieldnullable"]);
this.Internal = System.Convert.ToBoolean(fromRow["internal"]);
this.Access = System.Convert.ToInt32(fromRow["access"]);
this.DefaultValue = fromRow["fielddefault"];
if (this.DefaultValue is DBNull)
this.DefaultValue = null;
}
示例12: OnItemAdded
protected override void OnItemAdded(ListViewItem item, Lfx.Data.Row row)
{
int IdBanco = Lfx.Types.Parsing.ParseInt(item.SubItems["cajas.id_banco"].Text);
if (IdBanco != 0)
item.SubItems["cajas.id_banco"].Text = this.Connection.Tables["bancos"].FastRows[IdBanco].Fields["nombre"].ValueString;
int IdCaja = Lfx.Types.Parsing.ParseInt(item.Text);
decimal Saldo = this.Connection.FieldDecimal("SELECT saldo FROM cajas_movim WHERE id_caja=" + IdCaja.ToString() + " ORDER BY id_movim DESC LIMIT 1");
decimal Pasivos = this.Connection.FieldDecimal("SELECT SUM(importe) FROM bancos_cheques WHERE estado IN (0, 5) AND emitido=1 AND id_chequera IN (SELECT chequeras.id_chequera FROM chequeras WHERE estado=1 AND id_caja=" + IdCaja.ToString() + ")");
this.Contadores[0].AddValue(Saldo);
if (Saldo > 0)
this.Contadores[1].AddValue(Saldo);
item.SubItems["0"].Text = Lfx.Types.Formatting.FormatCurrency(Saldo, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales);
item.SubItems["1"].Text = Lfx.Types.Formatting.FormatCurrency(Saldo - Pasivos, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales);
}
示例13: 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;
}
示例14: SetCommand
public SetCommand(Lfx.Data.Connection dataBase, string setParameters)
: base(dataBase)
{
this.SetParameters = setParameters;
}
示例15: BeginTransactionCommand
public BeginTransactionCommand(Lfx.Data.Connection dataBase)
: base(dataBase) { }