protected void btnAdd_Click(object sender, EventArgs e)
        {
            DBAcme DB      = (DBAcme)Session["DB"];
            int    numrrow = DB.InsertFeedback(name.Text, email.Text, subject.Text, message.Text);

            lblmessage.Text = "Thank you for your feedback!";
        }
Exemplo n.º 2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            //if(Session["reg"]=="Registered")
            {
                message.Text = "Registerd Successfully!";
            }


            //message.Text = "";
            DBAcme DB = (DBAcme)Session["DB"];

            string user = email.Text;

            Session["User"] = user;
            string  Password = password.Text;
            Boolean flag     = DB.GetUser(user, Password);


            if (flag)
            {
                Session["UserName"] = user;
                //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Alert", "Data has been saved", true);

                if (user.Equals("*****@*****.**") && Password.Equals("123"))
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('Success')</script>");
                    Response.Redirect("~/AdminSite.aspx");
                }
                else
                {
                    Response.Redirect("~/Default.aspx");
                }
            }
            Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('Fail')</script>");
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            DBAcme  DB       = (DBAcme)Session["DB"];
            string  user     = userName.Text;
            string  Password = cryptionData.Encrypt(password.Text);
            string  newPass  = password.Text;
            Boolean flag     = DB.GetUser(user, Password);

            if (flag)
            {
                Session["UserName"] = user;
                //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Alert", "Data has been saved", true);

                if (user.Equals("admin") && newPass.Equals("123"))
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('Success')</script>");
                    Response.Redirect("~/ManageUser.aspx");
                }
                else
                {
                    Response.Redirect("~/default.aspx");
                }
            }
            Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('Fail')</script>");
        }
Exemplo n.º 4
0
        protected void btn_Add(object sender, EventArgs e)
        {
            DBAcme DB = (DBAcme)Session["DB"];


            string publicationName = publicationid.Text;

            int numrow = DB.InsertPublication(publicationName);

            showMessage.Text = "Publication added successfully";
        }
Exemplo n.º 5
0
        protected void CreateUser_Click(object sender, EventArgs e)
        {
            DBAcme DB              = (DBAcme)Session["DB"];
            string StudentID       = studentID.Text;
            string StudentName     = studentname.Text;
            string password        = Password.Text;
            string confirmPassword = ConfirmPassword.Text;
            string email           = Email.Text;
            string phone           = Phone.Text;
            int    numrow          = DB.InsertStudent(StudentID, StudentName, email, password, confirmPassword, phone);

            showMessage.Text = "Student added successfully!";
        }
Exemplo n.º 6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DBAcme DB = (DBAcme)Session["DB"];

            string txtUserName = userName.Text;
            string pass        = cryptData.Encrypt(password.Text);
            string conPassword = cryptData.Encrypt(confirmPassword.Text);
            string mail        = email.Text;
            string Phone       = phone.Text;
            int    numrow      = DB.InsertUser(mail, txtUserName, pass, conPassword, Phone);

            Response.Redirect("/Account/Login");
            Session["reg"] = "Registered";
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            DBAcme DB          = (DBAcme)Session["DB"];
            string name        = fullName.Text;
            string pass        = password.Text;
            string conPassword = confirmPassword.Text;
            string mail        = email.Text;
            string Phone       = phone.Text;
            string studentID   = studentid.Text;
            int    numrow      = DB.InsertStudent(studentID, name, mail, pass, conPassword, Phone);

            Response.Redirect("/Account/Login");
            Session["reg"] = "Registered";
        }
Exemplo n.º 8
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DBAcme DB = (DBAcme)Session["DB"];

            string name        = fullName.Text;
            string pass        = password.Text;
            string conPassword = confirmPassword.Text;
            string mail        = email.Text;
            string Phone       = phone.Text;
            int    Postal      = Convert.ToInt32(postalcode.Text);
            int    numrow      = DB.InsertUser(mail, name, pass, conPassword, Phone, Postal);

            Response.Redirect("/Account/Login");
            Session["reg"] = "Registered";
        }
Exemplo n.º 9
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            DBAcme DB = (DBAcme)Session["DB"];

            string  BookName    = bookName.Text;
            string  BookDetails = bookDetails.Text;
            string  Author      = author.Text;
            string  Publication = Convert.ToString(publication.SelectedValue);
            decimal Price       = Convert.ToDecimal(price.Text);
            int     Quantity    = Convert.ToInt32(qty.Text);
            string  image       = FileUpload1.FileName;

            FileUpload1.PostedFile.SaveAs(Server.MapPath("~/Images/" + image));
            string Image  = "~/Images/" + image.ToString();
            int    numrow = DB.InsertBook(BookName, BookDetails, Author, Publication, Price, Quantity, Quantity, image);

            showMessage.Text = "Book added successfully!";
        }
Exemplo n.º 10
0
        protected void btnSend_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(Server.HtmlEncode(MessageBox.Text)))
            {
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Javascript", "alert('Please! Enter Message'); ", true);
                return;
            }
            if (string.IsNullOrWhiteSpace(Server.HtmlEncode(friendName.Text)))
            {
                Response.Redirect("~/ChatMessage.aspx");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Javascript", "alert('Select Recevier'); ", true);
            }
            DBAcme DB       = (DBAcme)Session["DB"];
            Label  userName = new Label();

            userName.Text = Session["UserName"].ToString();
            string   chatMessage = MessageBox.Text;
            DateTime sendTime    = DateTime.Now;
            int      numrow      = DB.InsertMessage(chatMessage, userName.Text, friendName.Text, sendTime);

            MessageBox.Text = "";
            //Response.Redirect(Request.Url.AbsoluteUri);
        }
Exemplo n.º 11
0
        protected void btn_Add(object sender, EventArgs e)
        {
            DBAcme DB = (DBAcme)Session["DB"];

            string StdID   = stdid.Text;
            string StdName = stdName.Text;
            string Email   = email.Text;
            string Bname   = bookName.Text;
            string Author  = author.Text;
            string dateNow = DateTime.Now.ToString();
            //DateTime borrowDate = DateTime.Parse(dateNow);
            string returnDate = DateTime.Now.AddDays(7).ToString();
            int    numrow     = DB.InsertBorrowBook(StdID, StdName, Email, Bname, Author, dateNow);


            SqlCommand cmd1 = conn.CreateCommand();

            cmd1.CommandText = "update Book set AvailableQty=AvailableQty-1,RentQty=RentQty+1 where BookName='" + bookName.Text + "'";
            conn.Open();
            cmd1.ExecuteNonQuery();
            test1.Text      = "Book borrow Successfully!";
            returnForm.Text = "Retrun Date is " + returnDate;
            conn.Close();
        }
Exemplo n.º 12
0
 void Session_Start(object sender, EventArgs e)
 {
     Session["DB"] = new DBAcme();
 }