public Boolean Modificar_Estado_Usado(Info.General.tb_sis_Documento_Tipo_Talonario_Info Info, ref string mensajeError) { try { using (EntitiesGeneral Context = new EntitiesGeneral()) { var Address = Context.tb_sis_Documento_Tipo_Talonario.FirstOrDefault(cot => cot.IdEmpresa == Info.IdEmpresa && cot.CodDocumentoTipo == Info.CodDocumentoTipo && cot.Establecimiento == Info.Establecimiento && cot.PuntoEmision == Info.PuntoEmision && cot.NumDocumento == Info.NumDocumento); if (Address != null) { Address.Usado = 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 mensajeErrorLog); mensajeError = ex.ToString() + " " + ex.Message; throw new Exception(ex.ToString()); } }
public Boolean Modificar(Info.General.tb_sis_Documento_Tipo_Talonario_Info Info) { try { using (EntitiesGeneral Context = new EntitiesGeneral()) { var Address = Context.tb_sis_Documento_Tipo_Talonario.FirstOrDefault(cot => cot.IdEmpresa == Info.IdEmpresa && cot.CodDocumentoTipo == Info.CodDocumentoTipo && cot.IdSucursal == Info.IdSucursal && cot.NumDocumento == Info.NumDocumento); if (Address != null) { Address.CodDocumentoTipo = Info.CodDocumentoTipo; Address.Establecimiento = Info.Establecimiento; Address.PuntoEmision = Info.PuntoEmision; Address.NumDocumento = Info.NumDocumento; Address.FechaCaducidad = Convert.ToDateTime(Info.FechaCaducidad); Address.Usado = Info.Usado; Address.Estado = Info.Estado; Address.NumAutorizacion = Info.NumAutorizacion; Address.es_Documento_Electronico = Info.es_Documento_electronico; 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 mensajeErrorLog); throw new Exception(ex.ToString()); } }
public Boolean Modificar_Estado_Usado(Info.General.tb_sis_Documento_Tipo_Talonario_Info Info, ref string mensajeError) { try { return(data.Modificar_Estado_Usado(Info, ref mensajeError)); } 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("", "Modificar_Estado_Usado", ex.Message), ex) { EntityType = typeof(tb_sis_Documento_Tipo_Talonario_Bus) }; } }
public Boolean Anular(Info.General.tb_sis_Documento_Tipo_Talonario_Info Info) { try { return(data.Anular(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("", "ObtenerLista_Docu_Tipo_Talonario_x_TipoDocu", ex.Message), ex) { EntityType = typeof(tb_sis_Documento_Tipo_Talonario_Bus) }; } }
public Boolean Guardar(Info.General.tb_sis_Documento_Tipo_Talonario_Info Info) { try { using (EntitiesGeneral Context = new EntitiesGeneral()) { var lst = from q in Context.tb_sis_Documento_Tipo_Talonario where q.IdEmpresa == Info.IdEmpresa && q.CodDocumentoTipo == Info.CodDocumentoTipo && q.Establecimiento == Info.Establecimiento && q.PuntoEmision == Info.PuntoEmision && q.NumDocumento == Info.NumDocumento select q; if (lst.Count() == 0) { var Address = new tb_sis_Documento_Tipo_Talonario(); Address.IdEmpresa = Info.IdEmpresa; Address.CodDocumentoTipo = Info.CodDocumentoTipo; Address.Establecimiento = Info.Establecimiento; Address.PuntoEmision = Info.PuntoEmision; Address.NumDocumento = Info.NumDocumento; Address.FechaCaducidad = Convert.ToDateTime(Info.FechaCaducidad); Address.Usado = Info.Usado; Address.Estado = "A"; Address.IdSucursal = Info.IdSucursal; Address.NumAutorizacion = Info.NumAutorizacion; Address.es_Documento_Electronico = Info.es_Documento_electronico; Context.tb_sis_Documento_Tipo_Talonario.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() + " " + ex.Message; throw new Exception(ex.ToString()); } }
public Boolean Anular(Info.General.tb_sis_Documento_Tipo_Talonario_Info Info) { try { using (EntitiesGeneral Context = new EntitiesGeneral()) { var Address = Context.tb_sis_Documento_Tipo_Talonario.FirstOrDefault(cot => cot.IdEmpresa == Info.IdEmpresa && cot.CodDocumentoTipo == Info.CodDocumentoTipo && cot.IdSucursal == Info.IdSucursal && cot.NumDocumento == Info.NumDocumento); if (Address != null) { Address.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 mensajeErrorLog); throw new Exception(ex.ToString()); } }