Esempio n. 1
0
                public override void OnFiltersChanged(Lazaro.Pres.Filters.FilterCollection filters)
                {
                        this.CustomFilters.Clear();

                        if (((Lazaro.Pres.Filters.SetFilter)(filters["pvs.tipo"])).CurrentValue != "*")
                                CustomFilters.AddWithValue("pvs.tipo", Lfx.Types.Parsing.ParseInt(filters[0].Value.ToString()));

                        base.OnFiltersChanged(filters);
                }
Esempio n. 2
0
                public override void OnFiltersChanged(Lazaro.Pres.Filters.FilterCollection filters)
                {
                        this.CustomFilters.Clear();

                        if (((Lazaro.Pres.Filters.SetFilter)(filters["articulos_categorias.cache_stock_actual"])).CurrentValue == "f")
                                CustomFilters.AddWithValue("articulos_categorias.stock_minimo>0 AND articulos_categorias.stock_minimo>(SELECT SUM(articulos.stock_actual) FROM articulos WHERE articulos_categorias.id_categoria=id_categoria)");

                        base.OnFiltersChanged(filters);
                }
Esempio n. 3
0
                public ImpresorListado(Lazaro.Pres.Spreadsheet.Sheet sheet, IDbTransaction transaction)
                        : base(transaction)
                {
                        this.Sheet = sheet;

                        // Calculo el ancho de todas las columnas
                        HeaderTotalWidth = 0;
                        for (int i = 0; i < Sheet.ColumnHeaders.Count; i++) {
                                if (i != this.Sheet.ColumnHeaders.DetailColumn && this.Sheet.ColumnHeaders[i].Printable)
                                        HeaderTotalWidth += Sheet.ColumnHeaders[i].Width;
                        }

                        this.DefaultPageSettings.Landscape = HeaderTotalWidth > 1600;
                        this.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins((int)(10 * mm), (int)(10 * mm), (int)(10 * mm), (int)(10 * mm));
                }
Esempio n. 4
0
                public void FromSheet(Lazaro.Pres.Spreadsheet.Sheet sheet)
                {
                        this.SuspendLayout();
                        this.BeginUpdate();

                        this.Items.Clear();
                        this.View = System.Windows.Forms.View.Details;
                        this.FullRowSelect = true;
                        this.GridLines = true;
                        this.Groups.Clear();

                        if (sheet.BackColor != System.Drawing.Color.Empty)
                                this.BackColor = sheet.BackColor;
                        if (sheet.ForeColor != System.Drawing.Color.Empty)
                                this.ForeColor = sheet.ForeColor;

                        if (sheet.ColumnHeaders != null) {
                                this.Columns.Clear();
                                foreach (Lazaro.Pres.Spreadsheet.ColumnHeader ch in sheet.ColumnHeaders) {
                                        System.Windows.Forms.ColumnHeader Col = this.Columns.Add(ch.Text, ch.Width);
                                        switch (ch.TextAlignment) {
                                                case Lfx.Types.StringAlignment.Near:
                                                        Col.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
                                                        break;
                                                case Lfx.Types.StringAlignment.Far:
                                                        Col.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
                                                        break;
                                        }
                                }
                        }

                        System.Windows.Forms.ListViewGroup LastGroup = null;

                        foreach (Lazaro.Pres.Spreadsheet.Row rw in sheet.Rows) {
                                if (rw is Lazaro.Pres.Spreadsheet.HeaderRow) {
                                        LastGroup = new System.Windows.Forms.ListViewGroup(rw.Cells[0].Content.ToString());
                                        this.Groups.Add(LastGroup);
                                } else {
                                        System.Windows.Forms.ListViewItem Itm = new System.Windows.Forms.ListViewItem();

                                        if (rw is Lazaro.Pres.Spreadsheet.AggregationRow) {
                                                //Itm.BackColor = System.Drawing.Color.LightGray;
                                                Itm.Font = new System.Drawing.Font(Itm.Font, System.Drawing.FontStyle.Bold);
                                        }

                                        if (LastGroup != null) {
                                                Itm.Group = LastGroup;
                                        }

                                        if (rw.BackColor != System.Drawing.Color.Empty)
                                                Itm.BackColor = rw.BackColor;
                                        if (rw.ForeColor != System.Drawing.Color.Empty)
                                                Itm.ForeColor = rw.ForeColor;

                                        int i = 0;
                                        foreach (Lazaro.Pres.Spreadsheet.Cell cl in rw.Cells) {
                                                string CellString = "";
                                                if (cl.Content != null) {
                                                        switch (cl.Content.GetType().ToString()) {
                                                                case "System.Single":
                                                                case "System.Double":
                                                                case "System.Decimal":
                                                                        CellString += Lfx.Types.Formatting.FormatNumber(System.Convert.ToDecimal(cl.Content), 4);
                                                                        break;
                                                                case "System.Integer":
                                                                case "System.Int16":
                                                                case "System.Int32":
                                                                case "System.Int64":
                                                                        CellString += cl.Content.ToString();
                                                                        break;
                                                                case "System.DateTime":
                                                                        DateTime clContent = (DateTime)cl.Content;
                                                                        if (clContent.Hour == 0 && clContent.Minute == 0 && clContent.Second == 0)
                                                                                CellString += clContent.ToString(Lfx.Types.Formatting.DateTime.ShortDatePattern);
                                                                        else
                                                                                CellString += clContent.ToString(Lfx.Types.Formatting.DateTime.FullDateTimePattern);
                                                                        break;
                                                                case "System.String":
                                                                        CellString += cl.Content.ToString();
                                                                        break;
                                                        }
                                                }
                                                if (i == 0)
                                                        Itm.Text = CellString;
                                                else
                                                        Itm.SubItems.Add(CellString);
                                                i++;
                                        }
                                        this.Items.Add(Itm);
                                }
                        }
                        this.EndUpdate();
                        this.ResumeLayout();
                }
Esempio n. 5
0
                public static Lui.Forms.ListView NewListViewFromSheet(Lazaro.Pres.Spreadsheet.Sheet sheet)
                {
                        Lui.Forms.ListView Result = new Lui.Forms.ListView();
                        Result.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
                        Result.LabelEdit = false;
                        Result.LabelWrap = false;
                        Result.FromSheet(sheet);

                        return Result;
                }
Esempio n. 6
0
                public void FromFilters(Lazaro.Pres.Filters.FilterCollection filters)
                {
                        this.SuspendLayout();
                        this.TablaFiltros.SuspendLayout();
                        this.ColFiltros = filters;
                        this.TablaFiltros.RowCount = filters.Count;

                        while (TablaFiltros.RowStyles.Count < TablaFiltros.RowCount)
                                TablaFiltros.RowStyles.Add(new System.Windows.Forms.RowStyle(SizeType.AutoSize));

                        int i = 0;
                        foreach (Lazaro.Pres.Filters.IFilter Filtro in this.ColFiltros) {
                                Label Etiqueta = new Label();
                                Etiqueta.Name = "etiqueta" + i.ToString();
                                Etiqueta.Text = Filtro.Label;
                                Etiqueta.TextAlign = System.Drawing.ContentAlignment.TopLeft;
                                Etiqueta.Margin = new System.Windows.Forms.Padding(0, 4, 4, 0);
                                Etiqueta.Dock = DockStyle.Fill;
                                this.TablaFiltros.Controls.Add(Etiqueta, 0, i);

                                Control Entrada;
                                if (Filtro is Lazaro.Pres.Filters.NumericRangeFilter) {
                                        Lcc.Entrada.RangoNumerico EntradaRangoNumerico = new Lcc.Entrada.RangoNumerico();
                                        Lazaro.Pres.Filters.NumericRangeFilter FiltroNumerico = Filtro as Lazaro.Pres.Filters.NumericRangeFilter;
                                        EntradaRangoNumerico.DecimalPlaces = FiltroNumerico.DecimalPlaces;
                                        EntradaRangoNumerico.Valule1 = System.Convert.ToDecimal(FiltroNumerico.Value);
                                        EntradaRangoNumerico.Valule2 = System.Convert.ToDecimal(FiltroNumerico.Value2);
                                        EntradaRangoNumerico.Dock = DockStyle.Top;
                                        Entrada = EntradaRangoNumerico;
                                } else if (Filtro is Lazaro.Pres.Filters.SetFilter) {
                                        Lazaro.Pres.Filters.SetFilter FiltroSet = Filtro as Lazaro.Pres.Filters.SetFilter;
                                        Lui.Forms.ComboBox EntradaSet = new Lui.Forms.ComboBox();
                                        EntradaSet.SetData = FiltroSet.SetData;
                                        EntradaSet.TextKey = FiltroSet.CurrentValue;
                                        EntradaSet.Size = new System.Drawing.Size(200, 24);
                                        EntradaSet.AlwaysExpanded = EntradaSet.SetData != null && (EntradaSet.SetData.Length <= 4 || TablaFiltros.RowCount <= 6);
                                        EntradaSet.AutoSize = EntradaSet.AlwaysExpanded;
                                        EntradaSet.Dock = DockStyle.Top;
                                        Entrada = EntradaSet;
                                } else if (Filtro is Lazaro.Pres.Filters.DateRangeFilter) {
                                        Lazaro.Pres.Filters.DateRangeFilter FiltroFechas = Filtro as Lazaro.Pres.Filters.DateRangeFilter;
                                        Lcc.Entrada.RangoFechas EntradaRangoFechas = new Lcc.Entrada.RangoFechas();
                                        EntradaRangoFechas.Rango = FiltroFechas.DateRange;
                                        EntradaRangoFechas.Size = new System.Drawing.Size(160, 46);
                                        EntradaRangoFechas.AutoSize = true;
                                        EntradaRangoFechas.Dock = DockStyle.Top;
                                        Entrada = EntradaRangoFechas;
                                } else if (Filtro is Lazaro.Pres.Filters.RelationFilter) {
                                        Lazaro.Pres.Filters.RelationFilter FiltroRelacion = Filtro as Lazaro.Pres.Filters.RelationFilter;
                                        Lcc.Entrada.CodigoDetalle EntradaRelacion = new Lcc.Entrada.CodigoDetalle();
                                        EntradaRelacion.Required = false;
                                        EntradaRelacion.Size = new System.Drawing.Size(160, 24);
                                        EntradaRelacion.Relation = FiltroRelacion.Relation;
                                        if (FiltroRelacion.Filter != null)
                                                EntradaRelacion.Filter = FiltroRelacion.Filter.ToString();
                                        EntradaRelacion.Elemento = (Lbl.IElementoDeDatos)FiltroRelacion.Elemento;
                                        EntradaRelacion.Dock = DockStyle.Top;
                                        Entrada = EntradaRelacion;
                                } else {
                                        Entrada = new Label();
                                        Entrada.Text = Filtro.GetType().ToString();
                                        Etiqueta.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
                                }

                                Entrada.Name = "entrada" + i.ToString();
                                Filtro.Control = Entrada;

                                this.TablaFiltros.Controls.Add(Entrada, 1, i);
                                i++;
                        }

                        this.TablaFiltros.ResumeLayout();
                        this.ResumeLayout();
                }
                public virtual void OnFiltersChanged(Lazaro.Pres.Filters.FilterCollection filters)
                {

                }
                private string FormatValue(object cellValue, Lazaro.Pres.Field formField)
                {
                        string FieldValueAsText;

                        if (cellValue == null)
                                return "";

                        if (formField == null)
                                return cellValue.ToString();

                        switch (formField.DataType) {
                                case Lfx.Data.InputFieldTypes.Integer:
                                case Lfx.Data.InputFieldTypes.Serial:
                                        if (cellValue == null || cellValue is DBNull)
                                                FieldValueAsText = "";
                                        else if (formField.Format != null)
                                                FieldValueAsText = Lfx.Types.Parsing.ParseInt(cellValue.ToString()).ToString(formField.Format);
                                        else
                                                FieldValueAsText = Lfx.Types.Parsing.ParseInt(cellValue.ToString()).ToString();
                                        break;

                                case Lfx.Data.InputFieldTypes.Text:
                                case Lfx.Data.InputFieldTypes.Memo:
                                case Lfx.Data.InputFieldTypes.Relation:
                                        if (cellValue == null)
                                                FieldValueAsText = "";
                                        else if (cellValue is System.Byte[])
                                                FieldValueAsText = System.Text.Encoding.Default.GetString(((System.Byte[])(cellValue)));
                                        else
                                                FieldValueAsText = cellValue.ToString();
                                        break;

                                case Lfx.Data.InputFieldTypes.Currency:
                                        decimal ValorCur = (cellValue == null || cellValue is DBNull) ? 0 : System.Convert.ToDecimal(cellValue);
                                        if (ValorCur == 0)
                                                FieldValueAsText = "-";
                                        else
                                                FieldValueAsText = Lfx.Types.Formatting.FormatCurrency(ValorCur, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales);
                                        break;

                                case Lfx.Data.InputFieldTypes.Numeric:
                                        if (cellValue == null || cellValue is DBNull)
                                                FieldValueAsText = "";
                                        else
                                                FieldValueAsText = Lfx.Types.Formatting.FormatNumber(System.Convert.ToDecimal(cellValue), 2);
                                        break;

                                case Lfx.Data.InputFieldTypes.Date:
                                        if (cellValue != null) {
                                                if (formField.Format != null)
                                                        FieldValueAsText = System.Convert.ToDateTime(cellValue).ToString(formField.Format).ToTitleCase();
                                                else
                                                        FieldValueAsText = System.Convert.ToDateTime(cellValue).ToString(Lfx.Types.Formatting.DateTime.ShortDatePattern);
                                        } else {
                                                FieldValueAsText = "";
                                        }
                                        break;

                                case Lfx.Data.InputFieldTypes.DateTime:
                                        if (cellValue != null) {
                                                if (formField.Format != null)
                                                        FieldValueAsText = System.Convert.ToDateTime(cellValue).ToString(formField.Format).ToTitleCase();
                                                else
                                                        FieldValueAsText = System.Convert.ToDateTime(cellValue).ToString(Lfx.Types.Formatting.DateTime.FullDateTimePattern);
                                        } else {
                                                FieldValueAsText = "";
                                        }
                                        break;

                                case Lfx.Data.InputFieldTypes.YearMonth:
                                        if (cellValue != null) {
                                                if (formField.Format != null)
                                                        FieldValueAsText = System.Convert.ToDateTime(cellValue).ToString(formField.Format).ToTitleCase();
                                                else
                                                        FieldValueAsText = System.Convert.ToDateTime(cellValue).ToString(Lfx.Types.Formatting.DateTime.ShortMonthAndYearPattern);
                                        } else {
                                                FieldValueAsText = "";
                                        }
                                        break;

                                case Lfx.Data.InputFieldTypes.Bool:
                                        if (System.Convert.ToBoolean(cellValue))
                                                FieldValueAsText = "Sí";
                                        else
                                                FieldValueAsText = "No";
                                        break;

                                case Lfx.Data.InputFieldTypes.Set:
                                        int SetValue = System.Convert.ToInt32(cellValue);
                                        if (formField != null && formField.SetValues != null & formField.SetValues.ContainsKey(SetValue))
                                                FieldValueAsText = formField.SetValues[SetValue];
                                        else
                                                FieldValueAsText = "???";
                                        break;

                                default:
                                        switch (cellValue.GetType().ToString()) {
                                                case "System.Single":
                                                case "System.Double":
                                                        if (System.Convert.ToDouble(cellValue) == 0)
                                                                FieldValueAsText = "-";
                                                        else
                                                                FieldValueAsText = Lfx.Types.Formatting.FormatNumber(System.Convert.ToDecimal(cellValue), 2);
                                                        break;

                                                case "System.Decimal":
                                                        if (System.Convert.ToDecimal(cellValue) == 0)
                                                                FieldValueAsText = "-";
                                                        else
                                                                FieldValueAsText = Lfx.Types.Formatting.FormatNumber(System.Convert.ToDecimal(cellValue), 4);
                                                        break;

                                                case "System.Integer":
                                                case "System.Int16":
                                                case "System.Int32":
                                                case "System.Int64":
                                                        if (System.Convert.ToInt32(cellValue) == 0)
                                                                FieldValueAsText = "-";
                                                        else
                                                                FieldValueAsText = Lfx.Types.Formatting.FormatNumber(System.Convert.ToDecimal(cellValue), 0);
                                                        break;

                                                case "System.DateTime":
                                                        FieldValueAsText = Lfx.Types.Formatting.FormatDate(cellValue);
                                                        break;

                                                case "System.String":
                                                        FieldValueAsText = System.Convert.ToString(cellValue);
                                                        break;

                                                case "System.Byte[]":
                                                        FieldValueAsText = System.Text.Encoding.Default.GetString((byte[])cellValue);
                                                        break;

                                                case "System.DBNull":
                                                        FieldValueAsText = "";
                                                        break;

                                                default:
                                                        FieldValueAsText = cellValue.ToString();
                                                        break;
                                        }
                                        break;
                        }
                        return FieldValueAsText;
                }
Esempio n. 9
0
                public void FromSection(Lazaro.Pres.Forms.Section section)
                {
                        this.EliminarCampos();
                        this.Text = section.Label;
                        foreach (Lazaro.Pres.Field Fld in section.Fields) {
                                Lui.Forms.EditableControl Ctrl;
                                switch (Fld.DataType) {
                                        case Lfx.Data.InputFieldTypes.Bool:
                                                Lui.Forms.YesNo BoolField = new Lui.Forms.YesNo();
                                                //BoolField.SetData = new string[] { "Sí|1", "No|0" };
                                                //BoolField.AlwaysExpanded = false;
                                                //BoolField.AutoSize = false;
                                                BoolField.Value = m_Elemento.GetFieldValue<bool>(Fld.Name);
                                                Ctrl = BoolField;
                                                break;
                                        case Lfx.Data.InputFieldTypes.Set:
                                                Lui.Forms.ComboBox SetField = new Lui.Forms.ComboBox();
                                                SetField.FromDictionary(Fld.SetValues);
                                                SetField.TextKey = m_Elemento.GetFieldValue<string>(Fld.Name);
                                                SetField.AlwaysExpanded = true;
                                                SetField.AutoSize = true;
                                                Ctrl = SetField;
                                                break;
                                        case Lfx.Data.InputFieldTypes.Relation:
                                                Entrada.CodigoDetalle RelationField = new Entrada.CodigoDetalle();
                                                RelationField.Relation = Fld.Relation;
                                                RelationField.ValueInt = m_Elemento.GetFieldValue<int>(Fld.Name);
                                                RelationField.PlaceholderText = Fld.Label;
                                                RelationField.Required = false;
                                                RelationField.ElementoTipo = Fld.LblType;
                                                Ctrl = RelationField;
                                                break;
                                        default:
                                                Lui.Forms.TextBox TextField = new Lui.Forms.TextBox();
                                                switch (Fld.DataType) {
                                                        case Lfx.Data.InputFieldTypes.Currency:
                                                                TextField.DataType = Lui.Forms.DataTypes.Currency;
                                                                TextField.ValueDecimal = m_Elemento.GetFieldValue<decimal>(Fld.Name);
                                                                break;
                                                        case Lfx.Data.InputFieldTypes.Date:
                                                                TextField.DataType = Lui.Forms.DataTypes.Date;
                                                                TextField.Text = m_Elemento.GetFieldValue<DateTime>(Fld.Name).ToString(Lfx.Types.Formatting.DateTime.ShortDatePattern);
                                                                break;
                                                        case Lfx.Data.InputFieldTypes.DateTime:
                                                                TextField.DataType = Lui.Forms.DataTypes.DateTime;
                                                                TextField.Text = m_Elemento.GetFieldValue<DateTime>(Fld.Name).ToString(Lfx.Types.Formatting.DateTime.FullDateTimePattern);
                                                                break;
                                                        case Lfx.Data.InputFieldTypes.Numeric:
                                                                TextField.DataType = Lui.Forms.DataTypes.Float;
                                                                TextField.ValueDecimal = m_Elemento.GetFieldValue<decimal>(Fld.Name);
                                                                break;
                                                        case Lfx.Data.InputFieldTypes.Integer:
                                                                TextField.DataType = Lui.Forms.DataTypes.Integer;
                                                                TextField.ValueInt = m_Elemento.GetFieldValue<int>(Fld.Name);
                                                                break;
                                                        case Lfx.Data.InputFieldTypes.Text:
                                                                TextField.Text = m_Elemento.GetFieldValue<string>(Fld.Name);
                                                                break;
                                                        case Lfx.Data.InputFieldTypes.Memo:
                                                                TextField.MultiLine = true;
                                                                TextField.Size = new Size(this.FieldContainer.ClientSize.Width, 72);
                                                                TextField.Text = m_Elemento.GetFieldValue<string>(Fld.Name);
                                                                break;
                                                }
                                                TextField.PlaceholderText = Fld.Label;
                                                Ctrl = TextField;
                                                break;
                                }

                                Ctrl.ReadOnly = Fld.ReadOnly;
                                if (Ctrl.Size == System.Drawing.Size.Empty)
                                        Ctrl.Size = new Size(this.FieldContainer.ClientSize.Width, 24);
                                Ctrl.Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Top;
                                Ctrl.FieldName = Fld.Name;
                                this.AgregarCampo(Fld.Label, Ctrl);
                        }
                }
Esempio n. 10
0
 public void ConFiscal_EventoConexion(object sender, Lazaro.Impresion.Comprobantes.Fiscal.ImpresoraEventArgs e)
 {
         UltimoEvento = e;
         switch (e.EventType) {
                 case Lazaro.Impresion.Comprobantes.Fiscal.ImpresoraEventArgs.EventTypes.Inicializada:
                         FormEstado.MostrarEstado("Inicializado");
                         break;
                 case Lazaro.Impresion.Comprobantes.Fiscal.ImpresoraEventArgs.EventTypes.Estado:
                         FormEstado.MostrarEstado(e.MensajeEstado);
                         break;
                 case Lazaro.Impresion.Comprobantes.Fiscal.ImpresoraEventArgs.EventTypes.InicioImpresion:
                         FormEstado.MostrarEstado("Se inició el proceso de impresión");
                         break;
                 case Lazaro.Impresion.Comprobantes.Fiscal.ImpresoraEventArgs.EventTypes.FinImpresion:
                         FormEstado.MostrarEstado("Finalizó el proceso de impresión");
                         break;
         }
 }
Esempio n. 11
0
                public override void OnFiltersChanged(Lazaro.Pres.Filters.FilterCollection filters)
                {
                        if (Lbl.Sys.Config.Actual.UsuarioConectado.TienePermiso(typeof(Lbl.CuentasCorrientes.CuentaCorriente), Lbl.Sys.Permisos.Operaciones.Ver)) {
                                this.Cliente = filters["ctacte.id_cliente"].Value as Lbl.Personas.Persona;        
                        }
                        Tipo = System.Convert.ToInt32(((Lazaro.Pres.Filters.SetFilter)(filters["personas.tipo"])).Value);
                        Grupo = ((Lazaro.Pres.Filters.RelationFilter)(filters["personas.id_grupo"])).Elemento as Lbl.Personas.Grupo;
                        Localidad = ((Lazaro.Pres.Filters.RelationFilter)(filters["personas.id_ciudad"])).Elemento as Lbl.Entidades.Localidad;
                        Fechas = ((Lazaro.Pres.Filters.DateRangeFilter)(filters["ctacte.fecha"])).DateRange;

                        base.OnFiltersChanged(filters);
                }
Esempio n. 12
0
                public override void OnFiltersChanged(Lazaro.Pres.Filters.FilterCollection filters)
                {
                        this.Tipo = this.Definicion.Filters["comprob.tipo_fac"].Value as string;
                        this.Estado = Lfx.Types.Parsing.ParseInt(this.Definicion.Filters["comprob.estado"].Value as string);
                        this.Proveedor = this.Definicion.Filters["comprob.id_cliente"].Value as Lbl.Personas.Persona;
                        this.Fechas = this.Definicion.Filters["comprob.fecha"].Value as Lfx.Types.DateRange;

                        base.OnFiltersChanged(filters);
                }
Esempio n. 13
0
                public override void OnFiltersChanged(Lazaro.Pres.Filters.FilterCollection filters)
                {
                        this.Tipo = Lfx.Types.Parsing.ParseInt(this.Definicion.Filters["personas.tipo"].Value as string);
                        this.Grupo = this.Definicion.Filters["personas.id_grupo"].Value as Lbl.Personas.Grupo;
                        this.SubGrupo = this.Definicion.Filters["personas.id_subgrupo"].Value as Lbl.Personas.Grupo;
                        this.Localidad = this.Definicion.Filters["personas.id_ciudad"].Value as Lbl.Entidades.Localidad;
                        this.Estado = Lfx.Types.Parsing.ParseInt(this.Definicion.Filters["personas.estado"].Value as string);
                        this.EstadoCredito = Lfx.Types.Parsing.ParseInt(this.Definicion.Filters["personas.estadocredito"].Value as string);
                        this.FechaAlta = this.Definicion.Filters["personas.fechaalta"].Value as Lfx.Types.DateRange;
                        this.FechaBaja = this.Definicion.Filters["personas.fechabaja"].Value as Lfx.Types.DateRange;

                        base.OnFiltersChanged(filters);
                }
Esempio n. 14
0
                public override void OnFiltersChanged(Lazaro.Pres.Filters.FilterCollection filters)
                {
                        this.Cliente = this.Definicion.Filters["tickets.id_persona"].Value as Lbl.Personas.Persona;
                        this.Tipo = this.Definicion.Filters["tickets.id_tipo_ticket"].Value as Lbl.Tareas.Tipo;
                        this.Localidad = this.Definicion.Filters["personas.id_ciudad"].Value as Lbl.Entidades.Localidad;
                        this.Estado = this.Definicion.Filters["tickets.estado"].Value as string;
                        this.Definicion.OrderBy = this.Definicion.Filters["ORDER BY"].Value as string;

                        base.OnFiltersChanged(filters);
                }
Esempio n. 15
0
 public void FromFilters(Lazaro.Pres.Filters.FilterCollection filtros)
 {
         this.ControlFiltros.FromFilters(filtros);
 }
Esempio n. 16
0
                protected override Lazaro.Pres.Spreadsheet.Row FormatRow(int itemId, Lfx.Data.Row row, Lazaro.Pres.Spreadsheet.Sheet sheet, Lazaro.Pres.FieldCollection useFields)
                {
                        Lazaro.Pres.Spreadsheet.Row Res = base.FormatRow(itemId, row, sheet, useFields);

                        switch (row.Fields["tipo_fac"].ValueString) {
                                case "NCA":
                                case "NCB":
                                case "NCC":
                                case "NCE":
                                case "NCM":
                                        row.Fields["gravado"].Value = -row.Fields["gravado"].ValueDecimal;
                                        row.Fields["total"].Value = -row.Fields["total"].ValueDecimal;
                                        break;
                        }

                        if (row.Fields["anulada"].ValueInt != 0)
                                Res.Cells[4].Content = "ANULADA";

                        return Res;
                }
Esempio n. 17
0
 private void MostrarErrorFiscal(Lazaro.Impresion.Comprobantes.Fiscal.Respuesta Res)
 {
         FormError FormFiscalError = new FormError();
         FormFiscalError.Mostrar(Res);
         FormFiscalError.ShowDialog();
 }
Esempio n. 18
0
                private void PrintRow(PrintPageEventArgs e, Lazaro.Pres.Spreadsheet.Row row)
                {
                        Graphics g = e.Graphics;

                        float CursorX = BodyRect.Left;

                        float ThisRowHeight = RowHeight;

                        // Imprimo primero la columna de detalle principal
                        if (this.Sheet.ColumnHeaders.DetailColumn >= 0) {
                                ThisRowHeight = RowHeight / 2;
                                RectangleF ChRect = new RectangleF(CursorX, CursorY, BodyRect.Width, RowHeight / 2);
                                g.DrawString(row.Cells[this.Sheet.ColumnHeaders.DetailColumn].ToString(), new Font(RowFont, FontStyle.Bold), Brushes.Black, ChRect, ColumnFormats[this.Sheet.ColumnHeaders.DetailColumn]);
                                CursorY += ThisRowHeight;
                        }

                        for (int i = 0; i < row.Cells.Count; i++) {
                                if (i != this.Sheet.ColumnHeaders.DetailColumn && this.Sheet.ColumnHeaders[i].Printable) {
                                        RectangleF ChRect = new RectangleF(CursorX, CursorY, ColumnWidths[i], ThisRowHeight);
                                        g.DrawString(row.Cells[i].ToString(), RowFont, Brushes.Black, ChRect, ColumnFormats[i]);
                                        g.DrawLine(Pens.LightGray, ChRect.X, ChRect.Bottom, ChRect.Right, ChRect.Bottom);

                                        CursorX += ColumnWidths[i];
                                }
                        }

                        CursorY += ThisRowHeight;
                }
Esempio n. 19
0
 public FormularioListado(Lazaro.Pres.Listings.Listing definicion)
         : this()
 {
         this.Definicion = definicion;
 }
Esempio n. 20
0
                protected virtual Lazaro.Pres.Spreadsheet.Row FormatRow(int itemId, Lfx.Data.Row row, Lazaro.Pres.Spreadsheet.Sheet sheet, Lazaro.Pres.FieldCollection useFields)
                {
                        Lazaro.Pres.Spreadsheet.Row Reng = new Lazaro.Pres.Spreadsheet.Row(sheet);

                        if (this.Definicion.KeyColumn != null && this.Definicion.KeyColumn.Printable) {
                                Lazaro.Pres.Spreadsheet.Cell KeyCell = Reng.Cells.Add();
                                KeyCell.Content = itemId;
                        }

                        for (int FieldNum = 0; FieldNum < useFields.Count; FieldNum++) {
                                if (useFields[FieldNum].Printable) {

                                        string FieldName = Lfx.Data.Field.GetNameOnly(useFields[FieldNum].Name);

                                        if (FieldNum >= 0) {
                                                Lazaro.Pres.Spreadsheet.Cell NewCell = Reng.Cells.Add();

                                                switch (useFields[FieldNum].DataType) {
                                                        case Lfx.Data.InputFieldTypes.Integer:
                                                        case Lfx.Data.InputFieldTypes.Serial:
                                                                if (row[FieldName] == null || row[FieldName] is DBNull)
                                                                        NewCell.Content = null;
                                                                else if (useFields[FieldNum].Format != null)
                                                                        NewCell.Content = System.Convert.ToInt32(row[FieldName]).ToString(useFields[FieldNum].Format);
                                                                else
                                                                        NewCell.Content = row[FieldName].ToString();
                                                                break;

                                                        case Lfx.Data.InputFieldTypes.Relation:
                                                        case Lfx.Data.InputFieldTypes.Text:
                                                        case Lfx.Data.InputFieldTypes.Memo:
                                                                if (row[FieldName] == null)
                                                                        NewCell.Content = null;
                                                                else if (row[FieldName] is System.Byte[])
                                                                        NewCell.Content = System.Text.Encoding.Default.GetString(((System.Byte[])(row[FieldName])));
                                                                else
                                                                        NewCell.Content = row.Fields[FieldName].Value.ToString();
                                                                break;

                                                        case Lfx.Data.InputFieldTypes.Currency:
                                                                double ValorCur = (row[FieldName] == null || row[FieldName] is DBNull) ? 0 : System.Convert.ToDouble(row[FieldName]);
                                                                NewCell.Content = ValorCur;
                                                                break;

                                                        case Lfx.Data.InputFieldTypes.Numeric:
                                                                if (row[FieldName] == null || row[FieldName] is DBNull)
                                                                        NewCell.Content = null;
                                                                else
                                                                        NewCell.Content = System.Convert.ToDouble(row[FieldName]);
                                                                break;

                                                        case Lfx.Data.InputFieldTypes.Date:
                                                                if (row.Fields[FieldName].Value != null)
                                                                        NewCell.Content = row.Fields[FieldName].ValueDateTime;
                                                                break;

                                                        case Lfx.Data.InputFieldTypes.DateTime:
                                                                NewCell.Content = row[FieldName];
                                                                break;

                                                        case Lfx.Data.InputFieldTypes.Bool:
                                                                if (System.Convert.ToBoolean(row[FieldName]))
                                                                        NewCell.Content = "Sí";
                                                                else
                                                                        NewCell.Content = "No";
                                                                break;

                                                        case Lfx.Data.InputFieldTypes.Set:
                                                                int SetValue = System.Convert.ToInt32(row[FieldName]);
                                                                if (useFields[FieldNum] != null && useFields[FieldNum].SetValues != null & useFields[FieldNum].SetValues.ContainsKey(SetValue))
                                                                        NewCell.Content = useFields[FieldNum].SetValues[SetValue];
                                                                else
                                                                        NewCell.Content = "???";
                                                                break;

                                                        default:
                                                                NewCell.Content = row[FieldName];
                                                                break;
                                                }
                                        }
                                }
                        }

                        return Reng;
                }
Esempio n. 21
0
                public override void OnFiltersChanged(Lazaro.Pres.Filters.FilterCollection filters)
                {
                        this.Caja = this.Definicion.Filters["cajas_movim.id_caja"].Value as Lbl.Cajas.Caja;
                        this.Cliente = this.Definicion.Filters["cajas_movim.id_cliente"].Value as Lbl.Personas.Persona;
                        this.Concepto = this.Definicion.Filters["cajas_movim.id_concepto"].Value as Lbl.Cajas.Concepto;
                        TipoConcepto = Lfx.Types.Parsing.ParseInt(this.Definicion.Filters["conceptos.grupo"].Value.ToString());
                        Direccion = Lfx.Types.Parsing.ParseInt(this.Definicion.Filters["conceptos.es"].Value.ToString());
                        this.Fechas = this.Definicion.Filters["cajas_movim.fecha"].Value as Lfx.Types.DateRange;

                        BotonArqueo.Visible = !(this.Caja == null || this.Cliente != null || Concepto != null || Direccion != 0 || this.Fechas.To < System.DateTime.Now);

                        base.OnFiltersChanged(filters);
                }
Esempio n. 22
0
                public virtual Lazaro.Pres.Spreadsheet.Workbook ToWorkbook(Lazaro.Pres.FieldCollection useFields)
                {
                        Lazaro.Pres.Spreadsheet.Workbook Res = new Lazaro.Pres.Spreadsheet.Workbook();
                        Lazaro.Pres.Spreadsheet.Sheet Sheet = new Lazaro.Pres.Spreadsheet.Sheet(this.Text);
                        Res.Sheets.Add(Sheet);

                        // Exporto los encabezados de columna
                        if (this.Definicion.KeyColumn.Printable) {
                                Sheet.ColumnHeaders.Add(new Lazaro.Pres.Spreadsheet.ColumnHeader(this.Definicion.KeyColumn.Label, this.Definicion.KeyColumn.Width));
                                Sheet.ColumnHeaders[0].DataType = this.Definicion.KeyColumn.DataType;
                                Sheet.ColumnHeaders[0].Format = this.Definicion.KeyColumn.Format;
                                Sheet.ColumnHeaders[0].Printable = this.Definicion.KeyColumn.Printable;
                        }

                        int OrderColumn = -1;
                        if (useFields != null) {
                                for (int i = 0; i <= useFields.Count - 1; i++) {
                                        if (useFields[i].Printable) {
                                                Lazaro.Pres.Spreadsheet.ColumnHeader ColHead = new Lazaro.Pres.Spreadsheet.ColumnHeader(useFields[i].Label, useFields[i].Width);
                                                ColHead.Name = Lfx.Data.Field.GetNameOnly(useFields[i].Name);
                                                ColHead.TextAlignment = useFields[i].Alignment;
                                                ColHead.DataType = useFields[i].DataType;
                                                ColHead.Format = useFields[i].Format;
                                                ColHead.TotalFunction = useFields[i].TotalFunction;
                                                ColHead.Printable = useFields[i].Printable;
                                                Sheet.ColumnHeaders.Add(ColHead);

                                                if (ColHead.Name == this.Definicion.OrderBy)
                                                        OrderColumn = Sheet.ColumnHeaders.Count - 1;

                                                if (ColHead.Name == this.GroupingColumnName)
                                                        Sheet.ColumnHeaders.GroupingColumn = Sheet.ColumnHeaders.Count - 1;
                                        }
                                }
                        }

                        // Exporto los renglones
                        System.Data.DataTable Tabla = this.Connection.Select(this.SelectCommand());
                        foreach (System.Data.DataRow DtRow in Tabla.Rows) {
                                Lfx.Data.Row Registro = (Lfx.Data.Row)DtRow;

                                string NombreCampoId = Lfx.Data.Field.GetNameOnly(this.Definicion.KeyColumn.Name);
                                int ItemId = Registro.Fields[NombreCampoId].ValueInt;

                                Lazaro.Pres.Spreadsheet.Row Reng = this.FormatRow(ItemId, Registro, Sheet, useFields);

                                Sheet.Rows.Add(Reng);
                        }

                        if (OrderColumn >= 0) {
                                if (m_GroupingColumnName != null) {
                                        Sheet.SortByGroupAndColumn(OrderColumn, true);
                                } else {
                                        if (OrderColumn >= 0)
                                                Sheet.Sort(OrderColumn, true);
                                }
                        }

                        return Res;
                }
Esempio n. 23
0
		internal void Mostrar(Lazaro.Impresion.Comprobantes.Fiscal.Respuesta Res)
		{
			switch (Res.Error)
			{
				case Lazaro.Impresion.Comprobantes.Fiscal.ErroresFiscales.Ok:
					EtiquetaError.Text = "OK???";
					break;
				case Lazaro.Impresion.Comprobantes.Fiscal.ErroresFiscales.ErrorBCC:
					EtiquetaError.Text = "BCC";
					break;
				case Lazaro.Impresion.Comprobantes.Fiscal.ErroresFiscales.Error:
					EtiquetaError.Text = "Error genérico";
					break;
				case Lazaro.Impresion.Comprobantes.Fiscal.ErroresFiscales.ErrorFiscal:
					EtiquetaError.Text = "Error fiscal";
					break;
				case Lazaro.Impresion.Comprobantes.Fiscal.ErroresFiscales.ErrorImpresora:
					EtiquetaError.Text = "Error impresora";
					break;
				case Lazaro.Impresion.Comprobantes.Fiscal.ErroresFiscales.NAK:
					EtiquetaError.Text = "NAK";
					break;
				case Lazaro.Impresion.Comprobantes.Fiscal.ErroresFiscales.TimeOut:
					EtiquetaError.Text = "Timeout";
					break;
			}

			EtiquetaLugar.Text = Res.Lugar;
			EtiquetaMensaje.Text = Res.Mensaje;
			EtiquetaComando.Text = Res.CodigoComando.ToString();
                        if (Res.Campos != null)
                                EtiquetaCampos.Text = string.Join(Environment.NewLine, Res.Campos.ToArray());
			EtiquetaEstadoImpresora.Text = Res.ExplicarEstadoImpresora();
			EtiquetaEstadoFiscal.Text = Res.ExplicarEstadoFiscal();
			CancelCommandButton.Visible = false;
		}
Esempio n. 24
0
                private string ExplicarFiltros(Lazaro.Pres.Filters.FilterCollection filters)
                {
                        System.Text.StringBuilder Res = new System.Text.StringBuilder();
                        foreach (Lazaro.Pres.Filters.IFilter filter in filters) {
                                if (filter is Lazaro.Pres.Filters.RelationFilter) {
                                        if (filter.Value != null)
                                                Res.Append(", " + filter.Label + " es " + filter.Value.ToString());
                                } else if (filter is Lazaro.Pres.Filters.NumericRangeFilter) {
                                        if (Lfx.Types.Parsing.ParseDecimal(filter.Value as string) != 0)
                                                Res.Append(", " + filter.Label + " es " + filter.Value.ToString());
                                } else if (filter is Lazaro.Pres.Filters.DateRangeFilter) {
                                        Lfx.Types.DateRange Rng = filter.Value as Lfx.Types.DateRange;
                                        if (Rng != null && Rng.HasRange)
                                                Res.Append(", " + filter.Label + " es " + Rng.ToString());
                                } else if (filter is Lazaro.Pres.Filters.SetFilter) {
                                        if (Lfx.Types.Parsing.ParseDecimal(filter.Value as string) > 0)
                                                Res.Append(", " + filter.Label + " es " + filter.Value.ToString());
                                }
                        }

                        return Res.ToString();
                }
Esempio n. 25
0
                public override void OnFiltersChanged(Lazaro.Pres.Filters.FilterCollection filters)
                {
                        m_Rubro = filters["id_rubro"].Value as Lbl.Articulos.Rubro;
                        m_Categoria = filters["id_categoria"].Value as Lbl.Articulos.Categoria;
                        m_Marca = filters["id_marca"].Value as Lbl.Articulos.Marca;
                        m_Proveedor = filters["id_proveedor"].Value as Lbl.Personas.Persona;
                        m_Situacion = filters["id_situacion"].Value as Lbl.Articulos.Situacion;
                        m_Stock = filters["stock_actual"].Value as string;

                        base.OnFiltersChanged(filters);
                }