public Pagamento(int pId, float pValor, Status pStatus, Mes pMes, Aluno pAluno) { id = pId; valor = pValor; status = pStatus; mes = pMes; aluno = pAluno; }
public void AvanzaMes() { this.mes++; if (this.mes == Mes.Diciembre + 1) { this.mes = Mes.Enero; this.an++; } }
public void DefinirNovoMesDeReferencia(Mes mesDeReferencia) { if (Status == StatusAgendamento.Realizado || Status == StatusAgendamento.Cancelado) { throw new StatusAgendamentoNaoPermiteAlteracaoException(); } MesDeReferencia = mesDeReferencia; }
public void Start(EventTokenButton token) { Mes.ChangeLanguage(LanguageCode); if (IsMute == false) { LOG.AddMes(LLV.WAR, "RestartForLanguage").Solo(); } Redraw(); }
/// <summary> /// Inicializa una instancia de `CuentaBancaria` con la cédula y el nombre del propietario de la cuenta. /// </summary> /// <param name="cedula">Número de cédula del propietario de la cuenta.</param> /// <param name="nombre">Nombre completo del propietario de la cuenta.</param> public CuentaBancaria(string cedula, string nombre) { this.nombre = nombre; this.cedula = cedula; mesActual = new Mes(0); corriente = new CuentaCorriente(); ahorros = new CuentaAhorros(); inversion = new CDT(); }
private void lstMeses_SelectedIndexChanged(object sender, EventArgs e) { int indice = this.lstMeses.SelectedIndex; //Recuperamos el mes con dicho indice Mes mes = this.tool.Meses[indice]; this.txtMaxima.Text = mes.tMax.ToString(); this.txtMinima.Text = mes.tMin.ToString(); this.txtMedia.Text = mes.getMedia().ToString(); }
private void lstmeses_SelectedIndexChanged(object sender, EventArgs e) { int indice = this.lstmeses.SelectedIndex; Mes mes = this.meses[indice]; this.txtnombre.Text = mes.Nombre; this.txtmaxima.Text = mes.Maxima.ToString(); this.txtminima.Text = mes.Minima.ToString(); this.txtmedia.Text = mes.GetMedia().ToString(); }
static void Main(string[] args) { Mes mes = Mes.Abril; Console.WriteLine(mes); MesNumero mesNumero = MesNumero.Abril; Console.WriteLine(mesNumero); }
public ActionResult Edit([Bind(Include = "IdMes,NombreMes")] Mes mes) { if (ModelState.IsValid) { db.Entry(mes).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(mes)); }
public IEnumerable <Registro> FindRegistrosByMatricula(int matricula, Mes mes) { var query = "select * from registros where MatriculaFuncionario = @Matricula and MONTH(DataHora) = @Mes and YEAR(DataHora) = @Ano"; var anoAtual = DateTime.Now.Year; using (var connection = ConnectionFactory.GetConnection()) { return(connection.Query <Registro>(query, new { Matricula = matricula, Mes = mes, Ano = anoAtual })); } }
private void lstmeses_SelectedIndexChanged(object sender, EventArgs e) { if (this.lstmeses.SelectedIndex != -1) { int indiceaño = this.cmbaño.SelectedIndex; int indicemes = this.lstmeses.SelectedIndex; Mes mes = this.años[indiceaño].Meses[indicemes]; this.txtmediamensual.Text = mes.GetMedia().ToString(); } }
/// <summary> /// Salva o mes na base de dados /// </summary> /// <returns>The mes async.</returns> /// <param name="mes">Mes.</param> public Task <int> SalvarMesAsync(Mes mes) { if (mes.Id != 0) { return(database.UpdateAsync(mes)); } else { return(database.InsertAsync(mes)); } }
public ActionResult Create([Bind(Include = "IdMes,NombreMes")] Mes mes) { if (ModelState.IsValid) { db.Mes.Add(mes); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(mes)); }
public void Mostra_Dias_Faltando_Para_Terminar_O_Mes_Contando_De_Ontem() { var option = new Options(); option.Limite = "182"; option.Atual = "180"; var bla = Mes.DiasFaltando(option); Assert.AreEqual(7, bla, "Deu merda"); }
public async Task <IActionResult> Create([Bind("mesID,nombreMes")] Mes mes) { if (ModelState.IsValid) { _context.Add(mes); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(mes)); }
public void CadastrarMes(string diaEspecial, string lugarTop, string NivelFelicidade) { Mes mesAtual = new Mes(); mesAtual.DiaEspecial = diaEspecial; mesAtual.LugarTop = lugarTop; mesAtual.NivelFelicidade = NivelFelicidade; context.dBmes.Add(mesAtual); context.SaveChanges(); }
public BaseServiceResponse <Registro[]> RegistrosByMatricula(int matricula, Mes mes) { try { Registro[] registros = _repository.FindRegistrosByMatricula(matricula, mes).ToArray(); return(new BaseServiceResponse <Registro[]>(registros)); } catch (Exception ex) { return(new BaseServiceResponse <Registro[]>("Erro ao buscar registros.")); } }
private void comboBox3_SelectedIndexChanged(object sender, EventArgs e) { // Habilitamos el botón button1.Enabled = true; // Mostramos u ocultamos los items switch (Reporte.GetItemText(Reporte.SelectedItem)) { case "Vendedores con mayor cantidad de productos no vendidos": label4.Show(); label5.Show(); Visibilidad.Show(); Mes.Show(); dataGridView1.Show(); dataGridView2.Hide(); dataGridView3.Hide(); dataGridView4.Hide(); break; case "Vendedores con mayor facturación": label4.Hide(); label5.Hide(); Visibilidad.Hide(); Mes.Hide(); dataGridView1.Hide(); dataGridView2.Show(); dataGridView3.Hide(); dataGridView4.Hide(); break; case "Vendedores con mayores calificaciones": label4.Hide(); label5.Hide(); Visibilidad.Hide(); Mes.Hide(); dataGridView1.Hide(); dataGridView2.Hide(); dataGridView3.Show(); dataGridView4.Hide(); break; case "Clientes con mayor cantidad de publicaciones sin calificar": label4.Hide(); label5.Hide(); Visibilidad.Hide(); Mes.Hide(); dataGridView1.Hide(); dataGridView2.Hide(); dataGridView3.Hide(); dataGridView4.Show(); break; } }
public async Task <IActionResult> PostMes([FromBody] Mes mes) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.Meses.Add(mes); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMes", new { id = mes.idMes }, mes)); }
private void lstmeses_SelectedIndexChanged(object sender, EventArgs e) { if (this.lstmeses.SelectedIndex != -1) { int indice = this.lstmeses.SelectedIndex; Mes mes = this.meses[indice]; this.txtmaxima.Text = mes.TemperaturaMaxima.ToString(); this.txtminima.Text = mes.TemperaturaMinima.ToString(); this.txtmedia.Text = mes.GetMedia().ToString(); } }
public Reuniao(string criador, Guid cipaId, Mes mesDeReferencia, DateTime dataPrevista, string local, bool extraordinaria) : this() { Id = Guid.NewGuid(); CreationDate = DateTime.UtcNow; CreationUser = criador; CipaId = cipaId; MesDeReferencia = mesDeReferencia; DataPrevista = dataPrevista; Local = local?.Trim(); Status = StatusAgendamento.Programado; Extraordinaria = extraordinaria; }
protected void btnRegistrarProgramacion_Click(object sender, EventArgs e) { Mes mes = new Mes(); mes.Activo = true; mes.NumeroMes = Convert.ToInt32(txtNumeroMes.Text); mes.ClaveDetallePrograma = Convert.ToInt32(cmbProgramacion.SelectedValue); mes.NombreMes = txtNombreMes.Text; Mes nuevoMes = MesDAO.Insertar(mes); if (nuevoMes != null) { Programacion programa = new Programacion(); programa.Programado = Convert.ToDouble(txtCantidadProgramada.Text); programa.ClaveMes = Convert.ToInt32(nuevoMes.Clave); programa.ClaveOrden = 1; Programacion nuevaProgramacion = ProgramacionDAO.Insertar(programa); if (nuevaProgramacion == null) { Mensaje Mensaje = new Mensaje() { Titulo = "Error!", Contenido = "El programa no se pudo dar de alta en el sistema", Tipo = TipoMensaje.ERROR }; litMensaje.Text = Disenio.GenerarMensaje(Mensaje); } else { Mensaje Mensaje = new Mensaje() { Titulo = "Exito!", Contenido = "El programa se dio de alta en el sistema", Tipo = TipoMensaje.EXITO }; litMensaje.Text = Disenio.GenerarMensaje(Mensaje); } } else { Mensaje Mensaje = new Mensaje() { Titulo = "Error!", Contenido = "El mes no pudo ser insertado en la base de datos", Tipo = TipoMensaje.ERROR }; litMensaje.Text = Disenio.GenerarMensaje(Mensaje); } }
/// <summary> /// Leonardo Carrion /// 04/nov/2019 /// Efecto: obtiene todas las proyeccion de la base de datos del periodo y funcionario consultado /// Requiere: periodo y funcionario /// Modifica: - /// Devuelve: lista de proyecciones /// </summary> /// <returns></returns> public List <Proyeccion> getProyeccionesPorPeriodoYFuncionario(Periodo periodoConsulta, Funcionario funcionarioConsulta) { SqlConnection sqlConnection = conexion.conexionPEP(); List <Proyeccion> listaProyecciones = new List <Proyeccion>(); String consulta = @"select P.*, F.nombre_funcionario, M.nombre_mes, M.numero from Proyeccion P, Funcionario F, Mes M where P.ano_periodo = @anoPeriodo and P.id_funcionario = @idFuncionario and F.id_funionario = P.id_funcionario and M.id_mes = P.id_mes order by F.id_funionario, M.numero ;"; SqlCommand sqlCommand = new SqlCommand(consulta, sqlConnection); sqlCommand.Parameters.AddWithValue("@anoPeriodo", periodoConsulta.anoPeriodo); sqlCommand.Parameters.AddWithValue("@idFuncionario", funcionarioConsulta.idFuncionario); SqlDataReader reader; sqlConnection.Open(); reader = sqlCommand.ExecuteReader(); while (reader.Read()) { Proyeccion proyeccion = new Proyeccion(); Periodo periodo = new Periodo(); Mes mes = new Mes(); Funcionario funcionario = new Funcionario(); periodo.anoPeriodo = Convert.ToInt32(reader["ano_periodo"].ToString()); proyeccion.periodo = periodo; mes.idMes = Convert.ToInt32(reader["id_mes"].ToString()); mes.nombreMes = reader["nombre_mes"].ToString(); mes.numero = Convert.ToInt32(reader["numero"].ToString()); funcionario.idFuncionario = Convert.ToInt32(reader["id_funcionario"].ToString()); funcionario.nombreFuncionario = reader["nombre_funcionario"].ToString(); proyeccion.idProyeccion = Convert.ToInt32(reader["id_proyeccion"].ToString()); proyeccion.funcionario = funcionario; proyeccion.mes = mes; proyeccion.montoSalario = Convert.ToDouble(reader["monto_salario"].ToString()); proyeccion.montoCargasTotal = Convert.ToDouble(reader["monto_cargas_total"].ToString()); listaProyecciones.Add(proyeccion); } sqlConnection.Close(); return(listaProyecciones); }
private void btnGenerar_Click(object sender, EventArgs e) { Mes mesClase = new Mes(); Random rnd = new Random(); mesClase.Maxima = rnd.Next(0, 30); mesClase.Minima = rnd.Next(0, 30); mesClase.Media = (mesClase.Maxima + mesClase.Minima) / 2; mesClase.Nombre = this.lstMeses.SelectedItem.ToString(); this.txtNombre.Text = mesClase.Nombre; this.txtMaxima.Text = mesClase.Maxima.ToString(); this.txtMinima.Text = mesClase.Minima.ToString(); this.txtMedia.Text = mesClase.Media.ToString(); }
// GET: Mes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Mes mes = db.Mes.Find(id); if (mes == null) { return(HttpNotFound()); } return(View(mes)); }
protected void SetUp() { _wc1 = Substitute.For <IAcceptWorkorders>(); _wc1.Name.Returns(WC1); _wc1.ReceivesType(TYPE1).Returns(true); _wc1.ReceivesType(TYPE2).Returns(false); _wc2 = Substitute.For <IAcceptWorkorders>(); _wc2.Name.Returns(WC2); _wc2.ReceivesType(TYPE1).Returns(false); _wc2.ReceivesType(TYPE2).Returns(true); _subject = new Mes("mes"); _subject.Add(_wc1); _subject.Add(_wc2); }
public async Task <Competencia> CriarAsync(Guid id, int ano, Mes mes) { var competenciaPorAnoeMes = await _competenciaRepository.ObterPorAnoEMesAsync(ano, (int)mes); if (competenciaPorAnoeMes != null) { throw new CompetenciaJaExistenteParaAnoEMesException(mes.ToString(), ano.ToString("0000")); } var competencia = new Competencia(id, DateTime.Now, new Ano(ano), mes); await _competenciaRepository.AddAsync(competencia); return(competencia); }
private Mes ObtenerMesCombo() { try { Mes _Datos = new Mes(); if (cmbMeses.SelectedIndex != -1) { _Datos = (Mes)cmbMeses.SelectedItem; } return(_Datos); } catch (Exception ex) { throw ex; } }
void CargarCombos() { DataTableCargar(); CboMeses.DataSource = Mes.FetchList(); CboMeses.DisplayMember = "c_des"; CboMeses.ValueMember = "n_id"; CboResponsable.DataSource = PersonalContabilidad.FetchList(STU_SISTEMA.EMPRESAID, 2); CboResponsable.DisplayMember = "c_destra"; CboResponsable.ValueMember = "n_id"; CboConfiguracion.DataSource = ConfigVal.FetchList(STU_SISTEMA.EMPRESAID); CboConfiguracion.DisplayMember = "c_des"; CboConfiguracion.ValueMember = "n_id"; }
public void Seed() { if (_controleFinanceiroContext.Categorias.Any() || _controleFinanceiroContext.Meses.Any() || _controleFinanceiroContext.Meses.Any()) { return; } else { Mes mes01 = new Mes(1, "Janeiro"); Mes mes02 = new Mes(2, "Fevereiro"); Mes mes03 = new Mes(3, "Março"); Mes mes04 = new Mes(4, "Abril"); Mes mes05 = new Mes(5, "Maio"); Mes mes06 = new Mes(6, "Junho"); Mes mes07 = new Mes(7, "Julho"); Mes mes08 = new Mes(8, "Agosto"); Mes mes09 = new Mes(9, "Setembro"); Mes mes10 = new Mes(10, "Outubro"); Mes mes11 = new Mes(11, "Novembro"); Mes mes12 = new Mes(12, "Dezembro"); Categoria cat01 = new Categoria(1, "Habitação"); Categoria cat02 = new Categoria(2, "Transporte"); Categoria cat03 = new Categoria(3, "Saude"); Categoria cat04 = new Categoria(4, "Educação"); Categoria cat05 = new Categoria(5, "Imposto"); Categoria cat06 = new Categoria(6, "Alimentação"); Categoria cat07 = new Categoria(7, "Cartão de Credito"); Categoria cat08 = new Categoria(8, "Cuidados Pessoais"); Categoria cat09 = new Categoria(9, "Manutenção/Prevensão"); Categoria cat10 = new Categoria(10, "Lazer"); Categoria cat11 = new Categoria(11, "Vestuario"); Categoria cat12 = new Categoria(12, "Outros"); Tipo tipo01 = new Tipo(1, "Despesa Fixa"); Tipo tipo02 = new Tipo(2, "Despesa Variavel"); Tipo tipo03 = new Tipo(3, "Despesa Extra"); _controleFinanceiroContext.Meses.AddRange(mes01, mes02, mes03, mes04, mes05, mes06, mes07, mes08, mes09, mes10, mes11, mes12); _controleFinanceiroContext.Categorias.AddRange(cat01, cat02, cat03, cat04, cat05, cat06, cat07, cat08, cat09, cat10, cat11, cat12); _controleFinanceiroContext.Tipos.AddRange(tipo01, tipo02, tipo03); _controleFinanceiroContext.SaveChanges(); } }
public ResultProcessing SalvarMes(Mes mes) { var result = new ResultProcessing(); try { if (mes.Id == 0) { mes.Professor = contexto.Professores.FirstOrDefault(); contexto.Meses.Add(mes); } else { var mesDB = contexto.Meses.FirstOrDefault(x => x.Id == mes.Id); if (mesDB.Pago == false && mes.Pago) { mesDB.DiaPagamento = DateTime.Now; } if (mesDB.Pago && mes.Pago == false) { mesDB.DiaPagamento = null; } mesDB.Pago = mes.Pago; mesDB.PlanoId = mes.PlanoId; mesDB.ValorPromocional = mes.ValorPromocional; if (mesDB.Ativo && mes.Ativo == false) { mesDB.DiaPagamento = null; mesDB.Pago = false; } mesDB.Ativo = mes.Ativo; contexto.Entry(mesDB).State = EntityState.Modified; } result.Success = true; result.Message = "Salvo com Sucesso"; result.Id = mes.Id; contexto.SaveChanges(); } catch (Exception e) { result.Success = false; result.Message = e.Message; } return(result); }
public JsonResult Pagar(Mes mes) { var result = new ResultProcessing(); result = servico.Pagar(mes.Id); if (result.Success) { result.Message = "Editado com Sucesso"; } else { result.Success = false; result.Message = "Registro não encontrado"; } return(Json(new { success = result.Success, message = result.Message })); }
//ir a la base private void buttonTerminarAct_Click(object sender, RoutedEventArgs e) { if (!periodoCreado) { MessageBox.Show("Primero debe definir un periodo.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } else { Mes[] ListaMeses = new Mes[12]; string mes; if (Enero.FechaInicio == null) { Enero.FechaInicio = "1/1/" + anio; Enero.FechaFin = "1/31" + anio; } if (Febrero.FechaInicio == null) { Febrero.FechaInicio = "2/1/" + anio; Febrero.FechaFin = "2/28" + anio; } if (Marzo.FechaInicio == null) { Marzo.FechaInicio = "3/1/" + anio; Marzo.FechaFin = "3/31" + anio; } if (Abril.FechaInicio == null) { Abril.FechaInicio = "4/1/" + anio; Abril.FechaFin = "4/30" + anio; } if (Mayo.FechaInicio == null) { Mayo.FechaInicio = "5/1/" + anio; Mayo.FechaFin = "5/31" + anio; } if (Junio.FechaInicio == null) { Junio.FechaInicio = "6/1/" + anio; Junio.FechaFin = "6/30" + anio; } if (Julio.FechaInicio == null) { Julio.FechaInicio = "7/1/" + anio; Julio.FechaFin = "7/31" + anio; } if (Agosto.FechaInicio == null) { Agosto.FechaInicio = "8/1/" + anio; Agosto.FechaFin = "8/31" + anio; } if (Septiembre.FechaInicio == null) { Septiembre.FechaInicio = "9/1/" + anio; Septiembre.FechaFin = "9/30" + anio; } if (Octubre.FechaInicio == null) { Octubre.FechaInicio = "10/1/" + anio; Octubre.FechaFin = "10/31" + anio; } if (Noviembre.FechaInicio == null) { Noviembre.FechaInicio = "11/1/" + anio; Noviembre.FechaFin = "11/30" + anio; } if (Diciembre.FechaInicio == null) { Diciembre.FechaInicio = "12/1/" + anio; Diciembre.FechaFin = "12/31" + anio; } anio = datePickerMesInicio.DisplayDate.Year.ToString(); mes = datePickerMesInicio.DisplayDate.Month.ToString(); int mesInt; if (int.TryParse(mes, out mesInt)){ if (mesInt == 2) { FechaFin = "12"; } else { FechaFin = (mesInt - 1).ToString(); } } /* ¿Es igual q lo de arriba? switch (mes) { case "1": FechaFin = "12"; break; case "2": FechaFin = "1"; break; case "3": FechaFin = "2"; break; case "4": FechaFin = "3"; break; case "5": FechaFin = "4"; break; case "6": FechaFin = "5"; break; case "7": FechaFin = "6"; break; case "8": FechaFin = "7"; break; case "9": FechaFin = "8"; break; case "10": FechaFin = "9"; break; case "11": FechaFin = "10"; break; case "12": FechaFin = "11"; break; } */ FechaInicio = datePickerMesInicio.SelectedDate.Value.Month + "/" + datePickerMesInicio.SelectedDate.Value.Day + "/" + datePickerMesInicio.SelectedDate.Value.Year; FechaFin = FechaFin + "/" + comboBoxFinPeriodo.SelectedItem + "/" + anio; ListaMeses[0] = Enero; ListaMeses[1] = Febrero; ListaMeses[2] = Marzo; ListaMeses[3] = Abril; ListaMeses[4] = Mayo; ListaMeses[5] = Junio; ListaMeses[6] = Julio; ListaMeses[7] = Agosto; ListaMeses[8] = Septiembre; ListaMeses[9] = Octubre; ListaMeses[10] = Noviembre; ListaMeses[11] = Diciembre; //meter la consulta if (true) { MessageBox.Show("Actualizacion de los estados realizada.", "", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show("Imposible actualizar el periodo contable", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } } }
//ir a la base private void buttonTerminar_Click(object sender, RoutedEventArgs e) { if (datePickerMesInicio.SelectedDate == null || comboBoxFinPeriodo.SelectedItem == null) { MessageBox.Show("Debe seleccionar un mes de inicio.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } else { Mes[] ListaMeses = new Mes[12]; string mes; if (Enero.FechaInicio == null) { Enero.NombreMes = "Enero"; Enero.EstadoMes = "Abierto"; Enero.FechaInicio = "1/1/" + anio; Enero.FechaFin = "1/31/" + anio ; } if (Febrero.FechaInicio == null) { Febrero.NombreMes = "Febrero"; Febrero.EstadoMes = "Abierto"; Febrero.FechaInicio = "2/1/" + anio; Febrero.FechaFin = "2/28/" + anio; } if (Marzo.FechaInicio == null) { Marzo.NombreMes = "Marzo"; Marzo.EstadoMes = "Abierto"; Marzo.FechaInicio = "3/1/" + anio; Marzo.FechaFin = "3/31/" + anio; } if (Abril.FechaInicio == null) { Abril.NombreMes = "Abril"; Abril.EstadoMes = "Abierto"; Abril.FechaInicio = "4/1/" + anio; Abril.FechaFin = "4/30/" + anio; } if (Mayo.FechaInicio == null) { Mayo.NombreMes = "Mayo"; Mayo.EstadoMes = "Abierto"; Mayo.FechaInicio = "5/1/" + anio; Mayo.FechaFin = "5/31/" + anio; } if (Junio.FechaInicio == null) { Junio.NombreMes = "Junio"; Junio.EstadoMes = "Abierto"; Junio.FechaInicio = "6/1/" + anio; Junio.FechaFin = "6/30/" + anio; } if (Julio.FechaInicio == null) { Julio.NombreMes = "Julio"; Julio.EstadoMes = "Abierto"; Julio.FechaInicio = "7/1/" + anio; Julio.FechaFin = "7/31/" + anio; } if (Agosto.FechaInicio == null) { Agosto.NombreMes = "Agosto"; Agosto.EstadoMes = "Abierto"; Agosto.FechaInicio = "8/1/" + anio; Agosto.FechaFin = "8/31/" + anio; } if (Septiembre.FechaInicio == null) { Septiembre.NombreMes = "Septiembre"; Septiembre.EstadoMes = "Abierto"; Septiembre.FechaInicio = "9/1/" + anio; Septiembre.FechaFin = "9/30/" + anio; } if (Octubre.FechaInicio == null) { Octubre.NombreMes = "Octubre"; Octubre.EstadoMes = "Abierto"; Octubre.FechaInicio = "10/1/" + anio; Octubre.FechaFin = "10/31/" + anio; } if (Noviembre.FechaInicio == null) { Noviembre.NombreMes = "Noviembre"; Noviembre.EstadoMes = "Abierto"; Noviembre.FechaInicio = "11/1/" + anio; Noviembre.FechaFin = "11/30/" + anio; } if (Diciembre.FechaInicio == null) { Diciembre.NombreMes = "Diciembre"; Diciembre.EstadoMes = "Abierto"; Diciembre.FechaInicio = "12/1/" + anio; Diciembre.FechaFin = "12/31/" + anio; } anio = datePickerMesInicio.DisplayDate.Year.ToString(); mes = datePickerMesInicio.DisplayDate.Month.ToString(); switch (mes) { case "1": FechaFin = "12"; break; case "2": FechaFin = "1"; break; case "3": FechaFin = "2"; break; case "4": FechaFin = "3"; break; case "5": FechaFin = "4"; break; case "6": FechaFin = "5"; break; case "7": FechaFin = "6"; break; case "8": FechaFin = "7"; break; case "9": FechaFin = "8"; break; case "10": FechaFin = "9"; break; case "11": FechaFin = "10"; break; case "12": FechaFin = "11"; break; } FechaInicio = datePickerMesInicio.SelectedDate.Value.Month + "/" + datePickerMesInicio.SelectedDate.Value.Day + "/" + datePickerMesInicio.SelectedDate.Value.Year; //FechaInicio = datePickerMesInicio.SelectedDate.Value.Year + "-" + datePickerMesInicio.SelectedDate.Value.Month + "-" + datePickerMesInicio.SelectedDate.Value.Day; FechaFin = FechaFin + "-" + comboBoxFinPeriodo.SelectedItem + "-" + anio; ListaMeses[0] = Enero; ListaMeses[1] = Febrero; ListaMeses[2] = Marzo; ListaMeses[3] = Abril; ListaMeses[4] = Mayo; ListaMeses[5] = Junio; ListaMeses[6] = Julio; ListaMeses[7] = Agosto; ListaMeses[8] = Septiembre; ListaMeses[9] = Octubre; ListaMeses[10] = Noviembre; ListaMeses[11] = Diciembre; //meter consulta if (true) { if (ServicioFinanzas.Instancia.GuardarPeriodoContable(FechaInicio,FechaFin,int.Parse(anio),ListaMeses)) { periodoCreado = true; MessageBox.Show("Creacion del periodo realizada.", "", MessageBoxButton.OK, MessageBoxImage.Information); } } else { MessageBox.Show("Imposible actualizar el periodo contable", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } } }
public bool GuardarPeriodoContable(string pFechaIn, string pFechaFin, int pAno, Mes[] pArregloMeses) { return _CSC.GuardarPeriodoContable(pFechaIn, pFechaFin, pAno, pArregloMeses); }
//ir a la base private void buttonCambioPeriodoAct_Click(object sender, RoutedEventArgs e) { if (!periodoCreado) { MessageBox.Show("Primero debe definir el periodo contable.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } else { if (comboBoxMesesAct.SelectedItem == null || comboBoxInicioAct.SelectedItem == null || comboBoxFinAct.SelectedItem == null || comboBoxEstadoAct.SelectedItem == null) { MessageBox.Show("Datos incompletos.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } else { string mes = comboBoxMesesAct.SelectedItem.ToString(); switch (mes) { case "Enero": Enero = new Mes() { NombreMes = "Enero", FechaInicio = comboBoxInicioAct.SelectedItem.ToString(), FechaFin = comboBoxFinAct.SelectedItem.ToString(), EstadoMes = comboBoxEstadoAct.SelectedItem.ToString() }; break; case "Febrero": Febrero = new Mes() { NombreMes = "Febrero", FechaInicio = comboBoxInicioAct.SelectedItem.ToString(), FechaFin = comboBoxFinAct.SelectedItem.ToString(), EstadoMes = comboBoxEstadoAct.SelectedItem.ToString() }; break; case "Marzo": Marzo = new Mes() { NombreMes = "Marzo", FechaInicio = comboBoxInicioAct.SelectedItem.ToString(), FechaFin = comboBoxFinAct.SelectedItem.ToString(), EstadoMes = comboBoxEstadoAct.SelectedItem.ToString() }; break; case "Abril": Abril = new Mes() { NombreMes = "Abril", FechaInicio = comboBoxInicioAct.SelectedItem.ToString(), FechaFin = comboBoxFinAct.SelectedItem.ToString(), EstadoMes = comboBoxEstadoAct.SelectedItem.ToString() }; break; case "Mayo": Mayo = new Mes() { NombreMes = "Mayo", FechaInicio = comboBoxInicioAct.SelectedItem.ToString(), FechaFin = comboBoxFinAct.SelectedItem.ToString(), EstadoMes = comboBoxEstadoAct.SelectedItem.ToString() }; break; case "Junio": Junio = new Mes() { NombreMes = "Junio", FechaInicio = comboBoxInicioAct.SelectedItem.ToString(), FechaFin = comboBoxFinAct.SelectedItem.ToString(), EstadoMes = comboBoxEstadoAct.SelectedItem.ToString() }; break; case "Julio": Julio = new Mes() { NombreMes = "Julio", FechaInicio = comboBoxInicioAct.SelectedItem.ToString(), FechaFin = comboBoxFinAct.SelectedItem.ToString(), EstadoMes = comboBoxEstadoAct.SelectedItem.ToString() }; break; case "Agosto": Agosto = new Mes() { NombreMes = "Agosto", FechaInicio = comboBoxInicioAct.SelectedItem.ToString(), FechaFin = comboBoxFinAct.SelectedItem.ToString(), EstadoMes = comboBoxEstadoAct.SelectedItem.ToString() }; break; case "Septiembre": Septiembre = new Mes() { NombreMes = "Septiembre", FechaInicio = comboBoxInicioAct.SelectedItem.ToString(), FechaFin = comboBoxFinAct.SelectedItem.ToString(), EstadoMes = comboBoxEstadoAct.SelectedItem.ToString() }; break; case "Octubre": Octubre = new Mes() { NombreMes = "Octubre", FechaInicio = comboBoxInicioAct.SelectedItem.ToString(), FechaFin = comboBoxFinAct.SelectedItem.ToString(), EstadoMes = comboBoxEstadoAct.SelectedItem.ToString() }; break; case "Noviembre": Noviembre = new Mes() { NombreMes = "Noviembre", FechaInicio = comboBoxInicioAct.SelectedItem.ToString(), FechaFin = comboBoxFinAct.SelectedItem.ToString(), EstadoMes = comboBoxEstadoAct.SelectedItem.ToString() }; break; case "Diciembre": Diciembre = new Mes() { NombreMes = "Diciembre", FechaInicio = comboBoxInicioAct.SelectedItem.ToString(), FechaFin = comboBoxFinAct.SelectedItem.ToString(), EstadoMes = comboBoxEstadoAct.SelectedItem.ToString() }; break; } comboBoxFinAct.SelectedIndex = -1; comboBoxInicioAct.SelectedIndex = -1; comboBoxEstadoAct.SelectedIndex = -1; comboBoxMesesAct.SelectedIndex = -1; } } }
public Fecha(int ssaa, Mes mm, int dd) { this.an = ssaa - 2000; this.mes = mm; this.dia = dd - 1; }
private void buttonRealizarCambioPeriodo_Click(object sender, RoutedEventArgs e) { if (datePickerMesInicio.SelectedDate == null || comboBoxFinPeriodo.SelectedItem == null) { MessageBox.Show("Debe seleccionar un mes de inicio.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } else { if (comboBoxMeses.SelectedItem == null || comboBoxInicio.SelectedItem == null || comboBoxFin.SelectedItem == null || comboBoxEstado.SelectedItem == null) { MessageBox.Show("Datos incompletos.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } else { string mes = comboBoxMeses.SelectedItem.ToString(); switch (mes) { case "Enero": Enero = new Mes() { NombreMes = "Enero", FechaInicio = comboBoxInicio.SelectedItem.ToString(), FechaFin = comboBoxFin.SelectedItem.ToString(), EstadoMes = comboBoxEstado.SelectedItem.ToString() }; break; case "Febrero": Febrero = new Mes() { NombreMes = "Febrero", FechaInicio = comboBoxInicio.SelectedItem.ToString(), FechaFin = comboBoxFin.SelectedItem.ToString(), EstadoMes = comboBoxEstado.SelectedItem.ToString() }; break; case "Marzo": Marzo = new Mes() { NombreMes = "Marzo", FechaInicio = comboBoxInicio.SelectedItem.ToString(), FechaFin = comboBoxFin.SelectedItem.ToString(), EstadoMes = comboBoxEstado.SelectedItem.ToString() }; break; case "Abril": Abril = new Mes() { NombreMes = "Abril", FechaInicio = comboBoxInicio.SelectedItem.ToString(), FechaFin = comboBoxFin.SelectedItem.ToString(), EstadoMes = comboBoxEstado.SelectedItem.ToString() }; break; case "Mayo": Mayo = new Mes() { NombreMes = "Mayo", FechaInicio = comboBoxInicio.SelectedItem.ToString(), FechaFin = comboBoxFin.SelectedItem.ToString(), EstadoMes = comboBoxEstado.SelectedItem.ToString() }; break; case "Junio": Junio = new Mes() { NombreMes = "Junio", FechaInicio = comboBoxInicio.SelectedItem.ToString(), FechaFin = comboBoxFin.SelectedItem.ToString(), EstadoMes = comboBoxEstado.SelectedItem.ToString() }; break; case "Julio": Julio = new Mes() { NombreMes = "Julio", FechaInicio = comboBoxInicio.SelectedItem.ToString(), FechaFin = comboBoxFin.SelectedItem.ToString(), EstadoMes = comboBoxEstado.SelectedItem.ToString() }; break; case "Agosto": Agosto = new Mes() { NombreMes = "Agosto", FechaInicio = comboBoxInicio.SelectedItem.ToString(), FechaFin = comboBoxFin.SelectedItem.ToString(), EstadoMes = comboBoxEstado.SelectedItem.ToString() }; break; case "Septiembre": Septiembre = new Mes() { NombreMes = "Septiembre", FechaInicio = comboBoxInicio.SelectedItem.ToString(), FechaFin = comboBoxFin.SelectedItem.ToString(), EstadoMes = comboBoxEstado.SelectedItem.ToString() }; break; case "Octubre": Octubre = new Mes() { NombreMes = "Octubre", FechaInicio = comboBoxInicio.SelectedItem.ToString(), FechaFin = comboBoxFin.SelectedItem.ToString(), EstadoMes = comboBoxEstado.SelectedItem.ToString() }; break; case "Noviembre": Noviembre = new Mes() { NombreMes = "Noviembre", FechaInicio = comboBoxInicio.SelectedItem.ToString(), FechaFin = comboBoxFin.SelectedItem.ToString(), EstadoMes = comboBoxEstado.SelectedItem.ToString() }; break; case "Diciembre": Diciembre = new Mes() { NombreMes = "Diciembre", FechaInicio = comboBoxInicio.SelectedItem.ToString(), FechaFin = comboBoxFin.SelectedItem.ToString(), EstadoMes = comboBoxEstado.SelectedItem.ToString() }; break; } comboBoxFin.SelectedIndex = -1; comboBoxInicio.SelectedIndex = -1; comboBoxEstado.SelectedIndex = -1; comboBoxMeses.SelectedIndex = -1; } } }