protected void Page_Load(object sender, EventArgs e)
        {
            string email = Request.QueryString["email"].ToString();
            string pwd   = Request.QueryString["password"].ToString();

            PassDLL.Login lg = new PassDLL.Login();
            Session["Name"] = lg.GetPassengerName(email, pwd);
            Label1.Text     = "welcome " + Session["Name"].ToString();
            DataTable d = lg.GetPassengerdata(email, pwd);

            byte[] bytes = null;
            foreach (DataRow dr in d.Rows)
            {
                bytes = (byte[])dr["Photo"];
                string base64String = Convert.ToBase64String(bytes, 0, bytes.Length);
                PassengerImage.ImageUrl = "data:image/jpg;base64," + base64String;
                Label3.Text             = dr["Registration_Id"].ToString();
                Label2.Text             = dr["Name"].ToString();
            }
            DataTable d2 = lg.GetQRPass(email, pwd);

            foreach (DataRow dr2 in d2.Rows)
            {
                byte[] pass         = (byte[])dr2["QR_Code"];
                string base64String = Convert.ToBase64String(pass, 0, pass.Length);
                QRImage.ImageUrl = "data:image/png;base64," + base64String;
                //Label2.Text = dr["Name"].ToString();
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string password        = Request.Form.Get("t1");
            string newpassword     = Request.Form.Get("t2");
            string confirmpassword = Request.Form.Get("t3");

            PassDLL.Login lg  = new PassDLL.Login();
            string        msg = lg.ChangePassword(newpassword, password);

            Response.Write(msg);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Test", msg, true);
        }
示例#3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            PassDLL.Login lg = new PassDLL.Login();
            DataTable     d  = lg.GetbusData(TextBox2.Text);

            foreach (DataRow dr in d.Rows)
            {
                TextBox4.Text = dr["Source"].ToString();
                TextBox5.Text = dr["Destination"].ToString();
                TextBox6.Text = dr["Bus_Type"].ToString();
                TextBox7.Text = dr["Bus_Number"].ToString();
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Regid = Request.QueryString["regid"].ToString();
         PassDLL.Login lg = new PassDLL.Login();
         DataTable     d  = lg.GetPassengerProfile(Regid);
         foreach (DataRow dr in d.Rows)
         {
             TextBox1.Text = dr["Name"].ToString();
             TextBox2.Text = dr["Address"].ToString();
             TextBox3.Text = dr["Mobile_Number"].ToString();
             TextBox4.Text = dr["Email_Id"].ToString();
         }
     }
 }
示例#5
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            int      regid      = Convert.ToInt32(TextBox1.Text);
            int      busid      = Convert.ToInt32(TextBox2.Text);
            DateTime assigndate = Convert.ToDateTime(TextBox3.Text);
            string   duration   = DropDownList1.Text;

            PassDLL.Login lg  = new PassDLL.Login();
            string        msg = lg.AssignStaff(regid, busid, assigndate, duration);

            //Response.Write(msg);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Test", msg, true);
            if (true)
            {
                TextBox1.Text = string.Empty;
                TextBox2.Text = string.Empty;
                TextBox3.Text = string.Empty;
            }
        }
示例#6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string email    = Request.Form.Get("t1");
            string password = Request.Form.Get("t2");

            if (email == "admin" && password == "admin")
            {
                //Response.Write("successfull");

                Response.Redirect("AdminDashboard.aspx");
            }
            else
            {
                PassDLL.Login log = new PassDLL.Login();
                string        chk = log.Checklogin(email, password);
                if (chk == "true")
                {
                    string role = log.CheckRole(email, password);
                    if (role == "Staff")
                    {
                        Response.Redirect("StaffDashboard.aspx?email=" + email + "&password="******"PassengerDashboard.aspx?email=" + email + "&password="******"login.aspx");
                    // Response.Write("invalid credentials , try again");
                    // string msg = "invalid credentials , try again...";
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Test", "login.aspx;", true);
                    //Request.Form.Clear();
                }
            }
        }