private void btnBuscar_Click(object sender, EventArgs e) { try { DataSet ds = new DataSet(); LoteBE LoteBE = new LoteBE() { OPCION = 21, USUARIO = General.General.GetUsuario, IdSocio_Dsc = TextBoxX1.Text.Trim(), sdDesembolso = dtDesembolsoInicio.Value, sdAprobacion = dtDesembolsoFin.Value, FlgConfimado = rbtnTodos.Checked? "1" : string.Empty, FlgEntregado = rbtnEntregado.Checked ? "1" : string.Empty, FlgPendiente = rbtnPendiente.Checked ? "1" : string.Empty, }; ds = new LoteBL().ProcesarLote(LoteBE); dgvLote.DataSource = ds.Tables[0]; lblRegistros.Text = ds.Tables[0].Rows.Count.ToString() + " registro(s)"; this.dgvLote.Columns["IdFormaDesembolso_tt_Dsc"].Width = 45; this.dgvLote.Columns["sdDesembolso"].Width = 80; FormatoGrid(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public int Guardar(GanadoIntensivoInfo ganadoIntensivo) { try { int result; Logger.Info(); var ganadoIntensivoDAL = new GanadoIntensivoDAL(); var loteBL = new LoteBL(); result = ganadoIntensivoDAL.Guardar(ganadoIntensivo); var filtroActualizarCabezasLote = new FiltroActualizarCabezasLote { CabezasProcesadas = ganadoIntensivo.Cabezas, LoteIDOrigen = ganadoIntensivo.Lote.LoteID, UsuarioModificacionID = ganadoIntensivo.UsuarioCreacionID, LoteIDDestino = 0 }; //loteBL.ActualizarCabezasProcesadas(filtroActualizarCabezasLote); return(result); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
private void btnEntregar_Click(object sender, EventArgs e) { DialogResult dialogResult = 0; try { List <LoteBE> LstLote = new List <LoteBE>(); if (dgvLote.RowCount > 0) { foreach (DataGridViewRow row in dgvLote.Rows) { DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["CheckSel"]; if (chk.Value.ToString() == "1") { LoteBE IEntity = new LoteBE() { OPCION = 25, USUARIO = General.General.GetUsuario, IdLote = row.Cells["IdLote"].Value.ToString(), cItem = row.Cells["cItem"].Value.ToString(), }; LstLote.Add(IEntity); } } if (LstLote.Count == 0) { MessageBox.Show("Debe seleccionar al menos un registro para el envío de confirmación.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } List <string> LstLoteDistinct = LstLote.Select(x => x.IdLote).Distinct().ToList(); List <LoteBE> LstLoteEnvio = new List <LoteBE>(); foreach (string item in LstLoteDistinct) { LoteBE IEntity = new LoteBE() { OPCION = 25, USUARIO = General.General.GetUsuario, IdLote = item }; LstLoteEnvio.Add(IEntity); } dialogResult = MessageBox.Show("¿Seguro de enviar la confirmación de los registros seleccionados?", "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialogResult == DialogResult.Yes) { string strResult = string.Empty; strResult = new LoteBL().ProcesarLoteEnvioConfirmacion(LstLoteEnvio); MessageBox.Show(strResult, "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); btnBuscar.PerformClick(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
internal int GuardarDetalle(GrupoVentaGanadoInfo venta) { var animalBL = new AnimalBL(); var corralBl = new CorralBL(); var loteBl = new LoteBL(); try { Logger.Info(); int retorno; using (var transaccion = new TransactionScope()) { var ventaGanadoDetalleDAL = new VentaGanadoDetalleDAL(); //Obtener Corral y Lote var corral = corralBl.ObtenerCorralPorCodigo(venta.OrganizacionId, venta.CodigoCorral); var lote = loteBl.ObtenerPorCorralCerrado(venta.OrganizacionId, corral.CorralID); if (venta.TipoVenta == Info.Enums.TipoVentaEnum.Propio) { //Validar si tenemos animales que pertenezcan a la carga inicial var listaCargaInicial = venta.VentaGandadoDetalle.Where(animal => animal.Animal.CargaInicial).ToList(); if (listaCargaInicial != null && listaCargaInicial.Any()) { foreach (var animal in listaCargaInicial) { var animalInventario = animalBL.ObtenerAnimalPorArete(animal.Arete, venta.OrganizacionId); var deteccionGrabar = new DeteccionInfo { CorralID = corral.CorralID, LoteID = lote.LoteID, UsuarioCreacionID = venta.VentaGanado.UsuarioModificacionID }; // Se intercambian aretes por encontrarse el animal en un corral distinto y ser carga inicial animalBL.ReemplazarAretes(animalInventario, deteccionGrabar); } } } retorno = ventaGanadoDetalleDAL.GuardarDetalle(venta); // Se cierral la transaccion transaccion.Complete(); } return(retorno); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
private void GenerarPDF() { string idloteerror = string.Empty; try { LoteBE oEntity = new LoteBE(); oEntity.OPCION = 31; oEntity.USUARIO = "Ejecutable"; DataSet ds = new DataSet(); ds = new LoteBL().ProcesarLote(oEntity); if (ds.Tables.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { DataSet dsLotes = new DataSet(); using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString)) { SqlCommand cmd1 = new SqlCommand("Rpt_Lote_Cab", con); cmd1.CommandType = CommandType.StoredProcedure; cmd1.Parameters.AddWithValue("@IdLote", dr["IdLote"].ToString()); SqlDataAdapter daCab = new SqlDataAdapter(cmd1); daCab.Fill(dsLotes, "Rpt_Lote_Cab"); SqlCommand cmd2 = new SqlCommand("Rpt_Lote_Det", con); cmd2.CommandType = CommandType.StoredProcedure; cmd2.Parameters.AddWithValue("@IdLote", dr["IdLote"].ToString()); SqlDataAdapter daDet = new SqlDataAdapter(cmd2); daDet.Fill(dsLotes, "Rpt_Lote_Det"); con.Close(); } EfideFactoring.Formula.Crystal.crRegLiquidacion ocrLoteLiquidacion = new EfideFactoring.Formula.Crystal.crRegLiquidacion(); ocrLoteLiquidacion.SetDataSource(dsLotes); ocrLoteLiquidacion.SetParameterValue("usuario", dr["Usuario"].ToString().Trim()); //General.General.GetUsuario); ocrLoteLiquidacion.SetParameterValue("moneda", dsLotes.Tables[0].Rows[0]["IdMoneda_Dsc"].ToString()); idloteerror = dr["IdLote"].ToString().Trim(); ocrLoteLiquidacion.ExportToDisk(ExportFormatType.PortableDocFormat, ConfigurationManager.AppSettings["RutaArchivoLiquidacionLote"].ToString() + dr["IdLote"].ToString().Trim() + ".pdf"); LoteBE oEntity1 = new LoteBE(); oEntity1.OPCION = 32; oEntity1.USUARIO = "Ejecutable"; oEntity1.IdLote = dr["IdLote"].ToString().Trim(); new LoteBL().ProcesarLote(oEntity1); } } } catch (Exception ex) { //MessageBox.Show(idloteerror); //MessageBox.Show(ex.Message); throw ex; } }
private void btnBuscar_Click(object sender, EventArgs e) { try { DataSet ds = new DataSet(); LoteBE LoteBE = new LoteBE() { OPCION = 24, USUARIO = General.General.GetUsuario, IdSocio_Dsc = TextBoxX1.Text.Trim(), IdPagadora_Dsc = txtIdPagadora_Dsc.Text.Trim(), sdDesembolso = rbtnConfirmados.Checked ? dtDesembolsoInicio.Value : DateTime.MinValue, sdAprobacion = rbtnConfirmados.Checked ? dtDesembolsoFin.Value : DateTime.MinValue, FlgEntregado = rbtnPEnviaronConfirmacion.Checked ? "1" : string.Empty, FlgConfimado = rbtnPendienteConfirmarPagadora.Checked ? "1" : string.Empty, FlgPendiente = rbtnConfirmados.Checked ? "1" : string.Empty, }; ds = new LoteBL().ProcesarLote(LoteBE); dt = ds.Tables[0]; dgvLote.DataSource = ds.Tables[0]; lblRegistros.Text = ds.Tables[0].Rows.Count.ToString() + " registro(s)"; this.dgvLote.Columns["IdOperacion_tt_Dsc"].Width = 60; this.dgvLote.Columns["IdFormaDesembolso_tt_Dsc"].Width = 60; this.dgvLote.Columns["sdDesembolso"].Width = 80; this.dgvLote.Columns["dtConfirmado"].Width = 80; this.dgvLote.Columns["dtEnvioCorreo"].Width = 80; FormatoGrid(); //IdLote //IdSocio_Dsc //IdPagadora_Dsc //IdDocumento_Dsc //IdOperacion_tt_Dsc //IdFormaDesembolso_tt_Dsc //sdDesembolso //dtConfirmado //UsuarioConfirmado //dtEnvioCorreo //UsuarioEnvioCorreo //IdEstado_tt_Dsc } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// Metodo para Guardar/Modificar una entidad CheckListCorral /// </summary> /// <param name="info"></param> /// <param name="xml"></param> internal int Guardar(CheckListCorralInfo info, XDocument xml) { try { using (var transaction = new TransactionScope()) { Logger.Info(); var checkListCorralDAL = new CheckListCorralDAL(); int result = info.CheckListCorralID; GuardarProyeccion(info, checkListCorralDAL); ArmarXML(info, xml); if (info.CheckListCorralID == 0) { result = checkListCorralDAL.Crear(info); } else { checkListCorralDAL.Actualizar(info); } var loteBL = new LoteBL(); var filtroCierreCorral = new FiltroCierreCorral { FechaSacrificio = info.FechaSacrificio, FechaCierre = info.Fecha, LoteID = info.LoteID, UsuarioModificacionID = info.UsuarioCreacionID }; loteBL.ActualizaFechaCerrado(filtroCierreCorral); transaction.Complete(); return(result); } } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
/// <summary> /// Actualiza la Disponibilidad de los Lotes /// </summary> /// <param name="filtroDisponilidadInfo"></param> /// <returns></returns> public void ActualizarLoteDisponibilidad(FiltroDisponilidadInfo filtroDisponilidadInfo) { try { Logger.Info(); var loteBL = new LoteBL(); loteBL.ActualizarLoteDisponibilidad(filtroDisponilidadInfo); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
public void ActualizaNoCabezasEnLoteOrigen(LoteInfo resultadoLoteOrigen) { try { Logger.Info(); var loteBL = new LoteBL(); loteBL.ActualizaNoCabezasEnLoteOrigen(resultadoLoteOrigen); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
/// <summary> /// Actualiza la Fecha de Cierre /// </summary> /// <param name="loteID"></param> /// <param name="usuarioModificacionID"> </param> public void ActualizaFechaCierre(int loteID, int usuarioModificacionID) { try { Logger.Info(); var loteBL = new LoteBL(); loteBL.ActualizaFechaCierre(loteID, usuarioModificacionID); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
/// <summary> /// Actualizar el numero de cabezas en lote y cambiar la fecha salida /// </summary> /// <param name="lote"></param> public void ActualizarFechaSalidaEnLote(LoteInfo lote) { try { Logger.Info(); var loteBL = new LoteBL(); loteBL.ActualizarFechaSalidaEnLote(lote); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
public AnimalSalidaInfo ObtenerAnimalSalidaPorCodigo(CorralInfo corralInfo) { try { Logger.Info(); var loteBL = new LoteBL(); return(loteBL.ObtenerAnimalSalidaPorCodigo(corralInfo)); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
/// <summary> /// Actualiza el Numero de Cabezas del Lote de productivo /// </summary> /// <param name="loteInfoDestino"></param> /// <param name="loteInfoOrigen"></param> public void ActualizaCabezasEnLoteProductivo(LoteInfo loteInfoDestino, LoteInfo loteInfoOrigen) { try { Logger.Info(); var loteBL = new LoteBL(); loteBL.ActualizaCabezasEnLoteProductivo(loteInfoDestino, loteInfoOrigen); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
public void EliminarSalidaEnfermeria(AnimalMovimientoInfo loteCorralOrigen) { try { Logger.Info(); var loteBL = new LoteBL(); loteBL.EliminarSalidaEnfermeria(loteCorralOrigen); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
public void ActualizarSalidaEnfermeria(AnimalMovimientoInfo resultadoLoteOrigen) { try { Logger.Info(); var loteBL = new LoteBL(); loteBL.ActualizarSalidaEnfermeria(resultadoLoteOrigen); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
/// <summary> /// Actualiza la entrada/salida a zilmax /// </summary> /// <param name="lotes"></param> public void GuardarEntradaSalidaZilmax(List <LoteInfo> lotes) { try { Logger.Info(); var loteBL = new LoteBL(); loteBL.GuardarEntradaSalidaZilmax(lotes); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
internal int GuardarAnimalSalida(List <AnimalInfo> listaAnimales, ProgramacionSacrificioGuardadoInfo programacionSacrificioGuardadoInfo) { int result; try { Logger.Info(); var loteBL = new LoteBL(); using (var transaccion = new TransactionScope()) { var loteInfo = loteBL.ObtenerPorID(programacionSacrificioGuardadoInfo.LoteID); var deteccionGrabar = new DeteccionInfo { CorralID = loteInfo.CorralID, LoteID = loteInfo.LoteID, UsuarioCreacionID = programacionSacrificioGuardadoInfo.UsuarioID }; foreach (var animal in listaAnimales) { if (animal != null && animal.CargaInicial) { // Se intercambian aretes por encontrarse el animal en un corral distinto y ser carga inicial var animalBL = new AnimalBL(); animalBL.ReemplazarAretes(animal, deteccionGrabar); } } var programacionSacrificio = new ProgramacionSacrificioDAL(); result = programacionSacrificio.GuardarAnimalSalida(listaAnimales, programacionSacrificioGuardadoInfo); transaccion.Complete(); } } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } return(result); }
/// <summary> /// Actualiza el corral de un lote /// </summary> /// <param name="lote"></param> /// <param name="corralInfoDestino"></param> /// <param name="usuario"></param> /// <returns></returns> internal bool ActualizarCorral(LoteInfo lote, CorralInfo corralInfoDestino, UsuarioInfo usuario) { try { Logger.Info(); var loteBL = new LoteBL(); return(loteBL.ActualizarCorral(lote, corralInfoDestino, usuario)); } catch (ExcepcionGenerica ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
public ResultadoInfo <LoteInfo> ObtenerLotesCorralPorPagina(PaginacionInfo paginacion, LoteInfo lote) { try { Logger.Info(); var loteBL = new LoteBL(); return(loteBL.ObtenerLotesCorralPorPagina(paginacion, lote)); } catch (ExcepcionGenerica ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
public TipoGanadoInfo ObtenerSoloTipoGanadoCorral(List <AnimalInfo> animales, LoteInfo lote) { try { Logger.Info(); var loteBL = new LoteBL(); return(loteBL.ObtenerSoloTipoGanadoCorral(animales, lote)); } catch (ExcepcionGenerica ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
public DateTime?ObtenerFechaUltimoConsumo(int loteId) { try { Logger.Info(); var loteBL = new LoteBL(); return(loteBL.ObtenerFechaUltimoConsumo(loteId)); } catch (ExcepcionGenerica ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
public LoteInfo ObtenerLotePorCorral(LoteInfo info) { try { Logger.Info(); var loteBL = new LoteBL(); return(loteBL.ObtenerLotePorCorral(info)); } catch (ExcepcionGenerica ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
public LoteInfo DeteccionObtenerPorCorral(int organizacionID, int corralID) { try { Logger.Info(); var loteBL = new LoteBL(); LoteInfo loteInfo = loteBL.DeteccionObtenerPorCorral(organizacionID, corralID); return(loteInfo); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
/// <summary> /// Se obtiene el lote de una corraleta /// </summary> /// <param name="corraleta"></param> /// <returns></returns> public IList <LoteInfo> ObtenerLoteDeCorraleta(CorralInfo corraleta) { try { Logger.Info(); var loteBL = new LoteBL(); var lote = loteBL.ObtenerLoteDeCorraleta(corraleta); return(lote); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
/// <summary> /// Obtiene un Lote por Organizacion y Lote /// </summary> /// <param name="organizacionID"></param> /// <param name="lote"></param> /// <returns></returns> public LoteInfo ObtenerPorOrganizacionIdLote(int organizacionID, string lote) { try { Logger.Info(); var loteBL = new LoteBL(); LoteInfo loteInfo = loteBL.ObtenerPorOrganizacionIdLote(organizacionID, lote); return(loteInfo); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
/// <summary> /// Obtiene una lista de Lote filtrando por el estatus Activo = 1, Inactivo = 0 /// </summary> /// <returns></returns> public IList <LoteInfo> ObtenerTodos(EstatusEnum estatus) { try { Logger.Info(); var loteBL = new LoteBL(); IList <LoteInfo> lista = loteBL.ObtenerTodos(estatus); return(lista); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
/// <summary> /// Obtiene corral con sus lotes, grupo y tipo de corral /// </summary> /// <param name="organizacionID"></param> /// <param name="codigo"></param> /// <returns></returns> public IEnumerable <LoteInfo> ObtenerPorCodigoCorralOrganizacionID(int organizacionID, string codigo) { try { Logger.Info(); var loteBL = new LoteBL(); IEnumerable <LoteInfo> lotes = loteBL.ObtenerPorCodigoCorralOrganizacionID(organizacionID, codigo); return(lotes); } catch (ExcepcionGenerica ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
/// <summary> /// Obtiene los lotes por XML /// </summary> /// <param name="lotes"></param> /// <returns></returns> public IEnumerable <LoteInfo> ObtenerPorLoteXML(List <LoteInfo> lotes) { try { Logger.Info(); var loteBL = new LoteBL(); IEnumerable <LoteInfo> lotesSIAP = loteBL.ObtenerPorLoteXML(lotes); return(lotesSIAP); } catch (ExcepcionGenerica ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
public LoteInfo ObtenerPorLote(LoteInfo loteInfo) { try { Logger.Info(); var loteBL = new LoteBL(); LoteInfo lote = loteBL.ObtenerPorID(loteInfo.LoteID); return(lote); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
/// <summary> /// Obtiene la información del Lote para Check List /// </summary> /// <returns></returns> public CheckListCorralInfo ObtenerCheckListCorralCompleto(FiltroCierreCorral filtroCierreCorral) { try { Logger.Info(); var loteBL = new LoteBL(); CheckListCorralInfo checkList = loteBL.ObtenerCheckListCorralCompleto(filtroCierreCorral); return(checkList); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }