public Boolean GrabarDB(cp_orden_giro_x_com_ordencompra_local_det_Info info, ref string mensaje) { try { using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar()) { EntitiesCuentasxPagar EDB = new EntitiesCuentasxPagar(); var address = new cp_orden_giro_x_com_ordencompra_local_det(); address.IdEmpresa_Ogiro = info.IdEmpresa_Ogiro; address.IdCbteCble_Ogiro = info.IdCbteCble_Ogiro; address.IdTipoCbte_Ogiro = info.IdTipoCbte_Ogiro; address.IdEmpresa_OC = info.IdEmpresa_OC; address.IdSucursal_OC = info.IdSucursal_OC; address.IdOrdenCompra = info.IdOrdenCompra; address.Secuencia_OC = info.Secuencia_OC; address.Observacion = info.Observacion == null ? "" : info.Observacion; address.Secuencia_reg = info.Secuencia_reg; context.cp_orden_giro_x_com_ordencompra_local_det.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 EliminarDB(cp_proveedor_codigo_SRI_Info Info) { try { using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar()) { var contact = context.cp_proveedor_codigo_SRI.FirstOrDefault(min => min.IdEmpresa == Info.IdEmpresa && min.IdProveedor == Info.IdProveedor && min.IdCodigo_SRI == Info.IdCodigo_SRI); if (contact != null) { context.cp_proveedor_codigo_SRI.Remove(contact); context.SaveChanges(); context.Dispose(); } } 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 GrabarDB(cp_proveedor_codigo_SRI_Info info) { try { using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar()) { EntitiesCuentasxPagar EDB = new EntitiesCuentasxPagar(); var address = new cp_proveedor_codigo_SRI(); address.IdEmpresa = info.IdEmpresa; address.IdProveedor = info.IdProveedor; address.IdCodigo_SRI = info.IdCodigo_SRI; address.observacion = info.observacion == null ? "" : info.observacion.Trim(); context.cp_proveedor_codigo_SRI.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.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public int GetSecuencia(int IdEmpresa, decimal IdOrdenPago) { try { int Id; EntitiesCuentasxPagar ECXP = new EntitiesCuentasxPagar(); var select = ECXP.cp_orden_pago_det.Count(q => q.IdEmpresa == IdEmpresa && q.IdOrdenPago == IdOrdenPago); if (select == 0) { return(Id = 1); } else { var select_ = (from t in ECXP.cp_orden_pago_det where t.IdEmpresa == IdEmpresa && t.IdOrdenPago == IdOrdenPago select t.Secuencia).Max(); Id = Convert.ToInt32(select_.ToString()) + 1; return(Id); } } 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 GuardarDB(cp_Autorizacion_x_Doc_x_Pag_Info Info, ref string msg) { try { using (EntitiesCuentasxPagar CxP = new EntitiesCuentasxPagar()) { var Address = new cp_Autorizacion_x_Doc_x_Pag(); Address.Id_Num_Autorizacion = Info.Id_Num_Autorizacion; Address.Serie1 = Info.Serie1; Address.Serie2 = Info.Serie2; Address.Valido_Hasta = Convert.ToDateTime(Info.Valido_Hasta.ToShortDateString()); Address.factura_inicial = Info.factura_inicial; Address.factura_final = Info.factura_final; Address.NumAutorizacionImprenta = Info.NumAutorizacionImprenta; CxP.cp_Autorizacion_x_Doc_x_Pag.Add(Address); CxP.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.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public List <cp_orden_giro_x_imp_ordencompra_ext_Info> Get_List_orden_giro_x_imp_ordencompra_ext(int IdEmpresa_Ogiro, decimal IdCbteCble_Ogiro, int IdTipoCbte_Ogiro) { try { List <cp_orden_giro_x_imp_ordencompra_ext_Info> lM = new List <cp_orden_giro_x_imp_ordencompra_ext_Info>(); EntitiesCuentasxPagar db = new EntitiesCuentasxPagar(); var select_ = from T in db.cp_orden_giro_x_imp_ordencompra_ext where T.og_IdEmpresa == IdEmpresa_Ogiro && T.og_IdCbteCble == IdCbteCble_Ogiro && T.og_IdTipoCbte == IdTipoCbte_Ogiro select T; foreach (var item in select_) { cp_orden_giro_x_imp_ordencompra_ext_Info dat = new cp_orden_giro_x_imp_ordencompra_ext_Info(); dat.imp_IdEmpresa = item.imp_IdEmpresa; dat.imp_IdOrdenCompraExt = item.imp_IdOrdenCompraExt; dat.imp_IdSucursal = item.imp_IdSucursal; dat.og_IdCbteCble = item.og_IdCbteCble; dat.og_IdEmpresa = item.og_IdEmpresa; dat.og_IdTipoCbte = item.og_IdTipoCbte; lM.Add(dat); } return(lM); } 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 ModificarDB(cp_orden_giro_x_imp_ordencompra_ext_Info info) { try { using (EntitiesCuentasxPagar Contex = new EntitiesCuentasxPagar()) { var contact = Contex.cp_orden_giro_x_imp_ordencompra_ext.FirstOrDefault(var => var.og_IdEmpresa == info.og_IdEmpresa && var.og_IdCbteCble == info.og_IdCbteCble && var.og_IdTipoCbte == info.og_IdTipoCbte); if (contact != null) { contact.imp_IdEmpresa = info.imp_IdEmpresa; contact.imp_IdSucursal = info.imp_IdSucursal; contact.imp_IdOrdenCompraExt = info.imp_IdOrdenCompraExt; Contex.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 ModificarDB(cp_trans_a_generar_x_FormaPago_OP_Info Info) { try { Boolean res = false; EntitiesCuentasxPagar context = new EntitiesCuentasxPagar(); var address = context.cp_trans_a_generar_x_FormaPago_OP.FirstOrDefault(var => var.IdTipoTransaccion == Info.IdTipoTransaccion); if (address != null) { address.Descripcion = Info.Descripcion; context.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 List <cp_trans_a_generar_x_FormaPago_OP_Info> Get_List_trans_a_generar_x_FormaPago_OP() { try { EntitiesCuentasxPagar context = new EntitiesCuentasxPagar(); List <cp_trans_a_generar_x_FormaPago_OP_Info> lst = new List <cp_trans_a_generar_x_FormaPago_OP_Info>(); var select = from q in context.cp_trans_a_generar_x_FormaPago_OP select q; cp_trans_a_generar_x_FormaPago_OP_Info Info; foreach (var item in select) { Info = new cp_trans_a_generar_x_FormaPago_OP_Info(); Info.IdTipoTransaccion = item.IdTipoTransaccion; Info.Descripcion = item.Descripcion; lst.Add(Info); } return(lst); } 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()); } }
public Boolean AnularDB(cp_proveedor_clase_Info info, ref string mensaje) { try { Boolean res = false; using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar()) { var contact = context.cp_proveedor_clase.FirstOrDefault(var => var.IdEmpresa == info.IdEmpresa && var.IdClaseProveedor == info.IdClaseProveedor); if (contact != null) { contact.Estado = "I"; contact.IdUsuarioAnu = info.IdUsuarioAnu; contact.FechaAnu = info.FechaAnu; contact.MotivoAnu = info.MotivoAnu; context.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 List <cp_orden_pago_estado_aprob_Info> Get_List_orden_pago_estado_aprob() { try { List <cp_orden_pago_estado_aprob_Info> lista = new List <cp_orden_pago_estado_aprob_Info>(); lista = new List <cp_orden_pago_estado_aprob_Info>(); EntitiesCuentasxPagar ORol = new EntitiesCuentasxPagar(); var sresult = from A in ORol.cp_orden_pago_estado_aprob select A; foreach (var item in sresult) { cp_orden_pago_estado_aprob_Info Reg = new cp_orden_pago_estado_aprob_Info(); Reg.IdEstadoAprobacion = item.IdEstadoAprobacion; Reg.Descripcion = item.Descripcion; lista.Add(Reg); } return(lista); } 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 ModificarDB(cp_proveedor_clase_Info info, ref string mensaje) { try { using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar()) { var contact = context.cp_proveedor_clase.FirstOrDefault(var => var.IdEmpresa == info.IdEmpresa && var.IdClaseProveedor == info.IdClaseProveedor); if (contact != null) { contact.cod_clase_proveedor = info.cod_clase_proveedor; contact.descripcion_clas_prove = info.descripcion_clas_prove; contact.IdCtaCble_Anticipo = info.IdCtaCble_Anticipo; contact.IdCtaCble_gasto = info.IdCtaCble_gasto; contact.IdCentroCosto = info.IdCentroCosto; contact.IdCentroCosto_sub_centro_costo = info.IdCentroCosto_sub_centro_costo; contact.Estado = info.Estado; contact.MotivoAnu = info.MotivoAnu; contact.IdUsuarioUltModi = info.IdUsuarioUltModi; contact.FechaUltModi = info.FechaUltModi; contact.IdCtaCble_CXP = info.IdCtaCble_CXP; 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 int GetIdProveedor_clase(int IdEmpresa) { int Id = 0; try { EntitiesCuentasxPagar contex = new EntitiesCuentasxPagar(); var selecte = contex.cp_proveedor_clase.Count(q => q.IdEmpresa == IdEmpresa); if (selecte == 0) { Id = 1; } else { var select_em = (from q in contex.cp_proveedor_clase where q.IdEmpresa == IdEmpresa select q.IdClaseProveedor).Max(); Id = Convert.ToInt32(select_em.ToString()) + 1; } return(Id); } 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()); } }
public Boolean Verificar_NumAutorizacion_Ogiro(string NumAutorizacion, ref string msg) { try { using (EntitiesCuentasxPagar CxP = new EntitiesCuentasxPagar()) { Boolean Existe; Existe = false; var info = CxP.cp_Autorizacion_x_Doc_x_Pag.Count(q => q.Id_Num_Autorizacion == NumAutorizacion); if (info > 0) { Existe = true; } return(Existe); } } 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()); } }
public Boolean VerificarRegistro(int IdEmpresa, int IdSucursal, decimal IdOrdenCompra, int secuencia) { try { EntitiesCuentasxPagar oen = new EntitiesCuentasxPagar(); var select = from q in oen.cp_orden_giro_x_com_ordencompra_local_det where q.IdEmpresa_OC == IdEmpresa && q.IdSucursal_OC == IdSucursal && q.IdOrdenCompra == IdOrdenCompra && q.Secuencia_OC == secuencia select q; if (select.ToList().Count() >= 1) { return(true); } else { return(false); } } 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 ValidarCodigoExiste(string Cod) { try { EntitiesCuentasxPagar context = new EntitiesCuentasxPagar(); var Existe = from q in context.cp_trans_a_generar_x_FormaPago_OP where q.IdTipoTransaccion == Cod select q; if (Existe.ToList().Count() > 0) { return(true); } else { return(false); } } 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()); } }
public Boolean EliminarDB(int IdEmpresa, int IdSucursal, decimal IdOrdenCompra, int secuencia, ref string mensaje) { try { using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar()) { var contact = context.cp_orden_giro_x_com_ordencompra_local_det.FirstOrDefault(cp => cp.IdEmpresa_OC == IdEmpresa && cp.IdSucursal_OC == IdSucursal && cp.IdOrdenCompra == IdOrdenCompra && cp.Secuencia_OC == secuencia); if (contact != null) { context.cp_orden_giro_x_com_ordencompra_local_det.Remove(contact); context.SaveChanges(); context.Dispose(); } } 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 HabilitarDB(cp_TipoDocumento_Info info) { try { Boolean res = false; using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar()) { var contact = context.cp_TipoDocumento.FirstOrDefault(minfo => minfo.CodTipoDocumento == info.CodTipoDocumento); if (contact != null) { contact.Estado = "A"; contact.IdUsuarioUltMod = info.IdUsuarioUltMod; contact.Fecha_UltMod = info.Fecha_UltMod; contact.nom_pc = info.nom_pc; contact.ip = info.ip; context.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.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public Boolean EliminarDB(int IdEmpresa, decimal IdCbteCble_Ogiro, int IdTipoCbte_Ogiro) { try { using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar()) { var contact = context.cp_orden_giro_x_imp_ordencompra_ext.FirstOrDefault(minfo => minfo.og_IdEmpresa == IdEmpresa && minfo.og_IdCbteCble == IdCbteCble_Ogiro && minfo.og_IdTipoCbte == IdTipoCbte_Ogiro); if (contact != null) { context.cp_orden_giro_x_imp_ordencompra_ext.Remove(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() + " " + ex.Message; throw new Exception(ex.ToString()); } }
public List <cp_TipoDocumento_Info> Get_List_TipoDocumento() { try { List <cp_TipoDocumento_Info> Lst = new List <cp_TipoDocumento_Info>(); EntitiesCuentasxPagar oEnti = new EntitiesCuentasxPagar(); Lst = (from q in oEnti.cp_TipoDocumento orderby q.Orden ascending select new cp_TipoDocumento_Info { CodTipoDocumento = q.CodTipoDocumento, Codigo = q.Codigo, Descripcion = q.Descripcion, Orden = q.Orden, DeclaraSRI = q.DeclaraSRI, CodSRI = q.CodSRI, Estado = q.Estado, GeneraRetencion = q.GeneraRetencion, Codigo_Secuenciales_Transaccion = q.Codigo_Secuenciales_Transaccion, Sustento_Tributario = q.Sustento_Tributario, }).ToList(); return(Lst); } 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()); } }
public Boolean GrabarDB(cp_orden_giro_x_imp_ordencompra_ext_Info info, ref string mensaje) { try { using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar()) { EntitiesCuentasxPagar EDB = new EntitiesCuentasxPagar(); //var contact = cp_orden_giro_x_imp_ordencompra_ext.Createcp_orden_giro_x_imp_ordencompra_ext(0, 0, 0, 0, 0, 0); var address = new cp_orden_giro_x_imp_ordencompra_ext(); address.imp_IdEmpresa = info.imp_IdEmpresa; address.imp_IdOrdenCompraExt = info.imp_IdOrdenCompraExt; address.imp_IdSucursal = info.imp_IdSucursal; address.og_IdCbteCble = info.og_IdCbteCble; address.og_IdEmpresa = info.og_IdEmpresa; address.og_IdTipoCbte = info.og_IdTipoCbte; //contact = address; context.cp_orden_giro_x_imp_ordencompra_ext.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 List <cp_proveedor_codigo_SRI_Info> Get_List_proveedor_codigo_SRI(int IdEmpresa, decimal Iproveedor) { try { List <cp_proveedor_codigo_SRI_Info> lM = new List <cp_proveedor_codigo_SRI_Info>(); EntitiesCuentasxPagar db = new EntitiesCuentasxPagar(); var select_ = from T in db.cp_proveedor_codigo_SRI where T.IdEmpresa == IdEmpresa && T.IdProveedor == Iproveedor select T; foreach (var item in select_) { cp_proveedor_codigo_SRI_Info dat = new cp_proveedor_codigo_SRI_Info(); dat.IdEmpresa = item.IdEmpresa; dat.IdProveedor = item.IdProveedor; dat.IdCodigo_SRI = item.IdCodigo_SRI; // dat.IdCtaCble = item.IdCtaCble; dat.observacion = item.observacion; lM.Add(dat); } return(lM); } 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()); } }
public Boolean ModificarDB(cp_orden_pago_det_Info Info) { try { EntitiesCuentasxPagar context = new EntitiesCuentasxPagar(); var address = context.cp_orden_pago_det.FirstOrDefault(var => var.IdOrdenPago == Info.IdOrdenPago && var.IdEmpresa == Info.IdEmpresa && var.Secuencia == Info.Secuencia); if (address != null) { address.IdFormaPago = Info.IdFormaPago; address.Fecha_Pago = Info.Fecha_Pago; address.IdEstadoAprobacion = Info.IdEstadoAprobacion; address.IdUsuario_Aprobacion = Info.IdUsuario_Aproba; address.fecha_hora_Aproba = Info.fecha_hora_Aproba; address.Motivo_aproba = ""; context.SaveChanges(); cp_orden_pago_Data data = new cp_orden_pago_Data(); data.ModificarDB(Info.IdEmpresa, Convert.ToInt32(Info.IdOrdenPago), "APRO"); } 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 decimal GetId(int IdEmpresa) { try { decimal Id; using (EntitiesCuentasxPagar base_ = new EntitiesCuentasxPagar()) { var q = from C in base_.cp_conciliacion_Caja where C.IdEmpresa == IdEmpresa select C; if (q.ToList().Count == 0) { return(1); } else { var select_ = (from T in base_.cp_conciliacion_Caja where T.IdEmpresa == IdEmpresa select T.IdConciliacion_Caja).Max(); Id = select_ + 1; return(Id); } } } 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()); } }