Ejemplo n.º 1
0
        public static void DeletetDB(MediosPagoModel modelo)
        {
            try
            {
                using (efooddatabaseEntities db = new efooddatabaseEntities())
                {
                    var datos = (from valor in db.PaymentProcessors
                                 where valor.PaymentProcessorCode == modelo.PaymentProcessorCode
                                 select valor).SingleOrDefault();

                    db.PaymentProcessors.Remove(datos);
                    db.SaveChanges();
                    BitacoraModel.AddLogBook("n", "Borrar", Admin.ObtenerIdUsuario());
                }
            }
            catch (Exception x) { ErrorLogModel.AddError(x); }
        }
Ejemplo n.º 2
0
        public static void EditDB(MediosPagoModel modelo)
        {
            try
            {
                using (efooddatabaseEntities db = new efooddatabaseEntities())
                {
                    var datos = (from valor in db.PaymentProcessors
                                 where valor.PaymentProcessorCode == modelo.PaymentProcessorCode
                                 select valor).SingleOrDefault();

                    datos.PaymentProcessorName        = modelo.PaymentProcessorName;
                    datos.PaymentProcessorDescription = modelo.PaymentProcessorDescription;
                    datos.PaymentProcessorType        = modelo.PaymentProcessorType;
                    datos.PaymentProcessorMethod      = modelo.PaymentProcessorMethod;
                    datos.PaymentProcessorStatus      = false;
                    datos.PaymentProcessorVerify      = false;
                    db.SaveChanges();
                    BitacoraModel.AddLogBook("e", "Edicion", Admin.ObtenerIdUsuario());
                }
            }
            catch (Exception x) { ErrorLogModel.AddError(x); }
        }
Ejemplo n.º 3
0
 public static void AddDB(MediosPagoModel modelo)
 {
     using (efooddatabaseEntities db = new efooddatabaseEntities())
     {
         try
         {   //Entidades de la base de datos
             PaymentProcessor newProcessor = new PaymentProcessor
             {
                 PaymentProcessorCode        = ConsecutivoModel.GetConsecutivo("Medios de pago"),
                 PaymentProcessorName        = modelo.PaymentProcessorName,
                 PaymentProcessorDescription = modelo.PaymentProcessorDescription,
                 PaymentProcessorType        = modelo.PaymentProcessorType,
                 PaymentProcessorMethod      = modelo.PaymentProcessorMethod,
                 PaymentProcessorStatus      = false,
                 PaymentProcessorVerify      = false
             };
             db.PaymentProcessors.Add(newProcessor);
             db.SaveChanges();
             BitacoraModel.AddLogBook("a", "Anadir", Admin.ObtenerIdUsuario());
         }
         catch (Exception e) { ErrorLogModel.AddError(e); }
     }
 }