コード例 #1
0
        public void UserSignup(string name, string username, string email, string password, string phone, string nic, string address)
        {
            ConnectionStringSettings conSettings = ConfigurationManager.ConnectionStrings["DB"];
            string connectionString = conSettings.ConnectionString;

            try
            {
                con = new SqlConnection(connectionString);
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }

                //Till Here}

                cmd = new SqlCommand("insert into [User]([Name],Username,Password,Email,Phone,NIC,Address) values ('" + name + "','" + username + "','" + password + "','" + email + "','" + phone + "','" + nic + "','" + address + "')", con);

                cmd.ExecuteNonQuery();
                con.Close();

                DialogResult DDR = MessageBox.Show("User Added Successfully!", "Railway Management System", MessageBoxButtons.OK,
                                                   MessageBoxIcon.Information);


                UserSignUp    usu = new UserSignUp();
                UserDashboard ud  = new UserDashboard();
                usu.Hide();
                ud.ShowDialog();
                usu.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #2
0
        private void metroTile2_Click(object sender, EventArgs e)
        {
            UserDashboard udh = new UserDashboard();

            this.Hide();
            udh.ShowDialog();
            this.Close();
        }
コード例 #3
0
ファイル: UserSignIn.cs プロジェクト: UsamaSaleem148/TrainRMS
 private void metroButton1_Click(object sender, EventArgs e)
 {
     RMS.UserDashboard.checking = 0;
     controller.UserSignIn(metroTextBox1.Text, metroTextBox2.Text);
     if (loginvalidator == 100)
     {
         UserDashboard udash = new UserDashboard();
         this.Hide();
         udash.ShowDialog();
         this.Close();
     }
     else
     {
         DialogResult DDR = MessageBox.Show("Invalid Username or Password", "Railway Management System", MessageBoxButtons.OK,
                                            MessageBoxIcon.Information);
     }
 }
コード例 #4
0
        private void metroTile1_Click(object sender, EventArgs e)
        {
            int x = 10, y = 50;



            PdfDocument pdf = new PdfDocument();

            pdf.Info.Title = "E Tickets";
            PdfPage   pdfPage   = pdf.AddPage();
            XGraphics graph     = XGraphics.FromPdfPage(pdfPage);
            XFont     font      = new XFont("Verdana", 20, XFontStyle.Bold);
            XFont     smallfont = new XFont("Verdana", 13, XFontStyle.Regular);

            for (int h = 0; h < t; h++)
            {
                graph.DrawString("PNR#:" + Pnr[h] + "                          RMS - E-Ticket                             ", font, XBrushes.Black, 100, y += 18);

                graph.DrawString("Date: " + BookTrain.date + "                                       Time: " + BookTrain.arrivaltime + "", smallfont, XBrushes.Black, x, y += 18);
                graph.DrawString("Passenger Name: " + Pname[h] + "                                NIC: " + Pnic[h] + "", smallfont, XBrushes.Black, x, y += 18);
                graph.DrawString("Train Name: " + BookTrain.trainName + "                          Class: " + BookTrain.className + "", smallfont, XBrushes.Black, x, y += 18);
                graph.DrawString("From: " + BookTrain.source + "                                 To: " + BookTrain.destination + "", smallfont, XBrushes.Black, x, y    += 18);
                graph.DrawString("Amount: 1200                                    ", smallfont, XBrushes.Black, 10, y += 18);
                graph.DrawString("Reserved by: " + RMSController.usname + "                            Seat: " + Pseat[h] + "", smallfont, XBrushes.Black, 10, y += 18);
                graph.DrawString("                                    ", smallfont, XBrushes.Black, 10, y += 18);
                graph.DrawString(" ------------------------------------------------------------------ ", smallfont, XBrushes.Black, 120, y += 18);
                graph.DrawString("                                    ", smallfont, XBrushes.Black, 10, y += 18);
                graph.DrawString("                                    ", smallfont, XBrushes.Black, 10, y += 18);
            }
            string pdfFilename = "Tickets.pdf";

            pdf.Save(pdfFilename);

            Process.Start(pdfFilename);
            UserDashboard userdash = new UserDashboard();

            this.Hide();
            userdash.ShowDialog();
            this.Close();
        }