public Boolean Anular_Conciliacion(cxc_conciliacion_Info Info, ref string mensaje) { try { Boolean res = false; using (EntitiesCuentas_x_Cobrar Entity = new EntitiesCuentas_x_Cobrar()) { cxc_conciliacion cab_Ordpag = Entity.cxc_conciliacion.FirstOrDefault(v => v.IdEmpresa == Info.IdEmpresa && v.IdSucursal == Info.IdSucursal && v.IdConciliacion == Info.IdConciliacion); if (cab_Ordpag != null) { cab_Ordpag.IdUsuarioUltAnu = Info.IdUsuarioUltAnu; cab_Ordpag.Fecha_UltAnu = Info.Fecha_UltAnu; cab_Ordpag.MotivoAnulacion = Info.MotivoAnulacion; cab_Ordpag.Estado = "I"; Entity.SaveChanges(); res = true; } } return(res); } 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() + " " + ex.Message; throw new Exception(ex.ToString()); } }
public Boolean ModificarConciliacion(cxc_conciliacion_Info Info, ref string mensaje) { try { Boolean res = false; using (EntitiesCuentas_x_Cobrar cxc = new EntitiesCuentas_x_Cobrar()) { cxc_conciliacion data = cxc.cxc_conciliacion.FirstOrDefault(v => v.IdEmpresa == Info.IdEmpresa && v.IdSucursal == Info.IdSucursal && v.IdConciliacion == Info.IdConciliacion); if (data != null) { data.IdEmpresa_cbte_cble = Info.IdEmpresa_cbte_cble; data.IdTipoCbte_cbte_cble = Info.IdTipoCbte_cbte_cble; data.IdCbteCble_cbte_cble = Info.IdCbteCble_cbte_cble; cxc.SaveChanges(); res = true; } } return(res); } 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() + " " + ex.Message; throw new Exception(ex.ToString()); } }
public Boolean Guardar_Conciliacion(cxc_conciliacion_Info Item, ref decimal Id, ref string mensaje) { try { using (EntitiesCuentas_x_Cobrar oEnti = new EntitiesCuentas_x_Cobrar()) { if (Item.Detalle.Count() == 0) { mensaje = "Seleccione los valores disponibles por cruzar"; return(false); } if (Item.Detalle.Count() == 1) { mensaje = "Seleccione los documentos de ventas"; return(false); } cxc_conciliacion cabe = new cxc_conciliacion(); cabe.IdEmpresa = Item.IdEmpresa; cabe.IdSucursal = Item.IdSucursal; cabe.IdCliente = Item.IdCliente; cabe.IdConciliacion = Id = GetIdConciliacion(Item.IdEmpresa, Item.IdSucursal, ref mensaje); cabe.Observacion = Item.Observacion; cabe.Fecha = Convert.ToDateTime(Item.Fecha.ToShortDateString()); cabe.Estado = Item.Estado; cabe.IdUsuario = Item.IdUsuario; cabe.Fecha_Transaccion = Item.Fecha_Transaccion; cabe.nom_pc = Item.nom_pc; cabe.ip = Item.ip; oEnti.cxc_conciliacion.Add(cabe); oEnti.SaveChanges(); cxc_conciliacion_det_Data oData = new cxc_conciliacion_det_Data(); oData.GuardarDB(Item.Detalle, ref Id, ref mensaje); } 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.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }