2026-01-30-v2

This commit is contained in:
2026-01-30 11:10:56 +01:00
parent 12039e9ae4
commit 6034845e65
46 changed files with 9717 additions and 356 deletions

View File

@@ -29,7 +29,7 @@ namespace bdGrupoSanchoToro.XSD {
private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public CTESGESL() {
this.BeginInit();
this.InitClass();
@@ -40,7 +40,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
[System.ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called" +
" or extended by application code.", DiagnosticId="SYSLIB0051")]
protected CTESGESL(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
@@ -78,7 +78,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
public DatosDataTable Datos {
@@ -88,7 +88,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
[global::System.ComponentModel.BrowsableAttribute(true)]
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)]
public override global::System.Data.SchemaSerializationMode SchemaSerializationMode {
@@ -101,7 +101,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public new global::System.Data.DataTableCollection Tables {
get {
@@ -110,7 +110,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public new global::System.Data.DataRelationCollection Relations {
get {
@@ -119,7 +119,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override void InitializeDerivedDataSet() {
this.BeginInit();
this.InitClass();
@@ -127,7 +127,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public override global::System.Data.DataSet Clone() {
CTESGESL cln = ((CTESGESL)(base.Clone()));
cln.InitVars();
@@ -136,19 +136,19 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override bool ShouldSerializeTables() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override bool ShouldSerializeRelations() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) {
if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
this.Reset();
@@ -173,7 +173,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() {
global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream();
this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null));
@@ -182,13 +182,13 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
internal void InitVars() {
this.InitVars(true);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
internal void InitVars(bool initTable) {
this.tableDatos = ((DatosDataTable)(base.Tables["Datos"]));
if ((initTable == true)) {
@@ -199,7 +199,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
private void InitClass() {
this.DataSetName = "CTESGESL";
this.Prefix = "";
@@ -211,13 +211,13 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
private bool ShouldSerializeDatos() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) {
if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) {
this.InitVars();
@@ -225,7 +225,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
CTESGESL ds = new CTESGESL();
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
@@ -271,7 +271,7 @@ namespace bdGrupoSanchoToro.XSD {
return type;
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public delegate void DatosRowChangeEventHandler(object sender, DatosRowChangeEvent e);
/// <summary>
@@ -292,7 +292,7 @@ namespace bdGrupoSanchoToro.XSD {
private global::System.Data.DataColumn columnLCVAA;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public DatosDataTable() {
this.TableName = "Datos";
this.BeginInit();
@@ -301,7 +301,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
internal DatosDataTable(global::System.Data.DataTable table) {
this.TableName = table.TableName;
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
@@ -318,7 +318,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
[System.ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called" +
" or extended by application code.", DiagnosticId="SYSLIB0051")]
protected DatosDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
@@ -327,7 +327,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public global::System.Data.DataColumn LCORDColumn {
get {
return this.columnLCORD;
@@ -335,7 +335,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public global::System.Data.DataColumn LCGRUColumn {
get {
return this.columnLCGRU;
@@ -343,7 +343,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public global::System.Data.DataColumn LCCODColumn {
get {
return this.columnLCCOD;
@@ -351,7 +351,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public global::System.Data.DataColumn LCDESColumn {
get {
return this.columnLCDES;
@@ -359,7 +359,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public global::System.Data.DataColumn LCVAAColumn {
get {
return this.columnLCVAA;
@@ -367,7 +367,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
public int Count {
get {
@@ -376,33 +376,33 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public DatosRow this[int index] {
get {
return ((DatosRow)(this.Rows[index]));
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public event DatosRowChangeEventHandler DatosRowChanging;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public event DatosRowChangeEventHandler DatosRowChanged;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public event DatosRowChangeEventHandler DatosRowDeleting;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public event DatosRowChangeEventHandler DatosRowDeleted;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public void AddDatosRow(DatosRow row) {
this.Rows.Add(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public DatosRow AddDatosRow(string LCORD, string LCGRU, string LCCOD, string LCDES, string LCVAA) {
DatosRow rowDatosRow = ((DatosRow)(this.NewRow()));
object[] columnValuesArray = new object[] {
@@ -417,7 +417,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public override global::System.Data.DataTable Clone() {
DatosDataTable cln = ((DatosDataTable)(base.Clone()));
cln.InitVars();
@@ -425,13 +425,13 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override global::System.Data.DataTable CreateInstance() {
return new DatosDataTable();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
internal void InitVars() {
this.columnLCORD = base.Columns["LCORD"];
this.columnLCGRU = base.Columns["LCGRU"];
@@ -441,7 +441,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
private void InitClass() {
this.columnLCORD = new global::System.Data.DataColumn("LCORD", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnLCORD);
@@ -456,25 +456,25 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public DatosRow NewDatosRow() {
return ((DatosRow)(this.NewRow()));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
return new DatosRow(builder);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override global::System.Type GetRowType() {
return typeof(DatosRow);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.DatosRowChanged != null)) {
@@ -483,7 +483,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.DatosRowChanging != null)) {
@@ -492,7 +492,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.DatosRowDeleted != null)) {
@@ -501,7 +501,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.DatosRowDeleting != null)) {
@@ -510,13 +510,13 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public void RemoveDatosRow(DatosRow row) {
this.Rows.Remove(row);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
@@ -587,14 +587,14 @@ namespace bdGrupoSanchoToro.XSD {
private DatosDataTable tableDatos;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
internal DatosRow(global::System.Data.DataRowBuilder rb) :
base(rb) {
this.tableDatos = ((DatosDataTable)(this.Table));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public string LCORD {
get {
try {
@@ -610,7 +610,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public string LCGRU {
get {
try {
@@ -626,7 +626,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public string LCCOD {
get {
try {
@@ -642,7 +642,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public string LCDES {
get {
try {
@@ -658,7 +658,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public string LCVAA {
get {
try {
@@ -674,61 +674,61 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public bool IsLCORDNull() {
return this.IsNull(this.tableDatos.LCORDColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public void SetLCORDNull() {
this[this.tableDatos.LCORDColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public bool IsLCGRUNull() {
return this.IsNull(this.tableDatos.LCGRUColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public void SetLCGRUNull() {
this[this.tableDatos.LCGRUColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public bool IsLCCODNull() {
return this.IsNull(this.tableDatos.LCCODColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public void SetLCCODNull() {
this[this.tableDatos.LCCODColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public bool IsLCDESNull() {
return this.IsNull(this.tableDatos.LCDESColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public void SetLCDESNull() {
this[this.tableDatos.LCDESColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public bool IsLCVAANull() {
return this.IsNull(this.tableDatos.LCVAAColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public void SetLCVAANull() {
this[this.tableDatos.LCVAAColumn] = global::System.Convert.DBNull;
}
@@ -737,7 +737,7 @@ namespace bdGrupoSanchoToro.XSD {
/// <summary>
///Row event argument class
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public class DatosRowChangeEvent : global::System.EventArgs {
private DatosRow eventRow;
@@ -745,14 +745,14 @@ namespace bdGrupoSanchoToro.XSD {
private global::System.Data.DataRowAction eventAction;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public DatosRowChangeEvent(DatosRow row, global::System.Data.DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public DatosRow Row {
get {
return this.eventRow;
@@ -760,7 +760,7 @@ namespace bdGrupoSanchoToro.XSD {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "18.0.0.0")]
public global::System.Data.DataRowAction Action {
get {
return this.eventAction;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,133 @@
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Microsoft.VisualBasic.CompilerServices;
namespace bdGrupoSanchoToro.db
{
public partial class apuntes
{
private string _NumeroCuentaTmp;
public string NumeroCuentaTmp
{
get
{
return _NumeroCuentaTmp;
}
set
{
_NumeroCuentaTmp = value;
OnPropertyChanged("NumeroCuentaTmp");
}
}
public double SaldoCuentaTmp { get; set; }
public string DescripcionCuentaTmp { get; set; }
public static void EstableceSaldoTmp(List<apuntes> lap)
{
double SaldoAnterior = 0;
foreach (var ap in lap)
{
SaldoAnterior = SaldoAnterior + ap.Debe - ap.Haber;
ap.SaldoCuentaTmp = SaldoAnterior;
}
}
public static List<Tipo> ListaTiposDocumentos()
{
var lEstados = new List<Tipo>();
foreach (TiposDocumentos Enumeracion in Enum.GetValues(typeof(TiposDocumentos)))
lEstados.Add(new Tipo() { id = (int)Enumeracion, Descripcion = Enumeracion.ToString().Replace("_", " ") });
return lEstados;
}
public double DebeAnterior(tscGrupoSanchoToro bd, DateOnly Fecha)
{
try
{
var aps = bd.apuntes.Where(X => X.idCuentaNavigation.idCuenta == this.idCuenta & X.idAsientoNavigation.Fecha < Fecha).ToList();
return aps.Sum(x => x.Debe);
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
public double HaberAnterior(tscGrupoSanchoToro bd, DateOnly Fecha)
{
try
{
var aps = bd.apuntes.Where(X => X.idCuenta == this.idCuenta & X.idAsientoNavigation.Fecha < Fecha).ToList();
return aps.Sum(x => x.Haber);
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
private bool? _Conciliado;
public bool Conciliado
{
get
{
if (_Conciliado.HasValue)
return (bool)_Conciliado;
else if (ConciliacionActual_TMP != null)
{
if (ConciliacionActual_TMP.idConciliacion != this.idConciliacion)
return false;
else
return this.idConciliacion.HasValue;
}
else
return this.idConciliacion.HasValue;
}
set
{
_Conciliado = value;
if (value)
this.idConciliacionNavigation = this.ConciliacionActual_TMP;
else
this.idConciliacion = null;
}
}
public string ConciliadoEn
{
get
{
if (ConciliacionActual_TMP != null && this.idConciliacion.HasValue && this.idConciliacion != ConciliacionActual_TMP.idConciliacion)
return "Nº Conc.: " + this.idConciliacion + " (" + this.idConciliacionNavigation.Anno.ToString + "-" + this.idConciliacionNavigation.Mes.ToString + ")";
else
return "";
}
}
public conciliacionesbancarias ConciliacionActual_TMP { get; set; }
public double Saldo
{
get
{
return Math.Round(Debe - Haber, 2);
}
}
public double Diferencia
{
get
{
return Debe - Haber;
}
}
public class Tipo
{
public int id { get; set; }
public string Descripcion { get; set; }
}
public enum TiposDocumentos
{
RECIBO = 1,
FACTURA = 2,
OTRO = 99
}
}
}

View File

@@ -0,0 +1,107 @@
using FluentFTP.Helpers;
using Microsoft.VisualBasic;
using System;
using System.Data;
using System.Linq;
namespace bdGrupoSanchoToro.db
{
public partial class asientos
{
public enum TipoAsiento : int
{
NORMAL = 0,
APERTURA = 1,
REGULARIZACION = 2
}
public string Cuentas
{
get
{
if (this.apuntes.Count > 10)
return "** MÁS DE 10 **";
else
{
string sCuentas = "";
foreach (var ap in this.apuntes)
sCuentas += ap.idCuentaNavigation.NumeroCuenta + " ";
return sCuentas.Trim();
}
}
}
public string Documentos
{
get
{
string sDocumentos = "";
foreach (var ap in this.apuntes.ToList().Where(x => x.NumeroDocumento != null && x.NumeroDocumento != "").GroupBy(x => x.NumeroDocumento))
sDocumentos += ap.First().NumeroDocumento + " ";
return sDocumentos.Trim();
}
}
public string Conceptos
{
get
{
string sDocumentos = "";
foreach (var ap in this.apuntes.ToList().GroupBy(x => x.Concepto))
sDocumentos += ap.First().Concepto + " ";
return sDocumentos.Trim();
}
}
public int? idAsiento_Nulable
{
get
{
if (this.idAsiento == 0)
return null;
else
return this.idAsiento;
}
}
public void RellenaCuentaTmp()
{
foreach (var ap in this.apuntes)
{
ap.NumeroCuentaTmp = ap.idCuentaNavigation.NumeroCuenta;
ap.DescripcionCuentaTmp = ap.idCuentaNavigation.Denominacion;
}
}
public void RefrescaExtensiones()
{
OnPropertyChanged("EjercicioTmp");
OnPropertyChanged("idAsiento_Nulable");
}
public static cuentas ObtieneCuenta(tscGrupoSanchoToro bd, string cta, int idEjercicio)
{
var cuenta = bd.cuentas.FirstOrDefault(x => x.NumeroCuenta == cta & x.idEjercicio == idEjercicio);
if (cuenta == null)
{
var ctaant = bd.cuentas.Where(x => x.NumeroCuenta == cta).OrderByDescending(x => x.idEjercicioNavigation.FechaInicio).FirstOrDefault();
if (ctaant != null)
cuenta = bdGrupoSanchoToro.db.cuentas.CreaCuenta(bd, idEjercicio, cta, ctaant.Denominacion, ctaant.Observaciones);
}
return cuenta;
}
private string _Ejercicio;
public string EjercicioTmp
{
get
{
if (_Ejercicio == "" && idEjercicioNavigation != null)
_Ejercicio = idEjercicioNavigation.Descripcion;
return _Ejercicio;
}
set
{
_Ejercicio = value;
OnPropertyChanged("EjercicioTmp");
}
}
}
}

View File

@@ -0,0 +1,746 @@
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Microsoft.VisualBasic.CompilerServices;
using tsUtilidades.Extensiones;
namespace bdGrupoSanchoToro.db
{
public partial class cuentas
{
public static int LongitudCuentaFinal
{
get
{
return (8);
}
}
public const string CUENTA_PERDIDAS_Y_GANANCIAS = "12900000";
public List<apuntes> ApuntesTemporales { get; set; }
public string Descripcion
{
get
{
return this.NumeroCuenta + " " + this.Denominacion;
}
}
public void RellenaApuntesTemporales(bool IncluirAsientoCierre)
{
if (this.Nivel == LongitudCuentaFinal)
{
int TipoApertura = (int)asientos.TipoAsiento.APERTURA;
int TipoRegularizacion = (int)asientos.TipoAsiento.REGULARIZACION;
var apap = this.apuntes.Where(x => x.idAsientoNavigation.Tipo == TipoApertura).ToList();
if (apap.Count == 0)
this.SaldoInicialTmp = 0;
else
this.SaldoInicialTmp = Math.Round(apap.Sum(x => x.Debe - x.Haber), 2, MidpointRounding.AwayFromZero);
if (IncluirAsientoCierre)
ApuntesTemporales = this.apuntes.Where(x => x.idAsientoNavigation.Tipo != TipoApertura).ToList();
else
ApuntesTemporales = this.apuntes.Where(x => x.idAsientoNavigation.Tipo != TipoApertura & x.idAsientoNavigation.Tipo != TipoRegularizacion).ToList();
}
else
{
int TipoApertura = (int)asientos.TipoAsiento.APERTURA;
int TipoRegularizacion = (int)asientos.TipoAsiento.REGULARIZACION;
bdGrupoSanchoToro.tscGrupoSanchoToro.NuevoContexto();
var apap = bd.apuntes.Where(x => x.idCuentaNavigation.NumeroCuenta.StartsWith(this.NumeroCuenta) & x.idAsientoNavigation.Tipo == TipoApertura ).ToList();
if (apap.Count == 0)
this.SaldoInicialTmp = 0;
else
this.SaldoInicialTmp = Math.Round(apap.Sum(x => x.Debe - x.Haber), 2, MidpointRounding.AwayFromZero);
if (IncluirAsientoCierre)
ApuntesTemporales = bd.apuntes.Where(x => x.idAsientoNavigation.idEjercicio == this.idEjercicio & x.idCuentaNavigation.NumeroCuenta.StartsWith(this.NumeroCuenta) & x.idAsientoNavigation.Tipo != TipoApertura).ToList();
else
ApuntesTemporales = bd.apuntes.Where(x => x.idAsientoNavigation.idEjercicio == this.idEjercicio & x.idCuentaNavigation.NumeroCuenta.StartsWith(this.NumeroCuenta) & x.idAsientoNavigation.Tipo != TipoRegularizacion & x.idAsientoNavigation.Tipo != TipoApertura).ToList();
}
if (ApuntesTemporales.Count == 0)
{
this.SaldoDebeTmp = 0;
this.SaldoHaberTmp = 0;
}
else
{
this.SaldoDebeTmp = Math.Round(ApuntesTemporales.Sum(x => x.Debe), 2, MidpointRounding.AwayFromZero);
this.SaldoHaberTmp = Math.Round(ApuntesTemporales.Sum(x => x.Haber), 2, MidpointRounding.AwayFromZero);
}
this.SaldoFinalTmp = this.SaldoInicialTmp + this.SaldoDebeTmp - this.SaldoHaberTmp;
}
public double SaldoInicialTmp { get; set; }
public double SaldoDebeTmp { get; set; }
public double SaldoHaberTmp { get; set; }
public double SaldoFinalTmp { get; set; }
public static cuentas CreaCuenta(tscGrupoSanchoToro bd, int idEjercicio, string NumeroCuenta, string Descripcion, string Observaciones = "")
{
var cta = bd.cuentas.FirstOrDefault(x => x.NumeroCuenta == NumeroCuenta & x.idEjercicio == idEjercicio);
if (cta == null)
{
cta = new cuentas();
{
var withBlock = cta;
withBlock.NumeroCuenta = NumeroCuenta;
withBlock.idEjercicio = idEjercicio;
withBlock.Denominacion = Descripcion.Acortar(150);
withBlock.EsCuentaFinal = true;
withBlock.Observaciones = Observaciones;
}
bd.cuentas.Add(cta);
bd.SaveChanges();
}
return cta;
}
public static cuentas CreaCuenta(tscGrupoSanchoToro bd, DateOnly Fecha, string NumeroCuenta, string Descripcion, string Observaciones = "")
{
var ej = bd.ejercicioscontables.FirstOrDefault(x => x.FechaInicio <= Fecha & x.FechaFin >= Fecha);
if (ej == null)
throw new Exception("No existe ningún ejercicio abierto para la fecha " + Fecha.ToString());
return CreaCuenta(bd, ej.idEjercicio, NumeroCuenta, Descripcion, Observaciones);
}
int TipoApertura = (int)asientos.TipoAsiento.APERTURA;
int TipoRegularizacion = (int)asientos.TipoAsiento.REGULARIZACION;
public double TotalSaldoAntesCierre
{
get
{
var ac = this.idEjercicioNavigation.asientos.FirstOrDefault(x => x.Tipo == TipoRegularizacion);
if (ac == null)
return TotalSaldo;
else
{
var tdac = ac.apuntes.Where(x => x.idCuentaNavigation.NumeroCuenta.StartsWith(this.NumeroCuenta)).Sum(x => x.Debe);
var thac = ac.apuntes.Where(x => x.idCuentaNavigation.NumeroCuenta.StartsWith(this.NumeroCuenta)).Sum(x => x.Haber);
return TotalSaldo - tdac + thac;
}
}
}
public string Grupo1
{
get
{
if (this.NumeroCuenta.Length > 1)
{
var nc = this.NumeroCuenta.Substring(0, 1);
return nc + " - " + this.idEjercicioNavigation.cuentas.First(x => x.NumeroCuenta == nc).Denominacion;
}
else
return "";
}
}
public string Grupo2
{
get
{
if (this.NumeroCuenta.Length > 2)
{
var nc = this.NumeroCuenta.Substring(0, 2);
return nc + " - " + this.idEjercicioNavigation.cuentas.First(x => x.NumeroCuenta == nc).Denominacion;
}
else
return "";
}
}
public string Grupo3
{
get
{
if (this.NumeroCuenta.Length > 3)
{
var nc = this.NumeroCuenta.Substring(0, 3);
return nc + " - " + this.idEjercicioNavigation.cuentas.First(x => x.NumeroCuenta == nc).Denominacion;
}
else
return "";
}
}
public string Grupo4
{
get
{
if (this.NumeroCuenta.Length > 4)
{
var nc = this.NumeroCuenta.Substring(0, 4);
return nc + " - " + this.idEjercicioNavigation.cuentas.First(x => x.NumeroCuenta == nc).Denominacion;
}
else
return "";
}
}
private tscGrupoSanchoToro _bd;
public tscGrupoSanchoToro bd
{
get
{
if (_bd == null)
_bd = bdGrupoSanchoToro.tscGrupoSanchoToro.NuevoContexto();
return _bd;
}
}
public cuentas CuentaSuperior1
{
get
{
if (this.NumeroCuenta.Length == 1)
return null/* TODO Change to default(_) if this is not a reference type */;
else
{
var CuentaSuperior = this.NumeroCuenta.Substring(0, 1);
return bd.cuentas.First(x => x.NumeroCuenta == CuentaSuperior & x.idEjercicio == this.idEjercicio);
}
}
}
public cuentas CuentaSuperior2
{
get
{
if (this.NumeroCuenta.Length < 3)
return null/* TODO Change to default(_) if this is not a reference type */;
else
{
var CuentaSuperior = this.NumeroCuenta.Substring(0, 2);
return bd.cuentas.First(x => x.NumeroCuenta == CuentaSuperior & x.idEjercicio == this.idEjercicio);
}
}
}
public cuentas CuentaSuperior3
{
get
{
if (this.NumeroCuenta.Length < 4)
return null/* TODO Change to default(_) if this is not a reference type */;
else
{
var CuentaSuperior = this.NumeroCuenta.Substring(0, 3);
return bd.cuentas.First(x => x.NumeroCuenta == CuentaSuperior & x.idEjercicio == this.idEjercicio);
}
}
}
public cuentas CuentaSuperior4
{
get
{
if (this.NumeroCuenta.Length < 5)
return null/* TODO Change to default(_) if this is not a reference type */;
else
{
var CuentaSuperior = this.NumeroCuenta.Substring(0, 4);
return bd.cuentas.First(x => x.NumeroCuenta == CuentaSuperior & x.idEjercicio == this.idEjercicio);
}
}
}
public int Nivel
{
get
{
return NumeroCuenta.NothingAVacio().Length;
}
}
private vf_cuentas _ValoresExtendidos;
public vf_cuentas ValoresExtendidos
{
get
{
if (_ValoresExtendidos == null)
_ValoresExtendidos = Obtiene_vf_cuenta();
return _ValoresExtendidos;
}
}
public vf_cuentas Obtiene_vf_cuenta()
{
try
{
tscGrupoSanchoToro bd = tscGrupoSanchoToro.NuevoContexto();
vf_cuentas ct;
if (this.Nivel == 8)
ct = bd.vf_cuentas.First(x => x.idCuenta == this.idCuenta);
else if (Nivel == 0)
{
ct = new vf_cuentas();
{
var withBlock = ct;
withBlock.idCuenta = 0;
withBlock.idEjercicio = 0;
withBlock.Mote = "";
withBlock.Denominacion = "";
withBlock.idEmpresaAmortizacion = 0;
withBlock.NumeroCuenta = "";
withBlock.Observaciones = "";
withBlock.PresupuestoEnero = 0;
withBlock.PresupuestoFebrero = 0;
withBlock.PresupuestoMarzo = 0;
withBlock.PresupuestoAbril = 0;
withBlock.PresupuestoMayo = 0;
withBlock.PresupuestoJunio = 0;
withBlock.PresupuestoJulio = 0;
withBlock.PresupuestoAgosto = 0;
withBlock.PresupuestoSeptiembre = 0;
withBlock.PresupuestoOctubre = 0;
withBlock.PresupuestoNoviembre = 0;
withBlock.PresupuestoDiciembre = 0;
withBlock.DebeEnero = 0;
withBlock.DebeFebrero = 0;
withBlock.DebeMarzo = 0;
withBlock.DebeAbril = 0;
withBlock.DebeMayo = 0;
withBlock.DebeJunio = 0;
withBlock.DebeJulio = 0;
withBlock.DebeAgosto = 0;
withBlock.DebeSeptiembre = 0;
withBlock.DebeOctubre = 0;
withBlock.DebeNoviembre = 0;
withBlock.DebeDiciembre = 0;
withBlock.HaberEnero = 0;
withBlock.HaberFebrero = 0;
withBlock.HaberMarzo = 0;
withBlock.HaberAbril = 0;
withBlock.HaberMayo = 0;
withBlock.HaberJunio = 0;
withBlock.HaberJulio = 0;
withBlock.HaberAgosto = 0;
withBlock.HaberSeptiembre = 0;
withBlock.HaberOctubre = 0;
withBlock.HaberNoviembre = 0;
withBlock.HaberDiciembre = 0;
withBlock.TotalDebe = 0;
withBlock.TotalHaber = 0;
}
}
else
{
var sumatorio = bd.vf_cuentas.Where(x => x.NumeroCuenta.StartsWith(this.NumeroCuenta) & x.idEjercicio == this.idEjercicio).ToList();
ct = new vf_cuentas();
{
var withBlock = ct;
withBlock.idCuenta = this.idCuenta;
withBlock.idEjercicio = this.idEjercicio;
withBlock.Mote = this.Mote;
withBlock.Denominacion = this.Denominacion;
withBlock.idEmpresaAmortizacion = this.idEmpresaAmortizacion;
withBlock.NumeroCuenta = this.NumeroCuenta;
withBlock.Observaciones = this.Observaciones;
withBlock.PresupuestoEnero = Math.Round(sumatorio.Sum(x => x.PresupuestoEnero), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoFebrero = Math.Round(sumatorio.Sum(x => x.PresupuestoEnero), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoMarzo = Math.Round(sumatorio.Sum(x => x.PresupuestoMarzo), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoAbril = Math.Round(sumatorio.Sum(x => x.PresupuestoAbril), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoMayo = Math.Round(sumatorio.Sum(x => x.PresupuestoMayo), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoJunio = Math.Round(sumatorio.Sum(x => x.PresupuestoJunio), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoJulio = Math.Round(sumatorio.Sum(x => x.PresupuestoJulio), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoAgosto = Math.Round(sumatorio.Sum(x => x.PresupuestoAgosto), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoSeptiembre = Math.Round(sumatorio.Sum(x => x.PresupuestoSeptiembre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoOctubre = Math.Round(sumatorio.Sum(x => x.PresupuestoOctubre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoNoviembre = Math.Round(sumatorio.Sum(x => x.PresupuestoNoviembre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoDiciembre = Math.Round(sumatorio.Sum(x => x.PresupuestoDiciembre), 2, MidpointRounding.AwayFromZero);
withBlock.DebeEnero = Math.Round(sumatorio.Sum(x => x.DebeEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeFebrero = Math.Round(sumatorio.Sum(x => x.DebeEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeMarzo = Math.Round(sumatorio.Sum(x => x.DebeMarzo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeAbril = Math.Round(sumatorio.Sum(x => x.DebeAbril.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeMayo = Math.Round(sumatorio.Sum(x => x.DebeMayo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeJunio = Math.Round(sumatorio.Sum(x => x.DebeJunio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeJulio = Math.Round(sumatorio.Sum(x => x.DebeJulio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeAgosto = Math.Round(sumatorio.Sum(x => x.DebeAgosto.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeSeptiembre = Math.Round(sumatorio.Sum(x => x.DebeSeptiembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeOctubre = Math.Round(sumatorio.Sum(x => x.DebeOctubre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeNoviembre = Math.Round(sumatorio.Sum(x => x.DebeNoviembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeDiciembre = Math.Round(sumatorio.Sum(x => x.DebeDiciembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberEnero = Math.Round(sumatorio.Sum(x => x.HaberEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberFebrero = Math.Round(sumatorio.Sum(x => x.HaberEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberMarzo = Math.Round(sumatorio.Sum(x => x.HaberMarzo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberAbril = Math.Round(sumatorio.Sum(x => x.HaberAbril.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberMayo = Math.Round(sumatorio.Sum(x => x.HaberMayo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberJunio = Math.Round(sumatorio.Sum(x => x.HaberJunio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberJulio = Math.Round(sumatorio.Sum(x => x.HaberJulio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberAgosto = Math.Round(sumatorio.Sum(x => x.HaberAgosto.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberSeptiembre = Math.Round(sumatorio.Sum(x => x.HaberSeptiembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberOctubre = Math.Round(sumatorio.Sum(x => x.HaberOctubre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberNoviembre = Math.Round(sumatorio.Sum(x => x.HaberNoviembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberDiciembre = Math.Round(sumatorio.Sum(x => x.HaberDiciembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.TotalDebe = Math.Round(sumatorio.Sum(x => x.TotalDebe), 2, MidpointRounding.AwayFromZero);
withBlock.TotalHaber = Math.Round(sumatorio.Sum(x => x.TotalHaber), 2, MidpointRounding.AwayFromZero);
}
}
try
{
if (Nivel > 0)
{
var cta1 = bd.cuentas.First(x => x.NumeroCuenta == ct.NumeroCuenta.Substring(0, 1) & x.idEjercicio == this.idEjercicio);
ct.Grupo1 = cta1.NumeroCuenta + " " + cta1.Denominacion;
if (ct.Nivel > 1)
{
var cta2 = bd.cuentas.First(x => x.NumeroCuenta == ct.NumeroCuenta.Substring(0, 2) & x.idEjercicio == this.idEjercicio);
ct.Grupo2 = cta2.NumeroCuenta + " " + cta2.Denominacion;
if (ct.Nivel > 2)
{
var cta3 = bd.cuentas.First(x => x.NumeroCuenta == ct.NumeroCuenta.Substring(0, 3) & x.idEjercicio == this.idEjercicio);
ct.Grupo3 = cta3.NumeroCuenta + " " + cta3.Denominacion;
if (ct.Nivel > 3)
{
var cta4 = bd.cuentas.First(x => x.NumeroCuenta == ct.NumeroCuenta.Substring(0, 4) & x.idEjercicio == this.idEjercicio);
ct.Grupo4 = cta4.NumeroCuenta + " " + cta4.Denominacion;
}
}
}
}
}
catch (Exception ex)
{
throw new Exception("Error obteniendo cuentas intermedia de la cuenta " + this.NumeroCuenta + " " + ex.Message, ex);
}
return ct;
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
#region "Saldos"
public double SaldoEnero
{
get
{
return ValoresExtendidos.SaldoEnero;
}
}
public double SaldoFebrero
{
get
{
return ValoresExtendidos.SaldoFebrero;
}
}
public double SaldoMarzo
{
get
{
return ValoresExtendidos.SaldoMarzo;
}
}
public double SaldoAbril
{
get
{
return ValoresExtendidos.SaldoAbril;
}
}
public double SaldoMayo
{
get
{
return ValoresExtendidos.SaldoMayo;
}
}
public double SaldoJunio
{
get
{
return ValoresExtendidos.SaldoJunio;
}
}
public double SaldoJulio
{
get
{
return ValoresExtendidos.SaldoJulio;
}
}
public double SaldoAgosto
{
get
{
return ValoresExtendidos.SaldoAgosto;
}
}
public double SaldoSeptiembre
{
get
{
return ValoresExtendidos.SaldoSeptiembre;
}
}
public double SaldoOctubre
{
get
{
return ValoresExtendidos.SaldoOctubre;
}
}
public double SaldoNoviembre
{
get
{
return ValoresExtendidos.SaldoNoviembre;
}
}
public double SaldoDiciembre
{
get
{
return ValoresExtendidos.SaldoDiciembre;
}
}
public double TotalSaldo
{
get
{
return ValoresExtendidos.TotalSaldo;
}
}
#endregion
#region "Presupuestos"
public double TotalPresupuestado
{
get
{
return Math.Round(PresupuestoEnero + PresupuestoFebrero + PresupuestoMarzo + PresupuestoAbril + PresupuestoMayo + PresupuestoJunio + PresupuestoJulio + PresupuestoAgosto + PresupuestoSeptiembre + PresupuestoOctubre + PresupuestoNoviembre + PresupuestoDiciembre, 2, MidpointRounding.AwayFromZero);
}
}
public void ActualizaTotalPresupuestado()
{
OnPropertyChanged("TotalPresupuestado");
}
public double DesvioPresupuestoEnero
{
get
{
return ValoresExtendidos.DesvioPresupuestoEnero;
}
}
public double DesvioPresupuestoFebrero
{
get
{
return ValoresExtendidos.DesvioPresupuestoFebrero;
}
}
public double DesvioPresupuestoMarzo
{
get
{
return ValoresExtendidos.DesvioPresupuestoMarzo;
}
}
public double DesvioPresupuestoAbril
{
get
{
return ValoresExtendidos.DesvioPresupuestoAbril;
}
}
public double DesvioPresupuestoMayo
{
get
{
return ValoresExtendidos.DesvioPresupuestoMayo;
}
}
public double DesvioPresupuestoJunio
{
get
{
return ValoresExtendidos.DesvioPresupuestoJunio;
}
}
public double DesvioPresupuestoJulio
{
get
{
return ValoresExtendidos.DesvioPresupuestoJulio;
}
}
public double DesvioPresupuestoAgosto
{
get
{
return ValoresExtendidos.DesvioPresupuestoAgosto;
}
}
public double DesvioPresupuestoSeptiembre
{
get
{
return ValoresExtendidos.DesvioPresupuestoSeptiembre;
}
}
public double DesvioPresupuestoOctubre
{
get
{
return ValoresExtendidos.DesvioPresupuestoOctubre;
}
}
public double DesvioPresupuestoNoviembre
{
get
{
return ValoresExtendidos.DesvioPresupuestoNoviembre;
}
}
public double DesvioPresupuestoDiciembre
{
get
{
return ValoresExtendidos.DesvioPresupuestoDiciembre;
}
}
public double DesvioPresupuestoTotal
{
get
{
return ValoresExtendidos.DesvioPresupuestoTotal;
}
}
public double PorcentajeDesvioPresupuestoEnero
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoEnero;
}
}
public double PorcentajeDesvioPresupuestoFebrero
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoFebrero;
}
}
public double PorcentajeDesvioPresupuestoMarzo
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoMarzo;
}
}
public double PorcentajeDesvioPresupuestoAbril
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoAbril;
}
}
public double PorcentajeDesvioPresupuestoMayo
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoMayo;
}
}
public double PorcentajeDesvioPresupuestoJunio
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoJunio;
}
}
public double PorcentajeDesvioPresupuestoJulio
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoJulio;
}
}
public double PorcentajeDesvioPresupuestoAgosto
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoAgosto;
}
}
public double PorcentajeDesvioPresupuestoSeptiembre
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoSeptiembre;
}
}
public double PorcentajeDesvioPresupuestoOctubre
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoOctubre;
}
}
public double PorcentajeDesvioPresupuestoNoviembre
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoNoviembre;
}
}
public double PorcentajeDesvioPresupuestoDiciembre
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoDiciembre;
}
}
public double PorcentajeDesvioPresupuestoTotal
{
get
{
return ValoresExtendidos.PorcentajeDesvioPresupuestoTotal;
}
}
#endregion
public static List<GrupoCuenta> ListadoGruposCuentas()
{
List<GrupoCuenta> lGrupos = new List<GrupoCuenta>();
lGrupos.Add(new GrupoCuenta() { Nivel = 1, Descripcion = "GRUPO INICIAL 1 DÍGITO" });
lGrupos.Add(new GrupoCuenta() { Nivel = 2, Descripcion = "GRUPO INTERMEDIO 2 DÍGITOS" });
lGrupos.Add(new GrupoCuenta() { Nivel = 3, Descripcion = "GRUPO INTERMEDIO 3 DÍGITOS" });
lGrupos.Add(new GrupoCuenta() { Nivel = 4, Descripcion = "GRUPO INTERMEDIO 4 DÍGITOS" });
lGrupos.Add(new GrupoCuenta() { Nivel = 8, Descripcion = "GRUPO FINAL 8 DÍGITOS" });
return lGrupos;
}
public class GrupoCuenta
{
public int Nivel { get; set; }
public string Descripcion { get; set; }
}
}
}

View File

@@ -0,0 +1,903 @@
using System;
using System.ComponentModel;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Runtime.CompilerServices;
using Microsoft.VisualBasic.CompilerServices;
using tsUtilidades.Extensiones;
namespace bdGrupoSanchoToro.db
{
public partial class vf_cuentas
{
public static List<vf_cuentas> Obtiene_vf_cuentas(tscGrupoSanchoToro bd, int idEjercicio, int Nivel)
{
try
{
List<vf_cuentas> lc;
var ctasintermedias = bd.cuentas.Where(x => x.EsCuentaFinal == false & x.idEjercicio == idEjercicio & x.NumeroCuenta.Length <= Nivel).ToList();
var ctasf = bd.vf_cuentas.Where(x => x.idEjercicio == idEjercicio).ToList();
if (Nivel == 8)
lc = ctasf;
else
{
lc = new List<vf_cuentas>();
foreach (var cta in ctasintermedias.Where(x => x.Nivel == Nivel))
{
var sumatorio = ctasf.Where(x => x.NumeroCuenta.StartsWith(cta.NumeroCuenta));
vf_cuentas nc = new vf_cuentas();
{
var withBlock = nc;
withBlock.idCuenta = cta.idCuenta;
withBlock.idEjercicio = cta.idEjercicio;
withBlock.Mote = cta.Mote;
withBlock.Denominacion = cta.Denominacion;
withBlock.idEmpresaAmortizacion = cta.idEmpresaAmortizacion;
withBlock.NumeroCuenta = cta.NumeroCuenta;
withBlock.Observaciones = cta.Observaciones;
withBlock.PresupuestoEnero = Math.Round(sumatorio.Sum(x => x.PresupuestoEnero), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoFebrero = Math.Round(sumatorio.Sum(x => x.PresupuestoEnero), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoMarzo = Math.Round(sumatorio.Sum(x => x.PresupuestoMarzo), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoAbril = Math.Round(sumatorio.Sum(x => x.PresupuestoAbril), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoMayo = Math.Round(sumatorio.Sum(x => x.PresupuestoMayo), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoJunio = Math.Round(sumatorio.Sum(x => x.PresupuestoJunio), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoJulio = Math.Round(sumatorio.Sum(x => x.PresupuestoJulio), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoAgosto = Math.Round(sumatorio.Sum(x => x.PresupuestoAgosto), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoSeptiembre = Math.Round(sumatorio.Sum(x => x.PresupuestoSeptiembre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoOctubre = Math.Round(sumatorio.Sum(x => x.PresupuestoOctubre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoNoviembre = Math.Round(sumatorio.Sum(x => x.PresupuestoNoviembre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoDiciembre = Math.Round(sumatorio.Sum(x => x.PresupuestoDiciembre), 2, MidpointRounding.AwayFromZero);
withBlock.DebeEnero = Math.Round(sumatorio.Sum(x => x.DebeEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeFebrero = Math.Round(sumatorio.Sum(x => x.DebeEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeMarzo = Math.Round(sumatorio.Sum(x => x.DebeMarzo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeAbril = Math.Round(sumatorio.Sum(x => x.DebeAbril.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeMayo = Math.Round(sumatorio.Sum(x => x.DebeMayo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeJunio = Math.Round(sumatorio.Sum(x => x.DebeJunio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeJulio = Math.Round(sumatorio.Sum(x => x.DebeJulio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeAgosto = Math.Round(sumatorio.Sum(x => x.DebeAgosto.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeSeptiembre = Math.Round(sumatorio.Sum(x => x.DebeSeptiembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeOctubre = Math.Round(sumatorio.Sum(x => x.DebeOctubre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeNoviembre = Math.Round(sumatorio.Sum(x => x.DebeNoviembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeDiciembre = Math.Round(sumatorio.Sum(x => x.DebeDiciembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberEnero = Math.Round(sumatorio.Sum(x => x.HaberEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberFebrero = Math.Round(sumatorio.Sum(x => x.HaberEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberMarzo = Math.Round(sumatorio.Sum(x => x.HaberMarzo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberAbril = Math.Round(sumatorio.Sum(x => x.HaberAbril.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberMayo = Math.Round(sumatorio.Sum(x => x.HaberMayo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberJunio = Math.Round(sumatorio.Sum(x => x.HaberJunio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberJulio = Math.Round(sumatorio.Sum(x => x.HaberJulio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberAgosto = Math.Round(sumatorio.Sum(x => x.HaberAgosto.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberSeptiembre = Math.Round(sumatorio.Sum(x => x.HaberSeptiembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberOctubre = Math.Round(sumatorio.Sum(x => x.HaberOctubre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberNoviembre = Math.Round(sumatorio.Sum(x => x.HaberNoviembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberDiciembre = Math.Round(sumatorio.Sum(x => x.HaberDiciembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.TotalDebe = Math.Round(sumatorio.Sum(x => x.TotalDebe), 2, MidpointRounding.AwayFromZero);
withBlock.TotalHaber = Math.Round(sumatorio.Sum(x => x.TotalHaber), 2, MidpointRounding.AwayFromZero);
lc.Add(nc);
}
}
}
foreach (var cta in lc)
{
try
{
var cta1 = ctasintermedias.First(x => x.NumeroCuenta == cta.NumeroCuenta.Substring(0, 1));
cta.Grupo1 = cta1.NumeroCuenta + " " + cta1.Denominacion;
if (cta.Nivel > 1)
{
var cta2 = ctasintermedias.First(x => x.NumeroCuenta == cta.NumeroCuenta.Substring(0, 2));
cta.Grupo2 = cta2.NumeroCuenta + " " + cta2.Denominacion;
if (cta.Nivel > 2)
{
var cta3 = ctasintermedias.First(x => x.NumeroCuenta == cta.NumeroCuenta.Substring(0, 3));
cta.Grupo3 = cta3.NumeroCuenta + " " + cta3.Denominacion;
if (cta.Nivel > 3)
{
var cta4 = ctasintermedias.First(x => x.NumeroCuenta == cta.NumeroCuenta.Substring(0, 4));
cta.Grupo4 = cta4.NumeroCuenta + " " + cta4.Denominacion;
}
}
}
}
catch (Exception ex)
{
throw new Exception("Error obteniendo cuentas intermedia de la cuenta " + cta.NumeroCuenta + " " + ex.Message, ex);
}
}
return lc;
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
public static List<vf_cuentas> Obtiene_vf_cuentas(tscGrupoSanchoToro bd, int[] Ejercicios, int Nivel, string ExpresionBusqueda)
{
try
{
List<vf_cuentas> lc;
IQueryable<cuentas> qCtasIntermedias = bd.cuentas.Where(x => x.EsCuentaFinal == false & Ejercicios.Contains(x.idEjercicio) & x.NumeroCuenta.Length <= Nivel);
object[] parametros = new object[1];
IQueryable<vf_cuentas> qcastf;
if (ExpresionBusqueda == "")
qcastf = bd.vf_cuentas.AsQueryable();
else
{
qcastf = bd.vf_cuentas.Where(ExpresionBusqueda, parametros);
if (Nivel < 8)
{
ExpresionBusqueda = "NumeroCuenta.Length<" + Nivel.ToString() + " or (" + ExpresionBusqueda + ")";
qCtasIntermedias = qCtasIntermedias.Where(ExpresionBusqueda, parametros);
}
}
var ctasintermedias = qCtasIntermedias.ToList();
// Dim KK = qcastf.ToList
var ctasf = qcastf.Where(x => Ejercicios.Contains(x.idEjercicio)).ToList();
if (Nivel == 8)
lc = ctasf;
else
{
lc = new List<vf_cuentas>();
foreach (var cta in ctasintermedias.Where(x => x.Nivel == Nivel))
{
var sumatorio = ctasf.Where(x => x.idEjercicio == cta.idEjercicio & x.NumeroCuenta.StartsWith(cta.NumeroCuenta));
vf_cuentas nc = new vf_cuentas();
{
var withBlock = nc;
withBlock.idCuenta = cta.idCuenta;
withBlock.idEjercicio = cta.idEjercicio;
withBlock.Mote = cta.Mote;
withBlock.Denominacion = cta.Denominacion;
withBlock.idEmpresaAmortizacion = cta.idEmpresaAmortizacion;
withBlock.NumeroCuenta = cta.NumeroCuenta;
withBlock.Observaciones = cta.Observaciones;
withBlock.PresupuestoEnero = Math.Round(sumatorio.Sum(x => x.PresupuestoEnero), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoFebrero = Math.Round(sumatorio.Sum(x => x.PresupuestoEnero), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoMarzo = Math.Round(sumatorio.Sum(x => x.PresupuestoMarzo), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoAbril = Math.Round(sumatorio.Sum(x => x.PresupuestoAbril), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoMayo = Math.Round(sumatorio.Sum(x => x.PresupuestoMayo), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoJunio = Math.Round(sumatorio.Sum(x => x.PresupuestoJunio), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoJulio = Math.Round(sumatorio.Sum(x => x.PresupuestoJulio), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoAgosto = Math.Round(sumatorio.Sum(x => x.PresupuestoAgosto), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoSeptiembre = Math.Round(sumatorio.Sum(x => x.PresupuestoSeptiembre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoOctubre = Math.Round(sumatorio.Sum(x => x.PresupuestoOctubre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoNoviembre = Math.Round(sumatorio.Sum(x => x.PresupuestoNoviembre), 2, MidpointRounding.AwayFromZero);
withBlock.PresupuestoDiciembre = Math.Round(sumatorio.Sum(x => x.PresupuestoDiciembre), 2, MidpointRounding.AwayFromZero);
withBlock.DebeEnero = Math.Round(sumatorio.Sum(x => x.DebeEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeFebrero = Math.Round(sumatorio.Sum(x => x.DebeEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeMarzo = Math.Round(sumatorio.Sum(x => x.DebeMarzo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeAbril = Math.Round(sumatorio.Sum(x => x.DebeAbril.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeMayo = Math.Round(sumatorio.Sum(x => x.DebeMayo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeJunio = Math.Round(sumatorio.Sum(x => x.DebeJunio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeJulio = Math.Round(sumatorio.Sum(x => x.DebeJulio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeAgosto = Math.Round(sumatorio.Sum(x => x.DebeAgosto.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeSeptiembre = Math.Round(sumatorio.Sum(x => x.DebeSeptiembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeOctubre = Math.Round(sumatorio.Sum(x => x.DebeOctubre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeNoviembre = Math.Round(sumatorio.Sum(x => x.DebeNoviembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.DebeDiciembre = Math.Round(sumatorio.Sum(x => x.DebeDiciembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberEnero = Math.Round(sumatorio.Sum(x => x.HaberEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberFebrero = Math.Round(sumatorio.Sum(x => x.HaberEnero.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberMarzo = Math.Round(sumatorio.Sum(x => x.HaberMarzo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberAbril = Math.Round(sumatorio.Sum(x => x.HaberAbril.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberMayo = Math.Round(sumatorio.Sum(x => x.HaberMayo.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberJunio = Math.Round(sumatorio.Sum(x => x.HaberJunio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberJulio = Math.Round(sumatorio.Sum(x => x.HaberJulio.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberAgosto = Math.Round(sumatorio.Sum(x => x.HaberAgosto.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberSeptiembre = Math.Round(sumatorio.Sum(x => x.HaberSeptiembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberOctubre = Math.Round(sumatorio.Sum(x => x.HaberOctubre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberNoviembre = Math.Round(sumatorio.Sum(x => x.HaberNoviembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.HaberDiciembre = Math.Round(sumatorio.Sum(x => x.HaberDiciembre.NothingA0()), 2, MidpointRounding.AwayFromZero);
withBlock.TotalDebe = Math.Round(sumatorio.Sum(x => x.TotalDebe), 2, MidpointRounding.AwayFromZero);
withBlock.TotalHaber = Math.Round(sumatorio.Sum(x => x.TotalHaber), 2, MidpointRounding.AwayFromZero);
lc.Add(nc);
}
}
}
foreach (var cta in lc)
{
try
{
var cta1 = ctasintermedias.First(x => x.NumeroCuenta == cta.NumeroCuenta.Substring(0, 1));
cta.Grupo1 = cta1.NumeroCuenta + " " + cta1.Denominacion;
if (cta.Nivel > 1)
{
var cta2 = ctasintermedias.First(x => x.NumeroCuenta == cta.NumeroCuenta.Substring(0, 2));
cta.Grupo2 = cta2.NumeroCuenta + " " + cta2.Denominacion;
if (cta.Nivel > 2)
{
var cta3 = ctasintermedias.First(x => x.NumeroCuenta == cta.NumeroCuenta.Substring(0, 3));
cta.Grupo3 = cta3.NumeroCuenta + " " + cta3.Denominacion;
if (cta.Nivel > 3)
{
var cta4 = ctasintermedias.First(x => x.NumeroCuenta == cta.NumeroCuenta.Substring(0, 4));
cta.Grupo4 = cta4.NumeroCuenta + " " + cta4.Denominacion;
}
}
}
}
catch (Exception ex)
{
throw new Exception("Error obteniendo cuentas intermedia de la cuenta " + cta.NumeroCuenta + " " + ex.Message, ex);
}
}
return lc;
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
public string Grupo1 { get; set; }
public string Grupo2 { get; set; }
public string Grupo3 { get; set; }
public string Grupo4 { get; set; }
public int Nivel
{
get
{
return NumeroCuenta.Length;
}
}
#region "Saldos"
public double SaldoEnero
{
get
{
return Math.Round(DebeEnero.NothingA0() - HaberEnero.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoFebrero
{
get
{
return Math.Round(DebeFebrero.NothingA0() - HaberFebrero.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoMarzo
{
get
{
return Math.Round(DebeMarzo.NothingA0() - HaberMarzo.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoAbril
{
get
{
return Math.Round(DebeAbril.NothingA0() - HaberAbril.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoMayo
{
get
{
return Math.Round(DebeMayo.NothingA0() - HaberMayo.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoJunio
{
get
{
return Math.Round(DebeJunio.NothingA0() - HaberJunio.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoJulio
{
get
{
return Math.Round(DebeJulio.NothingA0() - HaberJulio.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoAgosto
{
get
{
return Math.Round(DebeAgosto.NothingA0() - HaberAgosto.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoSeptiembre
{
get
{
return Math.Round(DebeSeptiembre.NothingA0() - HaberSeptiembre.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoOctubre
{
get
{
return Math.Round(DebeOctubre.NothingA0() - HaberOctubre.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoNoviembre
{
get
{
return Math.Round(DebeNoviembre.NothingA0() - HaberNoviembre.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double SaldoDiciembre
{
get
{
return Math.Round(DebeDiciembre.NothingA0() - HaberDiciembre.NothingA0(), 2, MidpointRounding.AwayFromZero);
}
}
public double TotalSaldo
{
get
{
return Math.Round(TotalDebe - TotalHaber, 2, MidpointRounding.AwayFromZero);
}
}
#endregion
#region "Presupuestos"
public double TotalPresupuestado
{
get
{
return Math.Round(PresupuestoEnero + PresupuestoFebrero + PresupuestoMarzo + PresupuestoAbril + PresupuestoMayo + PresupuestoJunio + PresupuestoJulio + PresupuestoAgosto + PresupuestoSeptiembre + PresupuestoOctubre + PresupuestoNoviembre + PresupuestoDiciembre, 2, MidpointRounding.AwayFromZero);
}
}
public void ActualizaTotalPresupuestado()
{
OnPropertyChanged("TotalPresupuestado");
}
public double DesvioPresupuestoEnero
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoEnero) - Math.Abs(this.SaldoEnero), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoFebrero
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoFebrero) - Math.Abs(this.SaldoFebrero), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoMarzo
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoMarzo) - Math.Abs(this.SaldoMarzo), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoAbril
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoAbril) - Math.Abs(this.SaldoAbril), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoMayo
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoMayo) - Math.Abs(this.SaldoMayo), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoJunio
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoJunio) - Math.Abs(this.SaldoJunio), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoJulio
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoJulio) - Math.Abs(this.SaldoJulio), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoAgosto
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoAgosto) - Math.Abs(this.SaldoAgosto), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoSeptiembre
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoSeptiembre) - Math.Abs(this.SaldoSeptiembre), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoOctubre
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoOctubre) - Math.Abs(this.SaldoOctubre), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoNoviembre
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoNoviembre) - Math.Abs(this.SaldoNoviembre), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoDiciembre
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.PresupuestoDiciembre) - Math.Abs(this.SaldoDiciembre), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double DesvioPresupuestoTotal
{
get
{
if (this.NumeroCuenta != null)
{
switch (this.NumeroCuenta.Substring(0, 1))
{
case "6":
case "7":
{
return Math.Round(Math.Abs(this.TotalPresupuestado) - Math.Abs(this.TotalSaldo), 2, MidpointRounding.AwayFromZero);
}
default:
{
return 0;
}
}
}
else
return 0;
}
}
public double PorcentajeDesvioPresupuestoEnero
{
get
{
if (SaldoEnero == 0)
{
if (DesvioPresupuestoEnero < 0)
return -100;
else if (DesvioPresupuestoEnero > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoEnero * 100 / (double)SaldoEnero, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoFebrero
{
get
{
if (SaldoFebrero == 0)
{
if (DesvioPresupuestoFebrero < 0)
return -100;
else if (DesvioPresupuestoFebrero > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoFebrero * 100 / (double)SaldoFebrero, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoMarzo
{
get
{
if (SaldoMarzo == 0)
{
if (DesvioPresupuestoMarzo < 0)
return -100;
else if (DesvioPresupuestoMarzo > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoMarzo * 100 / (double)SaldoMarzo, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoAbril
{
get
{
if (SaldoAbril == 0)
{
if (DesvioPresupuestoAbril < 0)
return -100;
else if (DesvioPresupuestoAbril > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoAbril * 100 / (double)SaldoAbril, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoMayo
{
get
{
if (SaldoMayo == 0)
{
if (DesvioPresupuestoMayo < 0)
return -100;
else if (DesvioPresupuestoMayo > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoMayo * 100 / (double)SaldoMayo, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoJunio
{
get
{
if (SaldoJunio == 0)
{
if (DesvioPresupuestoJunio < 0)
return -100;
else if (DesvioPresupuestoJunio > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoJunio * 100 / (double)SaldoJunio, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoJulio
{
get
{
if (SaldoJulio == 0)
{
if (DesvioPresupuestoJulio < 0)
return -100;
else if (DesvioPresupuestoJulio > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoJulio * 100 / (double)SaldoJulio, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoAgosto
{
get
{
if (SaldoAgosto == 0)
{
if (DesvioPresupuestoAgosto < 0)
return -100;
else if (DesvioPresupuestoAgosto > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoAgosto * 100 / (double)SaldoAgosto, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoSeptiembre
{
get
{
if (SaldoSeptiembre == 0)
{
if (DesvioPresupuestoSeptiembre < 0)
return -100;
else if (DesvioPresupuestoSeptiembre > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoSeptiembre * 100 / (double)SaldoSeptiembre, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoOctubre
{
get
{
if (SaldoOctubre == 0)
{
if (DesvioPresupuestoOctubre < 0)
return -100;
else if (DesvioPresupuestoOctubre > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoOctubre * 100 / (double)SaldoOctubre, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoNoviembre
{
get
{
if (SaldoNoviembre == 0)
{
if (DesvioPresupuestoNoviembre < 0)
return -100;
else if (DesvioPresupuestoNoviembre > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoNoviembre * 100 / (double)SaldoNoviembre, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoDiciembre
{
get
{
if (SaldoDiciembre == 0)
{
if (DesvioPresupuestoDiciembre < 0)
return -100;
else if (DesvioPresupuestoDiciembre > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoDiciembre * 100 / (double)SaldoDiciembre, 2, MidpointRounding.AwayFromZero);
}
}
public double PorcentajeDesvioPresupuestoTotal
{
get
{
if (TotalSaldo == 0)
{
if (DesvioPresupuestoTotal < 0)
return -100;
else if (DesvioPresupuestoTotal > 0)
return 100;
else
return 0;
}
else
return Math.Round(DesvioPresupuestoTotal * 100 / (double)TotalSaldo, 2, MidpointRounding.AwayFromZero);
}
}
#endregion
}
}