// ==================================================================================================== // ==================================================================================================== #region MÉTODOS ESTÁTICOS // ==================================================================================================== public static void ParseFromReader(OleDbDataReader lector, Pluses pluses) { pluses.Id = lector.ToInt32("Id"); pluses.Año = lector.ToInt16("Año"); pluses.ImporteDietas = lector.ToDecimal("ImporteDietas"); pluses.ImporteSabados = lector.ToDecimal("ImporteSabados"); pluses.ImporteFestivos = lector.ToDecimal("ImporteFestivos"); pluses.PlusNocturnidad = lector.ToDecimal("PlusNocturnidad"); pluses.DietaMenorDescanso = lector.ToDecimal("DietaMenorDescanso"); pluses.PlusLimpieza = lector.ToDecimal("PlusLimpieza"); pluses.PlusPaqueteria = lector.ToDecimal("PlusPaqueteria"); pluses.PlusNavidad = lector.ToDecimal("PlusNavidad"); }
public static void ParseToCommand(OleDbCommand Comando, Pluses pluses) { Comando.Parameters.AddWithValue("Año", pluses.Año); Comando.Parameters.AddWithValue("ImporteDietas", pluses.ImporteDietas.ToString("0.0000")); Comando.Parameters.AddWithValue("ImporteSabados", pluses.ImporteSabados.ToString("0.0000")); Comando.Parameters.AddWithValue("ImporteFestivos", pluses.ImporteFestivos.ToString("0.0000")); Comando.Parameters.AddWithValue("PlusNocturnidad", pluses.PlusNocturnidad.ToString("0.0000")); Comando.Parameters.AddWithValue("DietaMenorDescanso", pluses.DietaMenorDescanso.ToString("0.0000")); Comando.Parameters.AddWithValue("PlusLimpieza", pluses.PlusLimpieza.ToString("0.0000")); Comando.Parameters.AddWithValue("PlusPaqueteria", pluses.PlusPaqueteria.ToString("0.0000")); Comando.Parameters.AddWithValue("PlusNavidad", pluses.PlusNavidad.ToString("0.0000")); Comando.Parameters.AddWithValue("Id", pluses.Id); }
/// <summary> /// Crea un nuevo objeto Pluses con los importes del objeto pasado, pero con el año indicado. /// </summary> /// <param name="año"></param> /// <param name="pluses"></param> public Pluses(int año, Pluses pluses) { this.Año = año; if (pluses != null) { this.ImporteDietas = pluses.ImporteDietas; this.ImporteSabados = pluses.ImporteSabados; this.ImporteFestivos = pluses.ImporteFestivos; this.PlusNocturnidad = pluses.PlusNocturnidad; this.DietaMenorDescanso = pluses.DietaMenorDescanso; this.PlusLimpieza = pluses.PlusLimpieza; this.PlusPaqueteria = pluses.PlusPaqueteria; this.PlusNavidad = pluses.PlusNavidad; } Nuevo = true; }