Пример #1
0
 void AddClient(Cliente cliente)
 {
     using (var d = SqliteData.GetInstance())
     {
         var sql = String.Format(@"insert into Cliente(Ruc,Logo,Firma)
                                 values('{0}','{1}','{2}')", cliente.Ruc, cliente.Logo, cliente.Firma);
         using (var command = new SQLiteCommand(sql, d))
         {
             command.ExecuteReader();
         }
     }
 }
Пример #2
0
 void UpdateClient(Cliente cliente)
 {
     using (var d = SqliteData.GetInstance())
     {
         var sql = String.Format(@"update Cliente set Logo='{0}',Firma='{1}'
                                 where Ruc='{2}'", cliente.Logo, cliente.Firma, cliente.Ruc);
         using (var command = new SQLiteCommand(sql, d))
         {
             command.ExecuteReader();
         }
     }
 }
Пример #3
0
        public Cliente FindClient(string ruc)
        {
            Cliente cliente = null;

            using (var d = SqliteData.GetInstance())
            {
                var sql = String.Format("select * from Cliente where Ruc={0}", ruc);
                using (var command = new SQLiteCommand(sql, d))
                {
                    using (var reader = command.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            cliente       = new Cliente();
                            cliente.Ruc   = reader["Ruc"].ToString();
                            cliente.Logo  = reader["Logo"].ToString();
                            cliente.Firma = reader["Firma"].ToString();
                        }
                    }
                }
            }
            return(cliente);
        }