viewing paste Unknown #12878 | C#

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Navigation;
using System.Text.RegularExpressions;
using System.Net;
using System.Xaml;
using System.Xml;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Data;
using System.Timers;
 
 
 
namespace Login_WPF
{
    /// <summary>
    /// Interaction logic for Welcome.xaml
    /// </summary>
    public partial class Welcome : Window
    {
 
        public Welcome()
        {
        
            InitializeComponent();
            //Main Controls
            MainWindows.MenuPrincipal.Iniciado.idle idle = new MainWindows.MenuPrincipal.Iniciado.idle();
            stackpanel.Children.Add(idle);
 
        }
 
 
 
        private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.DragMove();
        }
 
        public void Button_Click_2(object sender, RoutedEventArgs e)
        {
           
            //stackpanel.Children.Add(Eliminar);
            stackpanel.Children.Clear();
            MainWindows.MenuPrincipal.Agregar_o_Eliminar.Agregar Agregar = new MainWindows.MenuPrincipal.Agregar_o_Eliminar.Agregar();
            MainWindows.MenuPrincipal.Agregar_o_Eliminar.Eliminar Eliminar = new MainWindows.MenuPrincipal.Agregar_o_Eliminar.Eliminar();
            stackpanel.Children.Add(Agregar);
        }
 
        private void Button_Click_3(object sender, RoutedEventArgs e)
        {
            stackpanel.Children.Clear();
            MainWindows.MenuPrincipal.Buscarclase.Buscar Buscar = new MainWindows.MenuPrincipal.Buscarclase.Buscar();
            stackpanel.Children.Add(Buscar);
        }
 
        private void Button_Click_4(object sender, RoutedEventArgs e)
        {
            stackpanel.Children.Clear();
            MainWindows.MenuPrincipal.Semana.Semana Semana = new MainWindows.MenuPrincipal.Semana.Semana();
            stackpanel.Children.Add(Semana);
        }
 
        private void Button_Click_5(object sender, RoutedEventArgs e)
        {
            stackpanel.Children.Clear();
            MainWindows.MenuPrincipal.Horario_detallado.Horariodetallado Horariodetall = new MainWindows.MenuPrincipal.Horario_detallado.Horariodetallado();
            stackpanel.Children.Add(Horariodetall);
        }
 
        private void Button_Click_6(object sender, RoutedEventArgs e)
        {
            stackpanel.Children.Clear();
            MainWindows.MenuPrincipal.Calendario.Calendario Calendario = new MainWindows.MenuPrincipal.Calendario.Calendario();
            stackpanel.Children.Add(Calendario);
 
        }
 
        private void Button_Click_7(object sender, RoutedEventArgs e)
        {
            stackpanel.Children.Clear();
            MainWindows.MenuPrincipal.Historial.Historial Historial = new MainWindows.MenuPrincipal.Historial.Historial();
            stackpanel.Children.Add(Historial);
 
        }
 
        private void Button_Click_8(object sender, RoutedEventArgs e)
        {
            stackpanel.Children.Clear();
            MainWindows.MenuPrincipal.Proyecciones.Proyecciones Proyecciones = new MainWindows.MenuPrincipal.Proyecciones.Proyecciones();
            stackpanel.Children.Add(Proyecciones);
        }
 
        private void Button_Click_9(object sender, RoutedEventArgs e)
        {
            Profile.Profile Profile = new Profile.Profile();
            Profile.Show();
        }
     
        public void Window_Loaded_1(object sender, RoutedEventArgs e)
        {
            //Timers
            DateTime localDateTime = DateTime.Now;
            localDateTime = localDateTime.ToLocalTime();
            this.ServerDate.Text = localDateTime.ToString();
           // ateTime utcDateTime = localDateTime.ToUniversalTime();
            //LastconnDate.Text = utcDateTime.ToString();
        }
 
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            Login login = new Login();
            login.Show();
            this.Close();
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
 
        }
 
        void OnLoad(object sender, RoutedEventArgs e)
        {
 
        }
 
        private void Dev_Click(object sender, RoutedEventArgs e)
        {
            
            Emergency.Popups.Popupad Pupopad = new Emergency.Popups.Popupad();
            Pupopad.Show();
            this.Close();
            }
        private void Tool_Click(object sender, RoutedEventArgs e)
        {
 
 
        }
 
        public void OnClosed(object sender, EventArgs e)
        {
            string matr = Matricula.Text;
            DateTime localDateTime = DateTime.Now;
            DateTime utcDateTime = localDateTime.ToUniversalTime();
            string utcDate = utcDateTime.ToString();
            SqlConnection con = new SqlConnection("workstation id=UniversityDB.mssql.somee.com; packet size=4096; user id=Nevercome2_SQLLogin_1; pwd=5rzbfru5dj; data source=UniversityDB.mssql.somee.com; persist security info=False; initial catalog=UniversityDB");
            con.Open();
            string Update;
            string Update2;
            //Formando el comando SQL
            Update = "UPDATE UNStudents SET Last_Connection= "+100000+"  WHERE id=" + matr;
            Update2 = "UPDATE UNStudents SET UNStatus= "+0+" WHERE id=" + matr;
            SqlCommand Updatecommand = new SqlCommand(Update, con);
            SqlCommand Updatecommand2 = new SqlCommand(Update2, con);
 
            //Ejecucion del comando en el servidor de BD
            Updatecommand.ExecuteNonQuery();
            Updatecommand2.ExecuteNonQuery();
        }
 
 
    }
}
Viewed 1554 times, submitted by Dynasty.