Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["currentuser"] != null)
        {
            StudentInfor astudent = Session["currentuser"] as StudentInfor;
            Label5.Text = Convert.ToString(astudent.AccountNumber);
            Label6.Text = Convert.ToString(astudent.FullName);
            Label7.Text = Convert.ToString(astudent.LastUpdatedDate);
            Cell1.Text  = Convert.ToString(astudent.CurrentBalance);
            Cell2.Text  = Convert.ToString(astudent.LastUpdatedDate);
            Cell3.Text  = Convert.ToString(astudent.RegularMonthlyPaymentAmount);
            Cell4.Text  = Convert.ToString(astudent.AmountSatisfiedByExtraPayment);
            Cell5.Text  = Convert.ToString(astudent.PastDueAmount);
            Cell6.Text  = Convert.ToString(astudent.CurrentAmountDue);
            Label9.Text = Convert.ToString(astudent.CurrentStatementDueDate);
        }

        else
        {
            Table1.Visible = false;
            Label7.Visible = false;
            Label6.Visible = false;
            Label5.Visible = false;
            Label9.Visible = false;
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Please login to see the Account details');window.location ='Login.aspx';", true);
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["thisuser"] != null)
     {
         List <StudentInfor> myList      = Application["ListofUsers"] as List <StudentInfor>;
         StudentInfor        thisStudent = new StudentInfor();
     }
     if (!this.IsPostBack)
     {
         for (int month = 1; month <= 12; month++)
         {
             string monthName = DateTimeFormatInfo.CurrentInfo.GetMonthName(month);
             ddlMonthNames.Items.Add(new ListItem(monthName));
         }
     }
     else
     {
         List <StudentInfor> myList      = Application["ListofUsers"] as List <StudentInfor>;
         StudentInfor        thisStudent = new StudentInfor();
         for (int i = 0; i < myList.Count; i++)
         {
             if (Tb2.Text == myList[i].SocialSecurityNumber)
             {
                 this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(' " + Tb2.Text + " Number already exists.Please go to login page')", true);
             }
         }
     }
 }
Beispiel #3
0
    protected void addtolist(object sender, EventArgs e)
    {
        List <UserInfor> allUsersList = Application["AllUsersList"] as List <UserInfor>;
        UserInfor        uinfo        = Session["currentUser"] as UserInfor;
        var flag = uinfo.MyStudents.Find(x => x.StudentId == studentid.Text);

        if (flag != null)
        {
            Response.Write("<script>alert('The student is already in your list.');</script>");
        }
        else
        {
            StudentInfor sinfo = new StudentInfor();

            SqlConnection db_conn       = new SqlConnection("Data Source=dcm.uhcl.edu;Initial Catalog=c432017sp02errabellyr;Persist Security Info=True;User ID=errabellyr;Password=1472539;Asynchronous Processing=true;MultipleActiveResultSets=True");
            String        query_builder = "INSERT INTO Errabelly_WADSP17_STUDENT(EmailAddress,StudentId,StudentFirstName,StudentLastName,SchoolName) VALUES(" + "'" + uinfo.EmailAddress + "', '" + studentid.Text + "', '" + fname.Text + "', '" + lname.Text + "', '" + sname.Text + "')";
            SqlCommand    sql_query     = new SqlCommand(query_builder, db_conn);
            try
            {
                db_conn.Open();
                sql_query.ExecuteNonQuery();
            }
            finally
            { db_conn.Close(); }

            sinfo.StudentFirstName = fname.Text;
            sinfo.StudentLastName  = lname.Text;
            sinfo.StudentId        = studentid.Text;
            sinfo.SchoolName       = sname.Text;
            uinfo.MyStudents.Add(sinfo);
            Application["AllUsersList"] = allUsersList;
            Response.Redirect("~/MyStudents.aspx");
        }
    }
Beispiel #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["currentuser"] != null)
     {
         StudentInfor stu = Session["currentuser"] as StudentInfor;
         txtaccountnumber.Text = Convert.ToString(stu.AccountNumber);
         lbldate.Text          = Convert.ToString(stu.LastUpdatedDate);
         lblfullname.Text      = Convert.ToString(stu.FullName);
         cell1.Text            = Convert.ToString(stu.CurrentBalance);
         cell2.Text            = Convert.ToString(stu.LastUpdatedDate);
         cell3.Text            = Convert.ToString(stu.RegularMonthlyPaymentAmount);
         cell4.Text            = Convert.ToString(stu.AmountSatisfiedByExtraPayment);
         cell5.Text            = Convert.ToString(stu.PastDueAmount);
         cell6.Text            = Convert.ToString(stu.CurrentAmountDue);
         Label20.Text          = Convert.ToString(stu.CurrentStatementDueDate);
     }
     else
     {
         Table1.Visible           = false;
         lbldate.Visible          = false;
         lblfullname.Visible      = false;
         txtaccountnumber.Visible = false;
         Label20.Visible          = false;
         Response.Redirect("Login.aspx");
     }
 }
Beispiel #5
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        using (System.Data.SqlClient.SqlConnection sql = new System.Data.SqlClient.SqlConnection("Data Source=dcm.uhcl.edu;Initial Catalog=c432016fa02kasichainulak;User ID=kasichainulak;Password=1456090"))
        {
            sql.Open();

            String selectquery = "SELECT * FROM kasichainulak_WADfl16_studentinfor";
            System.Data.SqlClient.SqlCommand sp = new System.Data.SqlClient.SqlCommand(selectquery, sql);

            System.Data.SqlClient.SqlDataReader reader = sp.ExecuteReader();

            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    StudentInfor student = new StudentInfor();
                    student.emailAddress = reader.GetString(7);
                    if (student.emailAddress == TextBox1.Text)
                    {
                        student.password = reader.GetString(2);
                        password         = student.password;
                        email_valid      = 1;
                    }
                }
            }
            reader.Close();
            sql.Close();
        }

        if (email_valid == 1)
        {
            /* Body of the email is:*/
            string body_part1 = "Dear Valued Student, <br /> You are receiving this email beause you requested to recover your password.";
            string body_part2 = "<br /><br />Your current password is:" + "<mark>" + password + "</mark>";
            string body_part3 = "<br /><mark>K.K Student Loan</mark>";
            //string body_part4 = "<br /> You can now access your loan account at" + "<a href=" + "login.aspx\"" + ">" + "</a>";

            string body = body_part1 + body_part2 + body_part3;
            using (MailMessage mail = new MailMessage(ConfigurationManager.AppSettings["SMTPuser"], TextBox1.Text))
            {
                mail.Subject    = "We have recovered your password!";
                mail.Body       = body;
                mail.IsBodyHtml = true;
                SmtpClient smtp = new SmtpClient();
                smtp.Host      = ConfigurationManager.AppSettings["Host"];
                smtp.EnableSsl = Convert.ToBoolean(ConfigurationManager.AppSettings["EnableSSL"]);;
                NetworkCredential NetworkCred = new NetworkCredential(ConfigurationManager.AppSettings["SMTPuser"], ConfigurationManager.AppSettings["SMTPpassword"]);
                smtp.UseDefaultCredentials = true;
                smtp.Credentials           = NetworkCred;
                smtp.Port = int.Parse(ConfigurationManager.AppSettings["Port"]);;
                smtp.Send(mail);
                ClientScript.RegisterStartupScript(GetType(), "alert", "alert('Thank You. An email has been sent to the address you have provided');", true);
            }
        }
        else
        {
            ClientScript.RegisterStartupScript(GetType(), "alert", "alert('You are not in my database');", true);
        }
    }
        public ActionResult DeleteConfirmed(int id)
        {
            StudentInfor studentInfor = db.StudentInfor.Find(id);

            db.StudentInfor.Remove(studentInfor);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["currentuser"] != null)
     {
         StudentInfor astudent = Session["currentuser"] as StudentInfor;
         LinkButton2.Text = "Logout";
     }
 }
 public ActionResult Edit([Bind(Include = "Sno,Spassword,Sname,Ssex,Sage,Sdepartment,Smajor,Sclass,Sgpa,Scampus")] StudentInfor studentInfor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(studentInfor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(studentInfor));
 }
Beispiel #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["currentuser"] != null)
     {
         StudentInfor stu = Session["currentuser"] as StudentInfor;
         LinkButton2.Text = "Logout";
         TextBox1.Enabled = true;
         Button1.Enabled  = true;
     }
 }
Beispiel #10
0
        protected void Application_Start(object sender, EventArgs e)
        {
            Application["AllUsersList"]   = new List <UserInfor>();
            Application["AllStudentList"] = new List <StudentInfor>();
            List <UserInfor> allUsersList = Application["AllUsersList"] as List <UserInfor>;

            if (allUsersList == null)
            {
                allUsersList = new List <UserInfor>();
            }
            List <StudentInfor> allStudentsList = Application["AllStudentList"] as List <StudentInfor>;

            if (allStudentsList == null)
            {
                allStudentsList = new List <StudentInfor>();
            }
            SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["dcmweb.c432017sp02kamireddig.dbo"].ToString());

            cn.Open();
            String        query      = "SELECT * from Kamireddig_WADsp17_StudentInfor";
            String        query1     = "SELECT * from Kamireddig_WADsp17_UserInfor";
            SqlCommand    cmd        = new SqlCommand(query, cn);
            SqlCommand    cmd1       = new SqlCommand(query1, cn);
            SqlDataReader sqlReader  = cmd.ExecuteReader();
            SqlDataReader sqlReader1 = cmd1.ExecuteReader();

            while (sqlReader.Read())
            {
                UserInfor obj = new UserInfor();
                obj.EmailAddress           = (string)sqlReader["EmailAddress"];
                obj.Password               = (string)sqlReader["Password"];
                obj.FirstName              = (string)sqlReader["FirstName"];
                obj.LastName               = (string)sqlReader["LastName"];
                obj.SecurityQuestion       = (string)sqlReader["SecurityQuestion"];
                obj.SecurityQuestionAnswer = (string)sqlReader["SecurityQAnswer"];
                obj.StateOrProvince        = (string)sqlReader["StateOrProvince"];
                obj.SchoolDistrictName     = (string)sqlReader["SchoolDistName"];
                allUsersList.Add(obj);
            }
            Application["AllUsersList"] = allUsersList;
            while (sqlReader1.Read())
            {
                StudentInfor obj1 = new StudentInfor();
                obj1.EmailAddress     = (string)sqlReader1["EmailAddress"];
                obj1.StudentFirstName = (string)sqlReader1["StudentFirstName"];
                obj1.StudentId        = (string)sqlReader1["StudentId"];
                obj1.StudentLastName  = (string)sqlReader1["StudentLastName"];
                obj1.SchoolName       = (string)sqlReader1["SchoolName"];
                allStudentsList.Add(obj1);
            }
            Application["AllStudentList"] = allStudentsList;
            cn.Close();
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["currentuser"] != null)
     {
         StudentInfor stu = Session["currentuser"] as StudentInfor;
         LoginButton.Text        = "Logout";
         TextBox1.Enabled        = true;
         ContactUsSubmit.Enabled = true;
         logInMessage1.Text      = "";
         logInMessage2.Text      = "Please type your message below and click the Send Message button.";
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["currentuser"] != null)
     {
         StudentInfor stu = Session["currentuser"] as StudentInfor;
         Loginlink.Text = "Logout";
     }
     else
     {
         Loginlink.Text = "Login";
     }
 }
    protected void btnlogin_Click(object sender, EventArgs e)
    {
        int    userexist        = 0;
        string validateemail    = txtuserid.Text;
        string validatepassword = txtpassword.Text;

        if (Application["AllUsersList"] != null)
        {
            //database



            //with object
            List <StudentInfor> allUsersList = Application["AllUsersList"] as List <StudentInfor>;
            if (allUsersList != null)
            {
                for (int i = 0; i < allUsersList.Count; i++)
                {
                    if (allUsersList[i].EmailAddress == validateemail && allUsersList[i].Password == validatepassword)
                    {
                        userexist = 1;
                        Session["currentuser"] = allUsersList[i];
                        StudentInfor stu             = Session["currentuser"] as StudentInfor;
                        string       message         = "You have successfully logged in. Welcome ";
                        System.Text.StringBuilder sb = new System.Text.StringBuilder();
                        sb.Append("<script type = 'text/javascript'>");
                        sb.Append("window.onload=function(){");
                        sb.Append("alert('");
                        sb.Append(stu.FullName);
                        sb.Append(message);
                        sb.Append("')};");
                        sb.Append("</script>");
                        ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());
                        Response.Redirect("myAccount.aspx");
                    }
                }
            }
        }
        if (userexist != 1)
        {
            string message = "The user you have entered is not in our database, please try again or click on Register Link";
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("<script type = 'text/javascript'>");
            sb.Append("window.onload=function(){");
            sb.Append("alert('");
            sb.Append(message);
            sb.Append("')};");
            sb.Append("</script>");
            ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());
            clearall();
        }
    }
Beispiel #14
0
        // GET: api/Student
        public IEnumerable <StudentInfor> Get()
        {
            var studentInfList = new List <StudentInfor>();
            var StudentInfor   = new StudentInfor
            {
                MSSV  = "5951071023",
                HoTen = "Duong Cong Hau",
                Lop   = "Cong nghe thong tin K59"
            };

            studentInfList.Add(StudentInfor);
            return(studentInfList);
        }
        // GET: StudentInfors/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StudentInfor studentInfor = db.StudentInfor.Find(id);

            if (studentInfor == null)
            {
                return(HttpNotFound());
            }
            return(View(studentInfor));
        }
    protected void SubmitButtonClick(object sender, EventArgs e)
    {
        int    userexist        = 0;
        string validateemail    = EmailAddress.Text;
        string validatepassword = Password.Text;

        if (Application["AllUsersList"] != null)
        {
            List <StudentInfor> allUsersList = Application["AllUsersList"] as List <StudentInfor>;
            if (allUsersList != null)
            {
                for (int i = 0; i < allUsersList.Count; i++)
                {
                    String myemail = Convert.ToString(allUsersList[i].EmailAddress);
                    if (myemail == validateemail && allUsersList[i].PassWord == validatepassword)
                    {
                        userexist = 1;
                        Session["currentuser"] = allUsersList[i];
                        StudentInfor S1              = Session["currentuser"] as StudentInfor;
                        string       message         = "You have successfully logged in. Welcome!";
                        System.Text.StringBuilder sb = new System.Text.StringBuilder();
                        sb.Append("<script type = 'text/javascript'>");
                        sb.Append("window.onload=function(){");
                        sb.Append("alert('");
                        sb.Append(S1.FullName);
                        sb.Append(message);
                        sb.Append("')};");
                        sb.Append("</script>");
                        ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());
                        Response.Redirect("myaccount.aspx");
                    }
                }
            }
        }


        if (userexist != 1)
        {
            string message = "The user you have entered is not in our database, please try again or click on the Register Link to create an account";
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("<script type = 'text/javascript'>");
            sb.Append("window.onload=function(){");
            sb.Append("alert('");
            sb.Append(message);
            sb.Append("')};");
            sb.Append("</script>");
            ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());
        }
    }
Beispiel #17
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        bool userExist = false;

        if (Application["AllUsersList"] != null)
        {
            List <StudentInfor> allUsersList = Application["AllUsersList"] as List <StudentInfor>;
            if (allUsersList != null)
            {
                for (int i = 0; i < allUsersList.Count; i++)
                {
                    if (allUsersList[i].EmailAddress == username.Text && allUsersList[i].Password == pwd.Text)
                    {
                        userExist = true;
                        Session["currentuser"] = allUsersList[i];
                        StudentInfor astudent = Session["currentuser"] as StudentInfor;

                        string message = "You are now logged in";
                        System.Text.StringBuilder sb = new System.Text.StringBuilder();
                        sb.Append("<script type = 'text/javascript'>");
                        sb.Append("window.onload=function(){");
                        sb.Append("alert('");
                        sb.Append(message);
                        sb.Append("')};");
                        sb.Append("</script>");
                        ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());
                        Response.Redirect("Account.aspx");
                    }
                }
            }
        }



        if (userExist == false)
        {
            string message = "It appears that this user is not in our database.Please click Register Now Link.";
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("<script type = 'text/javascript'>");
            sb.Append("window.onload=function(){");
            sb.Append("alert('");
            sb.Append(message);
            sb.Append("')};");
            sb.Append("</script>");
            ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());
            clearall();
        }
    }
Beispiel #18
0
    public void OnRecovery(object sender, EventArgs e)
    {
        List <StudentInfor> myList      = Application["ListofUsers"] as List <StudentInfor>;
        StudentInfor        thisStudent = new StudentInfor();
        String       password           = "";
        StudentInfor s = Session["thisuser"] as StudentInfor;

        for (int i = 0; i < myList.Count; i++)
        {
            if (tb2.Text == myList[i].EmailAdress)
            {
                password = myList[i].Password;
            }
        }
        if (password == "")
        {
            this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('There is no mail address with the particular mentioned address.')", true);
        }

        String msgTo      = tb2.Text;
        String msgSubject = "We have Recovered your Password!";
        String msgBody    = "Dear Valued Student,<br/>" +
                            "\n" +
                            "You are receiving this email beacause as you are requested to recover your password.<br/>" + "\n" +
                            "Your Current Password is:<br/>" + password
                            + "Thank you.<br/>" + "\n" +
                            "Sun Educational Loan Service Team";

        MailMessage mailObj = new MailMessage();

        mailObj.Body = msgBody;
        mailObj.From = new MailAddress("*****@*****.**", "Suncare Educatinal Loan Services");
        mailObj.To.Add(new MailAddress(msgTo));
        mailObj.Subject    = msgSubject;
        mailObj.IsBodyHtml = true;
        SmtpClient SMTPClient = new System.Net.Mail.SmtpClient();

        SMTPClient.Host        = "smtp.gmail.com";
        SMTPClient.Port        = 587;
        SMTPClient.Credentials = new NetworkCredential("*****@*****.**", "wad2016fall");
        SMTPClient.EnableSsl   = true;
        try { SMTPClient.Send(mailObj); }
        catch (Exception ex) { tb2.Text = ex.ToString(); }
        this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Thank you.An email has been sent to the address you provided.')", true);
    }
Beispiel #19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["currentuser"] != null)
     {
         StudentInfor astudent = Session["currentuser"] as StudentInfor;
         LinkButton2.Text = "Logout";
     }
     if (LinkButton2.Text == "Login")
     {
         textarea.Enabled = false;
         Button1.Enabled  = false;
     }
     if (LinkButton2.Text == "Logout")
     {
         textarea.Enabled = true;
         Button1.Enabled  = true;
     }
 }
        // GET: api/Weather
        public IEnumerable <StudentInfor> Get()
        {
            var weatherInfList = new List <StudentInfor>();

            for (int i = 0; i < 10; i++)
            {
                var StudentInfor = new StudentInfor
                {
                    Fullname    = $"To Vo Nhu Quynh {i}",
                    birth       = $"02/10/2000",
                    PhoneNumber = i + 10,
                    Class       = $"CQ.59.CNTT",
                    dateTime    = DateTime.Now.ToUniversalTime()
                };
                weatherInfList.Add(StudentInfor);
            }
            return(weatherInfList);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["thisuser"] != null)
        {
            LinkButton2.Text = "Logout";

            if (!IsPostBack)
            {
                StudentInfor s = Session["thisuser"] as StudentInfor;
                M1.Text     = s.AccountNumber.ToString();
                M2.Text     = s.FullName;
                M3.Text     = s.LastUpdatedDate;
                curBal.Text = s.CurrentBalance.ToString();
                Last.Text   = s.LastUpdatedDate;

                MonthlyPayment.Text = s.RegularMonthlyPaymentAmount.ToString();
                ExtraPayment.Text   = s.AmountSatisfiedByExtraPayment.ToString();
                PastDue.Text        = s.PastDueAmount.ToString();
                CurrentAmount.Text  = s.CurrentAmountDue.ToString();
                due.Text            = s.CurrentStatementDueDate;
            }

            else
            {
                M1.Text             = "";
                M2.Text             = "0";
                M3.Text             = "N/A";
                curBal.Text         = "0.0";
                Last.Text           = "0.0";
                MonthlyPayment.Text = "0.0";
                ExtraPayment.Text   = "0.0";
                PastDue.Text        = "0.0";
                CurrentAmount.Text  = "0.0";
                due.Text            = "N/A";
            }
        }

        else
        {
            Server.Transfer("login.aspx");
            this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Please login with your user id and password.')", true);
        }
    }
 //public void addToListButton(object sender, EventArgs e)
 //{
 //    Response.Redirect("mystudents.aspx?label1=" + Fname3.Text + "&label2=" + Lname3.Text + "&label3=" + StudentID1.Text + "&label4=" + SchoolName1.Text);
 //}
 protected void addToListButton(object sender, EventArgs e)
 {
     if (Session["studentDetail"] == null)
     {
         List <StudentInfor> studentDetail = new List <StudentInfor>();
         String       FirstName            = Fname3.Text.ToString();
         String       LastName             = Lname3.Text.ToString();
         String       Id      = StudentID1.Text.ToString();
         String       Name    = SchoolName1.Text.ToString();
         String       Email   = "NA";
         StudentInfor student = new StudentInfor();
         student.StudentFirstName = FirstName;
         student.StudentLastName  = LastName;
         student.StudentId        = Id;
         student.SchoolName       = Name;
         student.EmailAddress     = Email;
         studentDetail.Add(student);
         Session["studentDetail"] = studentDetail;
         // Response.Write("<script>alert('hello" + studentDetail[0].StudentFirstName + "')</script>");
         //Response.Write("<script>alert('" + Session["studentDetail"].ToString().Length + "')</script>");
     }
     else
     {
         List <StudentInfor> studentDetail = Session["studentDetail"] as List <StudentInfor>;
         String       FirstName            = Fname3.Text.ToString();
         String       LastName             = Lname3.Text.ToString();
         String       Id      = StudentID1.Text.ToString();
         String       Name    = SchoolName1.Text.ToString();
         String       Email   = "NA";
         StudentInfor student = new StudentInfor();
         student.StudentFirstName = FirstName;
         student.StudentLastName  = LastName;
         student.StudentId        = Id;
         student.SchoolName       = Name;
         student.EmailAddress     = Email;
         studentDetail.Add(student);
         //  Response.Write("<script>alert('hi" + studentDetail[0].StudentFirstName + "')</script>");
         Session["studentDetail"] = studentDetail;
         //Response.Write("<script>alert('" + Session["studentDetail"].ToString().Length + "')</script>");
     }
     Response.Redirect("Mystudents.aspx");
 }
Beispiel #23
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (TextBox1.Text != "")
     {
         if (Session["currentuser"] != null)
         {
             StudentInfor stu     = Session["currentuser"] as StudentInfor;
             string       email   = stu.EmailAddress;
             String       header  = "Acknowledgement";
             String       subject = "We have received your message!";
             String       body    = "Dear valued student,<br/>You are receiving this email because you contacted us with a question and/or a concern.<br/>Our support staff will respond within 48 hours.<br/><br/>Thank you.<br>Aum Education Loan Services";
             if (send_email(email, header, subject, body))
             {
                 ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "alert('Thank you. The email has been sent to the address we have in our file')", true);
             }
         }
     }
     else
     {
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "alert('Please write the message.')", true);
     }
 }
    protected void SubmitButtonClick(object sender, EventArgs e)
    {
        StudentInfor S1 = Session["currentuser"] as StudentInfor;
        // Message Formation
        String msgTo      = Convert.ToString(S1.EmailAddress);
        String msgSubject = "We have received your message!";
        String msgBody    = "Dear Valued Student,<br />You are receiving this email because you contacted us with a question and/or a concern.<br /><br />" +
                            "Our support staff will respond within the next 48 hours.<br /><br />Thank you.<br />Vergil's EduLoans Service Team.";

        // Mail Object Creation
        MailMessage mailObj = new MailMessage();

        mailObj.Body = msgBody;
        mailObj.From = new MailAddress("*****@*****.**");
        mailObj.To.Add(new MailAddress(msgTo));
        mailObj.Subject    = msgSubject;
        mailObj.IsBodyHtml = true;

        // SMTP Handling and sending
        SmtpClient SMTPClient = new System.Net.Mail.SmtpClient();

        SMTPClient.Host = "smtp.gmail.com";
        SMTPClient.Port = 587;
        System.Net.NetworkCredential cred = new System.Net.NetworkCredential();
        cred.UserName          = "******";
        cred.Password          = "******";
        SMTPClient.Credentials = cred;
        SMTPClient.EnableSsl   = true;

        SMTPClient.Send(mailObj);


        string alertMessage = "<script language=\"javascript\" type=\"text/javascript\">";

        alertMessage += "alert('" + "Thank you. An email notification has also been sent to the address we have in our file." + "');";
        alertMessage += "</script>";
        ClientScript.RegisterClientScriptBlock(GetType(), "alertMessage ", alertMessage);
    }
Beispiel #25
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (textarea.Text != "")
        {
            if (Session["currentuser"] != null)
            {
                StudentInfor s       = Session["currentuser"] as StudentInfor;
                String       email   = s.EmailAddress;
                String       header  = "Acknowledgement";
                String       subject = "We have received your message! ";
                String       body    = textarea.Text;
                if (send_email(email, header, subject, body))
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "alert('Thank You.An email notification has also been sent to the address we have in our file')", true);
                }
            }
        }

        else
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "alert('Sorry, we coud not sent an email to specified email address.')", true);
        }
    }
Beispiel #26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     {
         if (Session["currentuser"] != null)
         {
             StudentInfor S1 = Session["currentuser"] as StudentInfor;
             acnum.Text      = "" + Convert.ToString(S1.AccountNumber);
             updatedate.Text = "" + Convert.ToString(S1.LastUpdatedDate);
             acname.Text     = "" + Convert.ToString(S1.FullName);
             cell1.Text      = "" + Convert.ToString(S1.CurrentBalance);
             cell2.Text      = S1.LastUpdatedDate;
             cell3.Text      = "" + Convert.ToString(S1.RegularMonthlyPaymentAmount);
             cell4.Text      = "" + Convert.ToString(S1.AmountSatisfiedByExtraPayment);
             cell5.Text      = "" + Convert.ToString(S1.PastDueAmount);
             cell6.Text      = "" + Convert.ToString(S1.CurrentAmountDue);
             dueDate.Text    = "" + Convert.ToString(S1.CurrentStatementDueDate);
         }
         else
         {
             //Table1.Visible = false;
             updatedate.Visible = false;
             acname.Visible     = false;
             acnum.Visible      = false;
             dueDate.Visible    = false;
             string message = "'Please login to see the Account details.";
             System.Text.StringBuilder sb = new System.Text.StringBuilder();
             sb.Append("<script type = 'text/javascript'>");
             sb.Append("window.onload=function(){");
             sb.Append("alert('");
             sb.Append(message);
             sb.Append("')};");
             sb.Append("</script>");
             ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());
             Response.Redirect("Login.aspx");
         }
     }
 }
    protected void Button1_load(object sender, System.EventArgs e)
    {
        if (String.IsNullOrEmpty(TextBox1.Text))
        {
            string script = "<script type=\"text/javascript\">alert('There is No message to send .Please type the message in the box and click send Message button'); </script>";
            ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script);
        }
        else
        {
            StudentInfor s = Session["thisuser"] as StudentInfor;

            String msgTo      = s.EmailAdress;
            String msgSubject = "We have Received your Message!";
            String msgBody    = "Dear Valued Student <br/>," + "\n" +
                                "You are receiving this email beacause as you contacted us with a question and /Or as concern. <br/>" + "\n" +
                                "Our Support staff will respond within the next 48 hours.<br/>" + "\n" +
                                "Thank you.<br/>" + "\n" +
                                "Sun Educational Loan Service Team<br/>";
            MailMessage mailObj = new MailMessage();
            mailObj.Body = msgBody;
            mailObj.From = new MailAddress("*****@*****.**", "Suncare Educatinal Loan Services");
            mailObj.To.Add(new MailAddress(msgTo));
            mailObj.Subject    = msgSubject;
            mailObj.IsBodyHtml = true;
            SmtpClient SMTPClient = new System.Net.Mail.SmtpClient();
            SMTPClient.Host        = "smtp.gmail.com";
            SMTPClient.Port        = 587;
            SMTPClient.Credentials = new NetworkCredential("*****@*****.**", "wad2016fall");
            SMTPClient.EnableSsl   = true;
            try { SMTPClient.Send(mailObj); }
            catch (Exception ex)
            { Label1.Text = ex.ToString(); }
            string script = "<script type=\"text/javascript\">alert('Thank you an email notification has also been sent to the address we have in our file'); </script>";
            ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script);
        }
    }
Beispiel #28
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (CheckBox1.Checked == true)
        {
            //Covert the month to number

            string month_name = month1.SelectedItem.Text;

            int month_number = DateTime.ParseExact(month_name, "MMMM", CultureInfo.CurrentCulture).Month;

            //null values

            //amount
            int   number_defalut_int = 1;
            float number_default     = (float)number_defalut_int;

            //date
            string date_default = "1/1/1950";

            //copying stuff into the object

            StudentInfor student = new StudentInfor();

            student.userName             = TextBox5.Text;
            student.password             = TextBox6.Text;
            student.certifiedchecked     = CheckBox1.Checked;
            student.socialSecurityNumber = TextBox1.Text;
            student.fullName             = TextBox2.Text;
            student.address                       = TextBox4.Text;
            student.emailAddress                  = TextBox8.Text;
            student.securityQuestion              = securityquestions.SelectedItem.Text;
            student.securityQuestionAnswer        = TextBox10.Text;
            student.dateOfBirth                   = month_number + "/" + date1.SelectedItem.Text + "/" + year1.SelectedItem.Text;
            student.lastUpdatedDate               = date_default;
            student.currentBalance                = number_default;
            student.regularMonthlyPaymentAmount   = number_default;
            student.amountSatisfiedByExtraPayment = number_default;
            student.currentAmountDue              = number_default;
            student.currentStatementDueDate       = date_default;

            Random rnd = new Random();
            student.accountNumber = rnd.Next(100000, 999999);

            //Putting data into database
            try
            {
                SqlConnection con = new SqlConnection("Data Source = dcm.uhcl.edu; Initial Catalog = c432016fa02kasichainulak; Persist Security Info = True; User ID = kasichainulak; Password = 1456090");
                con.Open();
                SqlCommand cmd = new SqlCommand("INSERT INTO kasichainulak_WADfl16_studentinfor (socialSecurityNumber,userName,password,certifiedchecked,fullName,dateOfBirth,address,emailAddress,securityQuestion,securityQuestionAnswer,accountNumber,lastUpdatedDate,regularMonthlyPaymentAmount,amountSatisfiedByExtraPayment,pastDueAmount,currentAmountDue,currentStatementDueDate) VALUES (@socialSecurityNumber,@userName,@password,@certifiedchecked,@fullName,@dateOfBirth,@address,@emailAddress,@securityQuestion,@securityQuestionAnswer,@accountNumber,@lastUpdatedDate,@regularMonthlyPaymentAmount,@amountSatisfiedByExtraPayment,@pastDueAmount,@currentAmountDue,@currentStatementDueDate)", con);

                cmd.Parameters.AddWithValue("@socialSecurityNumber", student.socialSecurityNumber);
                cmd.Parameters.AddWithValue("@userName", student.userName);
                cmd.Parameters.AddWithValue("@password", student.password);
                cmd.Parameters.AddWithValue("@certifiedchecked", student.certifiedchecked);
                cmd.Parameters.AddWithValue("@fullName", student.fullName);
                cmd.Parameters.AddWithValue("@dateOfBirth", student.dateOfBirth);
                cmd.Parameters.AddWithValue("@address", student.address);
                cmd.Parameters.AddWithValue("@emailAddress", student.emailAddress);
                cmd.Parameters.AddWithValue("@securityQuestion", student.securityQuestion);
                cmd.Parameters.AddWithValue("@securityQuestionAnswer", student.securityQuestionAnswer);
                cmd.Parameters.AddWithValue("@accountNumber", student.accountNumber);
                cmd.Parameters.AddWithValue("@lastUpdatedDate", student.lastUpdatedDate);
                cmd.Parameters.AddWithValue("@currentBalance", student.currentBalance);
                cmd.Parameters.AddWithValue("@regularMonthlyPaymentAmount", student.regularMonthlyPaymentAmount);
                cmd.Parameters.AddWithValue("@amountSatisfiedByExtraPayment", student.amountSatisfiedByExtraPayment);
                cmd.Parameters.AddWithValue("@pastDueAmount", student.pastDueAmount);
                cmd.Parameters.AddWithValue("@currentAmountDue", student.currentAmountDue);
                cmd.Parameters.AddWithValue("@currentStatementDueDate", student.currentStatementDueDate);


                cmd.ExecuteNonQuery();

                //Close the database connection
                con.Close();

                List <StudentInfor> allUsersList = Application["AllUsersList"] as List <StudentInfor>;
                Application["AllUsersList"] = allUsersList as List <StudentInfor>;
                allUsersList.Add(student);

                //Email code:
                /* Body of the email is:*/
                string body_part1 = "Dear" + "" + "<mark>" + student.userName.ToString() + ",</mark>";
                string body_part2 = "<br /> Thank you for registering with us. ";
                string body_part3 = "You can now access your loan account at <a href=\"http://dcm.uhcl.edu/c432016fa02kasichainulak/login.aspx\">login</a>";
                string body_part4 = "<br /><br />In the meantime, please share the word about <mark>K.K Student Loan</mark> with your friends and neighbours!.<mark>K.K Student Loan</mark> is open to all eligible college applications thoughout the United States";
                string body_part5 = "<br />Thank you again for your registration.If you have any questions, please contact us at <a href=\"http://dcm.uhcl.edu/c432016fa02kasichainulak/ContactUs.aspx\">here</a>";
                string body_part6 = "<br /><br />With Best Wishes,";
                string body_part7 = "<br /><mark>K.K Student Loan</mark>";
                string body       = body_part1 + body_part2 + body_part3 + body_part4 + body_part5 + body_part6 + body_part7;
                using (MailMessage mail = new MailMessage(ConfigurationManager.AppSettings["SMTPuser"], TextBox8.Text))
                {
                    mail.Subject    = "New Registration Notification";
                    mail.Body       = body;
                    mail.IsBodyHtml = true;
                    SmtpClient smtp = new SmtpClient();
                    smtp.Host      = ConfigurationManager.AppSettings["Host"];
                    smtp.EnableSsl = Convert.ToBoolean(ConfigurationManager.AppSettings["EnableSSL"]);;
                    NetworkCredential NetworkCred = new NetworkCredential(ConfigurationManager.AppSettings["SMTPuser"], ConfigurationManager.AppSettings["SMTPpassword"]);
                    smtp.UseDefaultCredentials = true;
                    smtp.Credentials           = NetworkCred;
                    smtp.Port = int.Parse(ConfigurationManager.AppSettings["Port"]);;
                    smtp.Send(mail);
                }



                //Alert Box creation
                string script = "alert('Thank you for submitting for registration. You can now login by clicking the Login link at the top right hand side of this page.');";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script, true);
            }
            catch (Exception ex)
            {
                string str2;
                str2 = "Error --> " + ex.Message;
                string str3 = "Sorry! Some error occured during registration!";

                Response.Write("<script language=javascript>alert('" + str3 + "ERROR:" + str2 + "');</script>");
            }
        }

        else
        {
            string script1 = "alert('You have not checked the check box. Please check it');";
            ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script1, true);
        }
    }
    protected void btnsubmit1_Click(object sender, EventArgs e)
    {
        //string message = "Thank you for submitting for registration.You can now \"login\" by clicking the Login link at the top right hand side of this page.";
        string dob    = DropDownList1.SelectedValue + DropDownList2.SelectedValue + DropDownList3.SelectedValue;
        Random random = new Random();
        float  aNum   = 0f;
        int    randomaccountnumber = Convert.ToInt32((random.Next(100000, 1000000).ToString("D6")));
        string validatessn         = txtssn.Text;
        int    flag = 0;

        if (Application["AllUsersList"] != null)
        {
            List <StudentInfor> allUsersList = Application["AllUsersList"] as List <StudentInfor>;
            if (allUsersList != null)
            {
                for (int i = 0; i < allUsersList.Count; i++)
                {
                    if (allUsersList[i].SocialSecurityNumber == validatessn)
                    {
                        string message = ": already exist. Please go to login page.";
                        System.Text.StringBuilder sb = new System.Text.StringBuilder();
                        sb.Append("<script type = 'text/javascript'>");
                        sb.Append("window.onload=function(){");
                        sb.Append("alert('");
                        sb.Append(validatessn);
                        sb.Append(message);
                        sb.Append("')};");
                        sb.Append("</script>");
                        ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());
                        flag = 1;
                    }
                }

                if (CheckBox1.Checked == true && flag != 1)
                {
                    string       chech         = "true";
                    StudentInfor aStudentInfor = new StudentInfor(txtusername.Text, txtpassword.Text, chech, txtssn.Text, txtfullname.Text, dob, txtaddress.Text, txtemail.Text, DropDownList4.SelectedValue, TextBox3.Text, randomaccountnumber, "", aNum, aNum, aNum, aNum, aNum, "");
                    aStudentInfor.AccountNumber = randomaccountnumber;
                    aStudentInfor.Address       = txtaddress.Text;
                    aStudentInfor.AmountSatisfiedByExtraPayment = 0f;
                    aStudentInfor.Certifiedchecked        = chech;
                    aStudentInfor.CurrentAmountDue        = 0f;
                    aStudentInfor.CurrentBalance          = 0f;
                    aStudentInfor.CurrentStatementDueDate = "NA";
                    aStudentInfor.DateOfBirth             = dob;
                    aStudentInfor.EmailAddress            = txtemail.Text;
                    aStudentInfor.FullName        = txtfullname.Text;
                    aStudentInfor.LastUpdatedDate = "NA";
                    aStudentInfor.Password        = txtpassword.Text;
                    aStudentInfor.PastDueAmount   = 0f;

                    aStudentInfor.RegularMonthlyPaymentAmount = 0f;
                    aStudentInfor.SecurityQuestion            = DropDownList4.SelectedValue;
                    aStudentInfor.SecurityQuestionAnswer      = TextBox3.Text;
                    aStudentInfor.SocialSecurityNumber        = txtssn.Text;
                    aStudentInfor.UserName = txtusername.Text;
                    allUsersList.Add(aStudentInfor);
                    Application["AllUsersList"] = allUsersList;
                    // Session["currentuser"] = aStudentInfor;
                    Response.Write("<script>alert('Thank you for submitting for registration. You can now login by clicking the \"Login\" link at the top right hand side of this page. An email notification has also been sent to the email address you provided during registration. ')</script>");

                    //add data to database
                    String        connectionString = ConfigurationManager.ConnectionStrings["connString"].ConnectionString;
                    SqlConnection conn             = new SqlConnection(connectionString);

                    String insToDelv = "Insert into VaghasiaA_WADfl16_StudentInfor(userName,password,certifiedchecked,socialSecurityNumber,fullName,dateOfBirth,address,emailAddress,securityQuestion,securityQuestionAnswer,accountNumber) " + "values('" + txtfullname.Text + "','" + txtpassword.Text + "','true','" + txtssn.Text + "','" + txtusername.Text + "','" + dob + "','" + txtaddress.Text + "','" + DropDownList4.SelectedValue + "','" + TextBox3.Text + "'," + randomaccountnumber + ")";
                    String sql1      = "Insert into tp(name,account) " + "values('" + txtfullname.Text + "','" + randomaccountnumber + "')";
                    string Squestion = DropDownList4.SelectedValue;
                    string checked1  = "true";

                    String sql2 = "Insert into VaghasiaA_WADfl16_StudentInfor(userName,password,certifiedchecked,socialSecurityNumber,fullName,dateOfBirth,address,emailAddress,securityQuestion,securityQuestionAnswer,accountNumber) " + "values('" + txtusername.Text + "','" + txtpassword.Text + "','" + checked1 + "','" + txtssn.Text + "','" + txtfullname.Text + "','" + dob + "','" + txtaddress.Text + "','" + txtemail.Text + "','" + txtssn.Text + "','" + TextBox3.Text + "'," + randomaccountnumber + ")";
                    //  String sql2 = "Insert into VaghasiaA_WADfl16_StudentInfor(userName,password,certifiedchecked,socialSecurityNumber,fullName,dateOfBirth,address,emailAddress,securityQuestion,securityQuestionAnswer,accountNumber) " + "values('" + txtusername.Text + "','" + txtpassword.Text + "','" + checked1 + "','" + txtssn.Text + "','" + txtfullname.Text + "','" + dob + "','" + txtaddress.Text + "','" + txtemail.Text + "','" + txtssn.Text + "','" + TextBox3.Text + "'," + randomaccountnumber + ")";

                    SqlCommand cmd = new SqlCommand(sql2, conn);
                    //  SqlCommand cmd1 = new SqlCommand(sql1, conn);

                    try
                    {
                        conn.Open();
                        cmd.BeginExecuteNonQuery();
                        //  cmd1.BeginExecuteNonQuery();

//Response.Write("<script>alert('Seems like')</script>");
                    }
                    finally
                    {
                        conn.Close();
                        //  Response.Write("<script>alert('Nada')</script>");
                    }


                    clearall();
                    email();
                }
                else if (CheckBox1.Checked == false)
                {
                    Response.Write("<script>alert('Plaese Accept the Ceritifaction Statement by Checking the box at the Top Left Hand Side')</script>");
                }
            }
        }
    }
    protected void SubmitButtonClick(object sender, EventArgs e)
    {
        // Message Formation
        String       msgTo = EmailAddress.Text;
        StudentInfor S1    = null;


        if (Application["AllUsersList"] != null)
        {
            List <StudentInfor> allUsersList = Application["AllUsersList"] as List <StudentInfor>;
            if (allUsersList != null)
            {
                for (int i = 0; i < allUsersList.Count; i++)
                {
                    if (allUsersList[i].EmailAddress == msgTo)
                    {
                        // Session["currentuser"] = allUsersList[i];
                        // S1 = Session["currentuser"] as StudentInfor;
                        S1 = allUsersList[i] as StudentInfor;
                    }
                }
            }
        }
        if (S1 != null)
        {
            String msgSubject = "We have recovered your password!";
            String msgBody    = "Dear Valued Student,<br />You are receiving this email because you requested to recover your password.<br /><br />" +
                                "Your current password is: " + S1.PassWord + "<br /><br />Thank you.<br />Vergil's EduLoans Service Team.";

            // Mail Object Creation
            MailMessage mailObj = new MailMessage();
            mailObj.Body = msgBody;
            mailObj.From = new MailAddress("*****@*****.**");
            mailObj.To.Add(new MailAddress(msgTo));
            mailObj.Subject    = msgSubject;
            mailObj.IsBodyHtml = true;

            // SMTP Handling and sending
            SmtpClient SMTPClient = new System.Net.Mail.SmtpClient();
            SMTPClient.Host = "smtp.gmail.com";
            SMTPClient.Port = 587;
            System.Net.NetworkCredential cred = new System.Net.NetworkCredential();
            cred.UserName          = "******";
            cred.Password          = "******";
            SMTPClient.Credentials = cred;
            SMTPClient.EnableSsl   = true;


            SMTPClient.Send(mailObj);


            string alertMessage = "<script language=\"javascript\" type=\"text/javascript\">";
            alertMessage += "alert('" + "Thank you. An email has been sent to the address you provided." + "');";
            alertMessage += "</script>";
            ClientScript.RegisterClientScriptBlock(GetType(), "alertMessage ", alertMessage);
        }
        else
        {
            string alertMessage = "<script language=\"javascript\" type=\"text/javascript\">";
            alertMessage += "alert('" + "Sorry, that email does not exist in our database. Please recheck the email address you entered." + "');";
            alertMessage += "</script>";
            ClientScript.RegisterClientScriptBlock(GetType(), "alertMessage ", alertMessage);
        }
    }