public Boolean AnularDB(prod_GestionProductivaAcero_CusTalme_Info Info, ref string Mensaje) { try { using (EntitiesProduccion oEnt = new EntitiesProduccion()) { var Contact = oEnt.prod_GestionProductivaAcero_CusTalme.FirstOrDefault(var => var.IdEmpresa == Info.IdEmpresa && var.IdGestionAceria == Info.IdGestionAceria && var.IdSucursal == Info.IdSucursal); if (Contact != null) { Contact.Estado = "I"; oEnt.SaveChanges(); Mensaje = "Se Ha procedido Anular Con exito La Transaccion # " + Info.IdGestionAceria; } } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); mensaje = ex.ToString() + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.ToString().ToString()); } }
private void gridView_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { try { _Info = (prod_GestionProductivaAcero_CusTalme_Info)gridView.GetFocusedRow(); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); } }
public Boolean Anular(prod_GestionProductivaAcero_CusTalme_Info Info, ref string Mensaje) { try { Info.Fecha_UltAnu = param.Fecha_Transac; Info.IdUsuario = param.IdUsuario; Info.ip = param.ip; Info.nom_pc = param.nom_pc; return(Data.AnularDB(Info, ref Mensaje)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Anular", ex.Message), ex) { EntityType = typeof(prod_GestionProductivaAcero_CusTalme_Bus) }; } }
public Boolean GuardarDB(prod_GestionProductivaAcero_CusTalme_Info Info, ref Decimal IdGestion, ref string Mensaje) { try { List <prod_GestionProductivaAcero_CusTalme_Info> Lst = new List <prod_GestionProductivaAcero_CusTalme_Info>(); using (EntitiesProduccion Context = new EntitiesProduccion()) { var Address = new prod_GestionProductivaAcero_CusTalme(); Address.IdEmpresa = Info.IdEmpresa; Address.IdSucursal = Info.IdSucursal; Address.IdGestionAceria = IdGestion = GetId(Info.IdEmpresa); Address.Fecha = Info.Fecha; Address.IdHorno = Info.IdHorno; Address.IdColada = Info.IdColada; Address.chat_En_Horno = Info.chat_En_Horno; Address.chat_Cargada = Info.chat_Cargada; Address.Vaci_TempC = Info.Vaci_TempC; Address.Vaci_acero = Info.Vaci_acero; Address.EnHor_Acero = Info.EnHor_Acero; Address.EnHor_Perdida = Info.EnHor_Perdida; Address.Comps_C = Info.Comps_C; Address.Comps_Si = Info.Comps_Si; Address.Comps_Mn = Info.Comps_Mn; Address.Comps_P = Info.Comps_P; Address.Comps_S = Info.Comps_S; Address.Comps_SAE = Info.Comps_SAE; Address.AdiMet_Carburante = Info.AdiMet_Carburante; Address.AdiMet_Cal = Info.AdiMet_Cal; Address.AdiMet_Desercoriante = Info.AdiMet_Desercoriante; Address.Tiem_Encendido = Info.Tiem_Encendido; Address.Tiem_Apagado = Info.Tiem_Apagado; Address.Tiem_Fundicion = Info.Tiem_Fundicion; Address.Tiem_Vaciado = Info.Tiem_Vaciado; Address.Tiem_Total = Info.Tiem_Total; Address.Ener_Ea = Info.Ener_Ea; Address.Ener_Er = Info.Ener_Er; Address.Ener_Total = Info.Ener_Total; Address.Ferroa_FeSi = Info.Ferroa_FeSi; Address.Ferroa_FeMn = Info.Ferroa_FeMn; Address.IndiHor_Rendimiento = Info.IndiHor_Rendimiento; Address.IndiHor_Productividad = Info.IndiHor_Productividad; Address.Tundish = Info.Tundish; Address.InicioCC = Info.InicioCC; Address.FinCC = Info.FinCC; Address.Tiempo = Info.Tiempo; Address.AceroCldo = Info.AceroCldo; Address.Palanquilla = Info.Palanquilla; Address.Marrano = Info.Marrano; Address.Escoria = Info.Escoria; Address.PerdidaCC = Info.PerdidaCC; Address.RendtCC = Info.RendtCC; Address.ProductivCC = Info.ProductivCC; Address.IdProducto_TipoPalanquilla = Info.IdProducto_TipoPalanquilla; Address.Unidades = Info.Unidades; Address.Longitud = Info.Longitud; Address.PesoUnitario = Info.PesoUnitario; Address.PesoMetro = Info.PesoMetro; Address.Perdida = Info.Perdida; Address.ProdRend = Info.ProdRend; Address.ProdProduct = Info.ProdProduct; Address.Observacion = Info.Observacion; Address.IdUsuario = Info.IdUsuario; Address.Fecha_Transaccion = Info.Fecha_Transaccion; Address.IdUsuarioUltModi = Info.IdUsuarioUltModi; Address.Fecha_UltMod = Info.Fecha_UltMod; Address.nom_pc = Info.nom_pc; Address.ip = Info.ip; Address.Estado = "A"; Address.Termopares = Info.Termopares; Address.FeSiMn = Info.FeSiMn; Context.prod_GestionProductivaAcero_CusTalme.Add(Address); Context.SaveChanges(); Mensaje = "Se A Procedido A guardar Con exito el Registro #" + Address.IdGestionAceria; } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); mensaje = ex.ToString() + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.ToString().ToString()); } }
void Get() { try { _Info = new prod_GestionProductivaAcero_CusTalme_Info(); _Info.IdEmpresa = param.IdEmpresa; _Info.IdSucursal = Convert.ToInt32(cmbSucursal.EditValue); _Info.Fecha = Convert.ToDateTime(Convert.ToDateTime(dtpFecha.EditValue).ToShortDateString()); _Info.IdHorno = Convert.ToInt16(cmbHorno.EditValue); _Info.IdColada = Convert.ToDecimal(txtColada.EditValue); _Info.chat_En_Horno = Convert.ToDouble(txtChatarraHorno.EditValue); _Info.chat_Cargada = Convert.ToDouble(txtchatarraCargada.EditValue); _Info.Vaci_TempC = Convert.ToDouble(txtVaciado.EditValue); _Info.Vaci_acero = Convert.ToDouble(txtVaciadoAcero.EditValue); _Info.EnHor_Acero = Convert.ToDouble(TxtHornoAcero.EditValue); _Info.EnHor_Perdida = Convert.ToDouble(txtHornoPerdida.EditValue); _Info.Comps_C = Convert.ToDouble(txtComposicionC.EditValue); _Info.Comps_Si = Convert.ToDouble(txtComposicionSi.EditValue); _Info.Comps_Mn = Convert.ToDouble(txtComposicionMn.EditValue); _Info.Comps_P = Convert.ToDouble(txtComposicionP.EditValue); _Info.Comps_S = Convert.ToDouble(txtComposicionS.EditValue); _Info.Comps_SAE = Convert.ToDouble(txtComposicionSAE.EditValue); _Info.AdiMet_Carburante = Convert.ToDouble(txtAdicionalesCarburante.EditValue); _Info.AdiMet_Cal = Convert.ToDouble(txtAdicionalesCal.EditValue); _Info.AdiMet_Desercoriante = Convert.ToDouble(txtAdicionalesDeserCoriante.EditValue); string[] tiempoEncendido = txtTiempoEncendido.Text.Split(':'); string[] tiempoApagado = txtTiempoApagado.Text.Split(':'); string[] tiempoFundicion = txtTiempoFundicion.Text.Split(':'); string[] tiempoVaciado = txtTiempoVaciado.Text.Split(':'); string[] tiempototal = txtTiempoTotal.Text.Split(':'); _Info.Tiem_Encendido = new TimeSpan(Convert.ToInt32(tiempoEncendido[0]), Convert.ToInt32(tiempoEncendido[1]), 0); _Info.Tiem_Apagado = new TimeSpan(Convert.ToInt32(tiempoApagado[0]), Convert.ToInt32(tiempoApagado[1]), 0); _Info.Tiem_Fundicion = new TimeSpan(Convert.ToInt32(tiempoFundicion[0]), Convert.ToInt32(tiempoFundicion[1]), 0); _Info.Tiem_Vaciado = new TimeSpan(Convert.ToInt32(tiempoVaciado[0]), Convert.ToInt32(tiempoVaciado[1]), 0); _Info.Tiem_Total = new TimeSpan(Convert.ToInt32(tiempototal[0]), Convert.ToInt32(tiempototal[1]), 0); _Info.Ener_Ea = Convert.ToDouble(txtEnergiaEa.EditValue); _Info.Ener_Er = Convert.ToDouble(txtEnergiaEr.EditValue); _Info.Ener_Total = Convert.ToDouble(txtEnergiaTotal.EditValue); _Info.Ferroa_FeSi = Convert.ToDouble(txtFerroaleacionesFesi.EditValue); _Info.Ferroa_FeMn = Convert.ToDouble(txtFerroaleacionesFeMn.EditValue); _Info.IndiHor_Productividad = Convert.ToDouble(txtIndicadoresProductividad.EditValue); _Info.IndiHor_Rendimiento = Convert.ToDouble(txtIndicadoresRendimiento.EditValue); _Info.Observacion = txtObservacion.Text; _Info.Tundish = Convert.ToDecimal(txtTundish.EditValue); string[] InicioCC = txtIncioCC.Text.Split(':'); string[] FinCC = txtFinCC.Text.Split(':'); string[] Tiempo = txtTiempo.Text.Split(':'); _Info.InicioCC = new TimeSpan(Convert.ToInt32(InicioCC[0]), Convert.ToInt32(InicioCC[1]), 0); _Info.FinCC = new TimeSpan(Convert.ToInt32(FinCC[0]), Convert.ToInt32(FinCC[1]), 0); _Info.Tiempo = new TimeSpan(Convert.ToInt32(Tiempo[0]), Convert.ToInt32(Tiempo[1]), 0); _Info.AceroCldo = Convert.ToDouble(txtAceroCldo.EditValue); _Info.Palanquilla = Convert.ToDouble(txtPalanquilla.EditValue); _Info.Marrano = Convert.ToDouble(txtMarrano.EditValue); _Info.Escoria = Convert.ToDouble(txtEscoria.EditValue); _Info.PerdidaCC = Convert.ToDouble(txtPerdidaCC.EditValue); _Info.RendtCC = Convert.ToDouble(txtRendtCC.EditValue); _Info.ProductivCC = Convert.ToDouble(txtProductvCC.EditValue); _Info.IdProducto_TipoPalanquilla = Convert.ToDouble(cmbTipo.EditValue); _Info.Unidades = Convert.ToDouble(txtUnidades.EditValue); _Info.Longitud = Convert.ToDouble(txtLongitud.EditValue); _Info.PesoUnitario = Convert.ToDouble(txtPesoUnitario.EditValue); _Info.PesoMetro = Convert.ToDouble(txtPesoMetro.EditValue); _Info.Perdida = Convert.ToDouble(txtPerdida.EditValue); _Info.ProdRend = Convert.ToDouble(txtProdRendt.EditValue); _Info.ProdProduct = Convert.ToDouble(txtPrdoProducto.EditValue); _Info.IdGestionAceria = Convert.ToDecimal(txtIdGestion.EditValue); _Info.FeSiMn = Convert.ToDouble(txtFESIMN.EditValue); _Info.Termopares = Convert.ToDouble(txtTermoPares.EditValue); prod_ParametrosPorCampos_Bus BusParamentroscampos = new prod_ParametrosPorCampos_Bus(); in_movi_inve_Info MovimientoCabecera = new in_movi_inve_Info(); in_producto_Bus BusProducto = new in_producto_Bus(); List <in_movi_inve_detalle_Info> MovimientoDetalle = new List <in_movi_inve_detalle_Info>(); MovimientoCabecera.IdEmpresa = param.IdEmpresa; foreach (var item in BusParamentroscampos.Consulta(param.IdEmpresa)) { foreach (Control control in panel.Controls) { if (control.HasChildren) { foreach (Control textbox in control.Controls) { if (item.NompreCampo == textbox.Name) { in_movi_inve_detalle_Info obj = new in_movi_inve_detalle_Info(); obj.IdEmpresa = param.IdEmpresa; in_Producto_Info Producto = BusProducto.Get_Info_BuscarProducto(Convert.ToDecimal(item.IdProducto), param.IdEmpresa); obj.IdProducto = Convert.ToInt32(item.IdProducto); obj.IdSucursal = Convert.ToInt32(cmbSucursal.EditValue); obj.dm_cantidad = Convert.ToDouble(textbox.Text); obj.mv_costo = Producto.pr_costo_promedio; obj.mv_tipo_movi = "-"; //obj.dm_stock_ante = Producto.kr_stockActual; obj.dm_stock_actu = obj.dm_stock_ante - obj.dm_cantidad; obj.dm_precio = obj.dm_precio; obj.peso = obj.peso; MovimientoDetalle.Add(obj); } } } } } MovimientoCabecera.listmovi_inve_detalle_Info = MovimientoDetalle; foreach (Control item in this.Controls) { if (item.Name == "") { } } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); } }