public void setProdact(string prodactionname, string prodactioncount, string prodactioncost)
        {
            ProdactionSet prodaction = new ProdactionSet
            {
                ProdactionName  = prodactionname,
                ProdactionCount = prodactioncount,
                ProdactionCost  = prodactioncost
            };

            ukrzaliznutsaDBEntities.ProdactionSet.Add(prodaction);
            ukrzaliznutsaDBEntities.SaveChanges();
        }
        public void Delete(string user)
        {
            UkrzaliznutsaDBEntities ukrzaliznutsaDBEntities = new UkrzaliznutsaDBEntities();
            List <UsersSet>         users;
            UsersSet userinfo = ukrzaliznutsaDBEntities.UsersSet.Where(x => x.Name == user).FirstOrDefault();

            users = ukrzaliznutsaDBEntities.UsersSet.ToList();
            ukrzaliznutsaDBEntities.UsersSet.Remove(userinfo);
            ukrzaliznutsaDBEntities.SaveChanges();
        }
        private void DeleteUser_Click(object sender, RoutedEventArgs e)
        {
            UkrzaliznutsaDBEntities ukrzaliznutsaDBEntities = new UkrzaliznutsaDBEntities();
            List <UsersSet>         users;
            UsersSet user = ukrzaliznutsaDBEntities.UsersSet.Where(x => x.Name == ListUsers.SelectedItem.ToString()).FirstOrDefault();

            users = ukrzaliznutsaDBEntities.UsersSet.ToList();
            ukrzaliznutsaDBEntities.UsersSet.Remove(user);
            ukrzaliznutsaDBEntities.SaveChanges();
        }
        public void setUserLogin(string login, string pass)
        {
            UkrzaliznutsaDBEntities ukrzaliznutsaDBEntities = new UkrzaliznutsaDBEntities();
            UsersSet users = new UsersSet
            {
                Name     = login,
                Password = pass
            };

            ukrzaliznutsaDBEntities.UsersSet.Add(users);
            ukrzaliznutsaDBEntities.SaveChanges();
        }
        public void setTicket(string user, string number, string pointstart, string pointend, string typevagon, string price, byte[] photoload, byte[] arrayread, string marshrute)
        {
            UkrzaliznutsaDBEntities ukrzaliznutsaDBEntities = new UkrzaliznutsaDBEntities();
            TicketSet ticket = new TicketSet
            {
                User        = user,
                Number      = number,
                PointStart  = pointstart,
                PointEnd    = pointend,
                TypeVagon   = typevagon,
                Price       = price,
                Photo       = photoload,
                Information = arrayread,
                Marshrute   = marshrute
            };

            ukrzaliznutsaDBEntities.TicketSet.Add(ticket);
            ukrzaliznutsaDBEntities.SaveChanges();
        }