public Boolean ReversoCbteCble(int IdEmpresa, decimal idcbtecble, int idtipocble, int idtipocble_rev, ref decimal idcbtecble_rev, ref string msg, string user, string MotivoAnulacion = "") { try { Boolean respuesta = true; ct_cbtecble_Reversado_Data _dataReversado = new ct_cbtecble_Reversado_Data(); ct_cbtecble_Reversado_Info _InfoReversado = new ct_cbtecble_Reversado_Info(); _InfoReversado = _dataReversado.Get_CbteCble_Reversado_Info(IdEmpresa, idtipocble, idcbtecble); if (_InfoReversado.IdCbteCble_Anu == 0)//no esta reversado se puede reversar { respuesta = data.ReversoCbteCble(IdEmpresa, idcbtecble, idtipocble, idtipocble_rev, ref idcbtecble_rev, ref msg, param.IdUsuario, MotivoAnulacion, param.Fecha_Transac.ToString()); } else { respuesta = true; } return(respuesta); } 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("", "ReversoCbteCble", ex.Message), ex) { EntityType = typeof(ct_Cbtecble_Bus) }; } }
public Boolean GuardarDB(ct_cbtecble_Reversado_Info Info) { try { using (EntitiesDBConta Context = new EntitiesDBConta()) { var Address = new ct_cbtecble_Reversado(); Address.IdEmpresa = Info.IdEmpresa; Address.IdTipoCbte = Info.IdTipoCbte; Address.IdCbteCble = Info.IdCbteCble; Address.IdEmpresa_Anu = Info.IdEmpresa_Anu; Address.IdTipoCbte_Anu = Info.IdTipoCbte_Anu; Address.IdCbteCble_Anu = Info.IdCbteCble_Anu; Context.ct_cbtecble_Reversado.Add(Address); 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 ct_cbtecble_Reversado_Info Get_CbteCble_Reversado_Info(int IdEmpresa, int IdTipoCbte, decimal IdCbteCble) { EntitiesDBConta oEnti = new EntitiesDBConta(); try { ct_cbtecble_Reversado_Info Info = new ct_cbtecble_Reversado_Info(); var Objeto = oEnti.ct_cbtecble_Reversado.FirstOrDefault(var => var.IdEmpresa == IdEmpresa && var.IdTipoCbte == IdTipoCbte && var.IdCbteCble == IdCbteCble); if (Objeto != null) { Info.IdEmpresa = Objeto.IdEmpresa; Info.IdTipoCbte = Objeto.IdTipoCbte; Info.IdCbteCble = Objeto.IdCbteCble; Info.IdEmpresa_Anu = Objeto.IdEmpresa_Anu; Info.IdTipoCbte_Anu = Objeto.IdTipoCbte_Anu; Info.IdCbteCble_Anu = Objeto.IdCbteCble_Anu; } return(Info); } 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(ct_cbtecble_Reversado_Info Info) { try { return(oData.GuardarDB(Info)); } 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("", "GuardarDB", ex.Message), ex) { EntityType = typeof(ct_cbtecble_Reversado_Bus) }; } }