Ejemplo n.º 1
0
        public bool ModificarDB(fa_formaPago_Info info)
        {
            try
            {
                using (Entities_facturacion Context = new Entities_facturacion())
                {
                    fa_formaPago Entity = Context.fa_formaPago.Where(q => q.IdFormaPago == info.IdFormaPago).FirstOrDefault();
                    if (Entity == null)
                    {
                        return(false);
                    }

                    Entity.nom_FormaPago = info.nom_FormaPago;

                    Entity.IdUsuarioUltMod = info.IdUsuarioUltMod;
                    Entity.Fecha_UltMod    = DateTime.Now;
                    Context.SaveChanges();
                }
                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 2
0
 public fa_formaPago_Info GetInfo(string IdFormaPago)
 {
     try
     {
         fa_formaPago_Info info = new fa_formaPago_Info();
         using (Entities_facturacion Context = new Entities_facturacion())
         {
             fa_formaPago Entity = Context.fa_formaPago.Where(q => q.IdFormaPago == IdFormaPago).FirstOrDefault();
             if (Entity == null)
             {
                 return(null);
             }
             info = new fa_formaPago_Info
             {
                 IdFormaPago   = Entity.IdFormaPago,
                 nom_FormaPago = Entity.nom_FormaPago,
                 Estado        = Entity.Estado
             };
         }
         return(info);
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 3
0
        public Boolean GuardarDB(fa_formaPago_Info Info, ref string msjError)
        {
            try
            {
                using (EntitiesFacturacion Context = new EntitiesFacturacion())
                {
                    var Address = new fa_formaPago();

                    Address.IdFormaPago   = Info.IdFormaPago;
                    Address.nom_FormaPago = Info.nom_FormaPago;

                    Context.fa_formaPago.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);
                mensaje = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                msjError = mensaje;
                throw new Exception(ex.ToString());
            }
        }