public bool guardarDB(fa_parametro_FJ_Info info) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_parametro_FJ Entity = Context.fa_parametro_FJ.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa); if (Entity != null) { Entity.p_tipo_porc_ganancia_tarifario_cat = info.p_tipo_porc_ganancia_tarifario_cat; Entity.p_IdProducto_prefacturacion = info.p_IdProducto_prefacturacion; Entity.p_IdCod_Impuesto_IVA = info.p_IdCod_Impuesto_IVA; Context.SaveChanges(); } else { Entity = new fa_parametro_FJ(); Entity.IdEmpresa = info.IdEmpresa; Entity.p_tipo_porc_ganancia_tarifario_cat = info.p_tipo_porc_ganancia_tarifario_cat; Entity.p_IdProducto_prefacturacion = info.p_IdProducto_prefacturacion; Entity.p_IdCod_Impuesto_IVA = info.p_IdCod_Impuesto_IVA; Context.fa_parametro_FJ.Add(Entity); Context.SaveChanges(); } } return(true); } catch (Exception) { throw; } }
public bool Guardar(List <fa_pre_facturacion_Parametro_x_Anio_x_Fuerza_MO_RRHH_Info> lista) { try { using (Entity_Facturacion_FJ model = new Entity_Facturacion_FJ()) { foreach (var item in lista) { var query = from q in model.fa_pre_facturacion_Parametro_x_Anio_x_Fuerza_MO_RRHH where q.IdEmpresa == item.IdEmpresa && q.Anio == item.Anio && q.Mes == item.Mes && q.IdFuerza == item.IdFuerza select q; if (query.Count() == 0) { fa_pre_facturacion_Parametro_x_Anio_x_Fuerza_MO_RRHH add = new fa_pre_facturacion_Parametro_x_Anio_x_Fuerza_MO_RRHH(); add.IdEmpresa = item.IdEmpresa; add.Anio = item.Anio; add.Mes = item.Mes; add.IdFuerza = item.IdFuerza; add.Porcentaje_Calculo_MO = item.Porcentaje_Calculo_MO; add.Porcentaje_Calculo_BS = item.Porcentaje_Calculo_BS; add.Fecha_Fin = item.Fecha_Fin; add.Fecha_Inicio = item.Fecha_Inicio; model.fa_pre_facturacion_Parametro_x_Anio_x_Fuerza_MO_RRHH.Add(add); model.SaveChanges(); } else { var modifi = model.fa_pre_facturacion_Parametro_x_Anio_x_Fuerza_MO_RRHH.FirstOrDefault(q => q.IdEmpresa == item.IdEmpresa && q.Anio == item.Anio && q.Mes == item.Mes && q.IdFuerza == item.IdFuerza); modifi.Porcentaje_Calculo_MO = item.Porcentaje_Calculo_MO; modifi.Porcentaje_Calculo_BS = item.Porcentaje_Calculo_BS; modifi.Fecha_Fin = item.Fecha_Fin; modifi.Fecha_Inicio = item.Fecha_Inicio; model.SaveChanges(); } } 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public Boolean AnularDB(fa_registro_unidades_x_equipo_Info info) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_registro_unidades_x_equipo Entity = Context.fa_registro_unidades_x_equipo.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdRegistro == info.IdRegistro); if (Entity != null) { Entity.IdUsuarioUltAnu = info.IdUsuarioUltAnu; Entity.Fecha_UltAnu = info.Fecha_UltAnu; Entity.MotiAnula = info.MotiAnula; Entity.nom_pc = info.nom_pc; Entity.ip = info.ip; Entity.Estado = "I"; Entity.estado_cierre = true; Context.SaveChanges(); } } 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool Guardar(List <fa_tarifario_facturacion_x_cliente_Por_comision_Info> lista) { try { using (Entity_Facturacion_FJ model = new Entity_Facturacion_FJ()) { foreach (var item in lista) { fa_tarifario_facturacion_x_cliente_Por_comision add = new fa_tarifario_facturacion_x_cliente_Por_comision(); add.IdEmpresa = item.IdEmpresa; add.IdTarifario = item.IdTarifario; add.IdAnio = item.IdAnio; add.porcentaje = item.porcentaje; add.Fecha_Fin = item.Fecha_Fin; add.Fecha_inicio = item.Fecha_inicio; model.fa_tarifario_facturacion_x_cliente_Por_comision.Add(add); model.SaveChanges(); } 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool ModificiarDB(fa_liquidaciones_tipo_proceso_Info Info, ref string mensaje) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_liquidaciones_tipo_proceso contact = Context.fa_liquidaciones_tipo_proceso.FirstOrDefault(v => v.IdTipo_Proceso == Info.IdTipo_Proceso); if (contact != null) { contact.IdProducto_Liqui_x_defecto = Info.IdProducto_Liqui_x_defecto; contact.IdTipo_Proceso = Info.IdTipo_Proceso; contact.nom_IdTipo_Proceso_x_Liqui = Info.nom_IdTipo_Proceso_x_Liqui; Context.SaveChanges(); } } 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool guardarDB(fa_tarifario_horometro_Info info) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_tarifario_horometro Entity = new fa_tarifario_horometro(); Entity.IdEmpresa = info.IdEmpresa; Entity.IdTarifario = info.IdTarifario = get_id(info.IdEmpresa); Entity.IdCentroCosto = info.IdCentroCosto; Entity.IdPeriodo_ini = info.IdPeriodo_ini; Entity.IdPeriodo_fin = info.IdPeriodo_fin; Entity.Observacion = info.Observacion; Entity.estado = info.estado = true; Entity.IdProducto_hora_regular = info.IdProducto_hora_regular; Entity.IdProducto_hora_extra = info.IdProducto_hora_extra; Entity.IdCod_Impuesto = info.IdCod_Impuesto; Entity.porcentaje = info.porcentaje; Context.fa_tarifario_horometro.Add(Entity); Context.SaveChanges(); } return(true); } catch (Exception ex) { string MensajeError = ""; 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool Guardar(fa_tarifario_facturacion_x_cliente_Af_Depreciacion_Info item, ref int IdDepreciacion) { try { using (Entity_Facturacion_FJ model = new Entity_Facturacion_FJ()) { fa_tarifario_facturacion_x_cliente_Af_Depreciacion add = new fa_tarifario_facturacion_x_cliente_Af_Depreciacion(); add.IdEmpresa = item.IdEmpresa; add.IdDepreciacion = GetId(item.IdEmpresa); add.IdTarifario = item.IdTarifario; add.IdTipoDepreciacion = item.IdTipoDepreciacion; add.IdPeriodo = item.IdPeriodo; add.Descripcion = item.Descripcion; add.Fecha_Depreciacion = item.Fecha_Depreciacion; add.Num_Act_Depre = item.Num_Act_Depre; add.Valor_Tot_Depre = item.Valor_Tot_Depre; add.Valor_Tot_DepreAcum = item.Valor_Tot_DepreAcum; add.Valot_Tot_Importe = item.Valot_Tot_Importe; model.fa_tarifario_facturacion_x_cliente_Af_Depreciacion.Add(add); model.SaveChanges(); IdDepreciacion = (int)add.IdDepreciacion; 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public Boolean AnularDB(fa_pre_facturacion_Info info) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_pre_facturacion Entity = Context.fa_pre_facturacion.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdPreFacturacion == info.IdPreFacturacion); if (Entity != null) { info.Observacion = "**ANULADO**" + Entity.Observacion; Entity.estado_cierre = info.estado_cierre = true; info.estado = Entity.estado; Context.SaveChanges(); } } return(true); } catch (Exception ex) { string MensajeError = ""; 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public Boolean Guardar(List <fa_pre_facturacion_det_gasto_Interes_Banc_Info> lst_Info) { try { int sec = 1; foreach (var item in lst_Info) { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_pre_facturacion_det_gasto_Interes_Banc Entity = new fa_pre_facturacion_det_gasto_Interes_Banc(); Entity.IdEmpresa = Convert.ToInt32(item.IdEmpresa); Entity.IdPreFacturacion = Convert.ToDecimal(item.IdPreFacturacion); Entity.secuencia = item.secuencia; Entity.IdCliente = item.IdCliente; Entity.Valor = item.Valor; Entity.Observacion = item.Observacion; Context.fa_pre_facturacion_det_gasto_Interes_Banc.Add(Entity); Context.SaveChanges(); } sec++; } return(true); } catch (Exception ex) { string MensajeError = ""; 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool AnularDB(fa_cliente_x_ct_centro_costo_Info info, ref string mensaje) { try { using (Entity_Facturacion_FJ Base = new Entity_Facturacion_FJ()) { var address = Base.fa_cliente_x_ct_centro_costo.FirstOrDefault(o => o.IdCliente_cli == info.IdCliente_cli && o.IdCentroCosto_cc == info.IdCentroCosto_cc); if (address != null) { address.IdCliente_cli = info.IdCliente_cli; address.IdEmpresa_cc = info.IdEmpresa_cc; address.IdEmpresa_cli = info.IdEmpresa_cli; address.IdCentroCosto_cc = info.IdCentroCosto_cc; address.Observacion = info.Observacion; Base.SaveChanges(); mensaje = "Se guardo exitosamente."; } 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.InnerException + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = "Se ha producido el siguiente error: " + ex.Message; throw new Exception(ex.ToString()); } }
public Boolean GuardarDB(List <fa_tarifario_facturacion_x_cliente_det_x_ActivoFijo_Info> Lista) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { foreach (var item in Lista) { fa_tarifario_facturacion_x_cliente_det_x_ActivoFijo Entity = new fa_tarifario_facturacion_x_cliente_det_x_ActivoFijo(); Entity.IdEmpresa = item.IdEmpresa; Entity.IdActivoFijo = item.IdActivoFijo; Entity.IdTarifario = item.IdTarifario; Entity.Unidades_minimas = item.Unidades_minimas; Entity.Valor_x_Unidad = item.Valor_x_Unidad; Entity.Num_empleado_relacionado = item.Num_empleado_relacionado; Context.fa_tarifario_facturacion_x_cliente_det_x_ActivoFijo.Add(Entity); Context.SaveChanges(); } } 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool Grabar(fa_cliente_x_ct_centro_costo_Info info, ref string mensaje) { try { using (Entity_Facturacion_FJ Base = new Entity_Facturacion_FJ()) { fa_cliente_x_ct_centro_costo address = new fa_cliente_x_ct_centro_costo(); address.IdCliente_cli = info.IdCliente_cli; address.IdEmpresa_cc = info.IdEmpresa_cc; address.IdEmpresa_cli = info.IdEmpresa_cli; address.IdCentroCosto_cc = info.IdCentroCosto_cc; address.Observacion = info.Observacion; Base.fa_cliente_x_ct_centro_costo.Add(address); Base.SaveChanges(); mensaje = "Se ha guardado exitosamente "; } 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.InnerException + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = "Se ha producido el siguiente error: " + ex.Message; throw new Exception(ex.ToString()); } }
public Boolean GuardarDB(fa_pre_facturacion_Info info) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_pre_facturacion Entity = new fa_pre_facturacion(); Entity.IdEmpresa = info.IdEmpresa; Entity.IdPreFacturacion = info.IdPreFacturacion; Entity.IdPeriodo = info.IdPeriodo; Entity.Observacion = info.Observacion; Entity.IdEstado_Proceso = info.IdEstado_Proceso; Entity.fecha = info.fecha; Entity.estado = "A"; Context.fa_pre_facturacion.Add(Entity); Context.SaveChanges(); } return(true); } catch (Exception ex) { string MensajeError = ""; 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public Boolean GuardarDB(List <fa_registro_unidades_x_equipo_det_ini_x_Af_Info> Lista) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { foreach (var item in Lista) { fa_registro_unidades_x_equipo_det_ini_x_Af Entity = new fa_registro_unidades_x_equipo_det_ini_x_Af(); Entity.IdEmpresa = item.IdEmpresa; Entity.IdRegistro = item.IdRegistro; Entity.IdUnidadFact_cat = item.IdUnidadFact_cat; Entity.IdActivoFijo = item.IdActivoFijo; Entity.Af_ValorUnidad_Actu = item.Af_ValorUnidad_Actu; Context.fa_registro_unidades_x_equipo_det_ini_x_Af.Add(Entity); Context.SaveChanges(); } } return(true); } catch (Exception ex) { string MensajeError = ""; 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool GuardarDB(fa_liquidaciones_Info info, ref decimal IdLiquidaciones) { try { using (Entity_Facturacion_FJ database = new Entity_Facturacion_FJ()) { fa_liquidaciones add = new fa_liquidaciones(); add.IdEmpresa = info.IdEmpresa; add.IdLiquidaciones = GetId(info.IdEmpresa); add.IdPeriodo = info.IdPeriodo; add.IdUsuario = info.IdUsuario; add.Observacion = info.Observacion; add.fecha = info.fecha; add.Estado_Proceso = info.Estado_Proceso; add.Estado = true; database.fa_liquidaciones.Add(add); database.SaveChanges(); IdLiquidaciones = add.IdLiquidaciones; } 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool GuardarDB(fa_grupo_x_sub_centro_costo_det_Info Info, ref string mensaje) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_grupo_x_sub_centro_costo_det contact = new fa_grupo_x_sub_centro_costo_det(); contact.IdEmpresa = Info.IdEmpresa; contact.IdGrupo = Info.IdGrupo; contact.Secuencia = Info.Secuencia; contact.IdCentroCosto = Info.IdCentroCosto; contact.IdCentroCosto_sub_centro_costo = Info.IdCentroCosto_sub_centro_costo; Context.fa_grupo_x_sub_centro_costo_det.Add(contact); Context.SaveChanges(); } 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString(); throw new Exception(ex.ToString()); } }
public Boolean GuardarDB(fa_pre_facturacion_Info info) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_pre_facturacion Entity = new fa_pre_facturacion(); Entity.IdEmpresa = info.IdEmpresa; Entity.IdPreFacturacion = info.IdPreFacturacion = GetId(info.IdEmpresa); Entity.IdPeriodo = info.IdPeriodo; Entity.Observacion = info.Observacion; Entity.estado_cierre = info.estado_cierre; Entity.fecha = info.fecha; Entity.estado = "A"; Entity.IdCentroCosto = info.IdCentroCosto; Entity.ValorFacturar = (info.ValorFacturar == null) ? 0 : Convert.ToDouble(info.ValorFacturar); Entity.TotalEquipos = (info.TotalEquipos == null) ? 0 : Convert.ToInt32(info.TotalEquipos); Context.fa_pre_facturacion.Add(Entity); Context.SaveChanges(); } return(true); } catch (Exception ex) { string MensajeError = ""; 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool guardarDB(fa_liquidacion_x_punto_cargo_det_mano_obra_det_Info info) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_liquidacion_x_punto_cargo_det_mano_obra_det Entity = new fa_liquidacion_x_punto_cargo_det_mano_obra_det(); Entity.IdEmpresa = info.IdEmpresa; Entity.IdSucursal = info.IdSucursal; Entity.IdCentroCosto = info.IdCentroCosto; Entity.IdLiquidacion = info.IdLiquidacion; Entity.mo_secuencia = info.mo_secuencia; Entity.IdActividad = info.IdActividad; Entity.observacion = info.observacion; Context.fa_liquidacion_x_punto_cargo_det_mano_obra_det.Add(Entity); Context.SaveChanges(); } return(true); } catch (Exception ex) { string mensaje = ""; 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool AnularDB(fa_orden_trabajo_plataforma_Info info) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_orden_trabajo_plataforma Entity = Context.fa_orden_trabajo_plataforma.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdOrdenTrabajo_Pla == info.IdOrdenTrabajo_Pla); if (Entity != null) { Entity.IdUsuarioUltAnu = info.IdUsuarioUltAnu; Entity.Fecha_UltAnu = info.Fecha_UltAnu; Entity.MotiAnula = info.MotiAnula; Entity.Estado = "I"; Context.SaveChanges(); } } oData_det.EliminarDB(info); oData_det = new fa_orden_trabajo_plataforma_det_Data(); oData_det.GuardarDB(info.lst_Det_Orden); 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool AnularDB(fa_liquidacion_x_punto_cargo_Info info) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_liquidacion_x_punto_cargo Entity = Context.fa_liquidacion_x_punto_cargo.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdSucursal == info.IdSucursal && q.IdCentroCosto == info.IdCentroCosto && q.IdLiquidacion == info.IdLiquidacion); if (Entity != null) { Entity.estado = false; Entity.li_observacion = "**ANULADO** " + info.li_observacion; Context.SaveChanges(); } } return(true); } catch (Exception ex) { string mensaje = ""; 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool guardarDB(List <fa_ruta_x_centro_costo_Info> Lista) { try { foreach (var item in Lista) { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_ruta_x_centro_costo Entity = new fa_ruta_x_centro_costo(); Entity.IdEmpresa = item.IdEmpresa; Entity.IdCentroCosto = item.IdCentroCosto; Entity.IdRuta = item.IdRuta; Entity.ru_costo_x_km = item.ru_costo_x_km; Context.fa_ruta_x_centro_costo.Add(Entity); Context.SaveChanges(); } } return(true); } catch (Exception ex) { string MensajeError = ""; 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool GuardarDB(fa_liquidacion_x_punto_cargo_Info info) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { var lst = from q in Context.fa_liquidacion_x_punto_cargo where q.IdEmpresa == info.IdEmpresa && q.IdSucursal == info.IdSucursal && q.IdCentroCosto == info.IdCentroCosto && q.IdLiquidacion == info.IdLiquidacion select q; if (lst.Count() == 0) { fa_liquidacion_x_punto_cargo Entity = new fa_liquidacion_x_punto_cargo(); Entity.IdEmpresa = info.IdEmpresa; Entity.IdSucursal = info.IdSucursal; Entity.IdCentroCosto = info.IdCentroCosto; Entity.IdLiquidacion = info.IdLiquidacion = get_id(info.IdEmpresa, info.IdSucursal, info.IdCentroCosto); Entity.IdPunto_cargo = info.IdPunto_cargo; Entity.li_fecha = info.li_fecha = info.li_fecha.Date; Entity.IdTerminoPago = info.IdTerminoPago; Entity.IdCentroCosto_sub_centro_costo = info.IdCentroCosto_sub_centro_costo; Entity.li_num_orden = info.li_num_orden; Entity.li_num_horas = info.li_num_horas; Entity.li_atencion_a = info.li_atencion_a; Entity.IdBodega = info.IdBodega; Entity.li_tipo_pedido = info.li_tipo_pedido; Entity.estado = info.estado = true; Entity.lo_IdProducto = info.lo_IdProducto; Entity.eg_IdProducto = info.eg_IdProducto; Entity.in_IdProducto = info.in_IdProducto; Entity.li_reporte_mantenimiento = info.li_reporte_mantenimiento; Entity.li_subtotal = info.li_subtotal; Entity.li_por_iva = info.li_por_iva; Entity.li_valor_iva = info.li_valor_iva; Entity.li_total = info.li_total; Entity.IdCod_Impuesto = info.IdCod_Impuesto; Entity.li_observacion = info.li_observacion; Entity.li_fecha_orden_mantenimiento = info.li_fecha_orden_mantenimiento; Entity.li_fecha_reporte_mantenimiento = info.li_fecha_reporte_mantenimiento; Context.fa_liquidacion_x_punto_cargo.Add(Entity); Context.SaveChanges(); } } return(true); } catch (Exception ex) { string mensaje = ""; 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool anularDB(fa_tarifario_horometro_Info info) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_tarifario_horometro Entity = Context.fa_tarifario_horometro.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdTarifario == info.IdTarifario); if (Entity != null) { Entity.estado = false; Context.SaveChanges(); } } return(true); } catch (Exception ex) { string MensajeError = ""; 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool Modificar(fa_tarifario_facturacion_x_cliente_Info info) { try { using (Entity_Facturacion_FJ model = new Entity_Facturacion_FJ()) { var add = model.fa_tarifario_facturacion_x_cliente.FirstOrDefault(cot => cot.IdEmpresa == info.IdEmpresa && cot.IdTarifario == info.IdTarifario); if (add != null) { add.codTarifario = info.codTarifario; add.nom_tarifario = info.nom_tarifario; add.observacion = info.observacion; add.fecha_inicio = info.fecha_inicio.Date; add.fecha_fin = info.fecha_fin.Date; add.IdUsuarioUltMod = info.IdUsuarioUltMod; add.FechaUltMod = info.FechaUltMod; add.valor_minimo_movilizacion = info.valor_minimo_movilizacion; add.por_ganancia_inicial = info.por_ganancia_inicial; model.SaveChanges(); } 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool Modificar_DB(fa_compensacion_x_ct_centro_costo_Info info) { try { using (Entity_Facturacion_FJ db = new Entity_Facturacion_FJ()) { var add = db.fa_compensacion_x_ct_centro_costo.FirstOrDefault(v => v.IdEmpresa == info.IdEmpresa && v.IdCompensacion == info.IdCompensacion); add.IdCentroCosto = info.IdCentroCosto; add.IdCentroCosto_sub_centro_costo = info.IdCentroCosto_sub_centro_costo; add.num_cuotas_meses_x_banco = info.num_cuotas_meses_x_banco; add.num_cuotas_meses_x_centro_costo = info.num_cuotas_meses_x_centro_costo; add.tasa_interes_anual_x_banco = info.tasa_interes_anual_x_banco; add.tasa_interes_anual_x_centro_costo = info.tasa_interes_anual_x_centro_costo; add.valor_a_financiar = info.valor_a_financiar; add.observacion = info.observacion; db.SaveChanges(); 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool Anular(fa_tarifario_facturacion_x_cliente_Info info) { try { using (Entity_Facturacion_FJ model = new Entity_Facturacion_FJ()) { var add = model.fa_tarifario_facturacion_x_cliente.FirstOrDefault(cot => cot.IdEmpresa == info.IdEmpresa && cot.IdTarifario == info.IdTarifario); add.IdUsuarioUltAnu = info.IdUsuarioUltAnu; add.Fecha_UltAnu = info.Fecha_UltAnu; add.MotiAnula = info.MotiAnula; add.Estado = false; model.SaveChanges(); 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool AnularDB(fa_liquidacion_gastos_Info Info, ref string mensaje) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_liquidacion_gastos contact = Context.fa_liquidacion_gastos.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdLiquidacion == Info.IdLiquidacion); if (contact != null) { contact.IdUsuarioUltAnu = Info.IdUsuarioUltAnu; contact.Fecha_UltAnu = Info.Fecha_UltAnu; contact.MotivoAnulacion = Info.MotivoAnulacion; contact.estado = "I"; Context.SaveChanges(); } } 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool GuardarDB(List <fa_liquidaciones_det_Info> lista) { try { int secuencia = 0; using (Entity_Facturacion_FJ database = new Entity_Facturacion_FJ()) { foreach (var item in lista) { fa_liquidaciones_det add = new fa_liquidaciones_det(); secuencia++; add.IdEmpresa = item.IdEmpresa; add.IdLiquidaciones = item.IdLiquidaciones; add.Secuencia = secuencia; add.IdEmpresa_liqui_gastos = item.IdEmpresa_liqui_gastos; add.IdLiquidacion_liqui_gastos = item.IdLiquidacion_liqui_gastos; database.fa_liquidaciones_det.Add(add); database.SaveChanges(); } } 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool GuardarDB(List <fa_pre_facturacion_det_Otros_Info> lista) { try { int secuencia = 0; using (Entity_Facturacion_FJ database = new Entity_Facturacion_FJ()) { foreach (var item in lista) { fa_pre_facturacion_det_Otros add = new fa_pre_facturacion_det_Otros(); secuencia++; add.IdEmpresa = item.IdEmpresa; add.IdPreFacturacion = item.IdPreFacturacion; add.secuencia = secuencia; add.Valor = item.Valor; add.Nombre_Cobro = item.Nombre_Cobro; add.Observacion = item.Observacion; database.fa_pre_facturacion_det_Otros.Add(add); database.SaveChanges(); } } 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError); MensajeError = ex.ToString(); throw new Exception(ex.ToString()); } }
public bool GuardarDB(fa_liquidacion_gastos_producto_Info Info, ref string mensaje) { try { using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ()) { fa_liquidacion_gastos_producto contact = new fa_liquidacion_gastos_producto(); contact.IdEmpresa = Info.IdEmpresa; if (Info.IdProducto_Liqui == 0) { contact.IdProducto_Liqui = getId(Info.IdEmpresa); } else { contact.IdProducto_Liqui = Info.IdProducto_Liqui; } contact.nom_producto_Liqui = Info.nom_producto_Liqui; contact.estado = Info.estado; contact.IdProducto = Info.IdProducto; Context.fa_liquidacion_gastos_producto.Add(contact); Context.SaveChanges(); } 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); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString(); throw new Exception(ex.ToString()); } }