예제 #1
0
        public static bool Guardar(Medicinas medicina)
        {
            bool retorno = false;

            using (var conexion = new WebFarmaciaDb())
            {
                conexion.Medicina.Add(medicina);

                conexion.SaveChanges();

                retorno = true;
            }
            return(retorno);
        }
예제 #2
0
        public static bool Guardar(Clientes cliente)
        {
            bool retorno = false;

            using (var db = new WebFarmaciaDb())
            {
                try
                {
                    db.Cliente.Add(cliente);
                    db.SaveChanges();
                    retorno = true;
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(retorno);
        }