protected void Button1_Click(object sender, EventArgs e) { InsertRequestDAO insertRequestDao = new InsertRequestDAO(); string Name = NameText.Text; string Contact = ContactText.Text; string BloodRequest = BRDropDown.Text; string Amount = AmountText.Text; string Location = LocationText.Text; string Email = EmailText.Text; string Password = PasswordText.Text; //image insert in a folder and database //int length = BRImageUpload.PostedFile.ContentLength; //byte[] pic = new byte[length]; //BRImageUpload.PostedFile.InputStream.Read(pic, 0, length); string image = InsertImage(); insertRequestDao.InsertRequest(new InsertRequestDTO(Name, Contact, BloodRequest, Amount, Location, Email, Password, image)); Response.Write("Your Registration is Successful"); Response.Redirect("Request_Pages/BloodRequestList.aspx"); }
protected void LoginButton_Click(object sender, EventArgs e) { InsertRequestDAO insertDAO = new InsertRequestDAO(); string LoginEmail = LoginEmailText.Text; string LoginPassword = LoginPassText.Text; int temp = insertDAO.CheckExistingMember(LoginEmail); if (temp == 1) { //user exists string DBPassword = insertDAO.CheckLogin(LoginEmail); if (LoginPassword == DBPassword) { Session["Requester"] = LoginEmail; Response.Redirect("EditRequest.aspx"); } else { Response.Write("Password is incorrect"); } } }
void showStatus() { if (!Page.IsPostBack) { InsertRequestDAO requestDAO = new InsertRequestDAO(); StatusGrid.DataSource = requestDAO.ShowRequestList(Session["Requester"].ToString()); StatusGrid.DataBind(); } }
protected void Button1_Click(object sender, EventArgs e) { InsertRequestDAO insertRequestDao = new InsertRequestDAO(); string RequiredGroup = BRDropDown.Text; string Amount = AmountText.Text; string Location = LocationText.Text; string image = InsertImage(); string Email = Session["Requester"].ToString(); //insertRequestDao.InsertRequest(new InsertRequestDTO(BloodRequest, Amount, Location, Email, image)); RequestStatusDAO rsDAO = new RequestStatusDAO(); rsDAO.InsertNewRequest(new InsertRequestDTO(Email, RequiredGroup, Amount, Location, image)); Response.Write("Your Registration is Successful"); Response.Redirect("EditRequest.aspx"); }
protected void Page_Load(object sender, EventArgs e) { /*if(!Page.IsPostBack) * { * InsertRequestDAO irDAO = new InsertRequestDAO(); * int RID = Convert.ToInt32(RequesterDetails.Rows[0].Cells[1].Text); * * string img = irDAO.GetImageURL(RID); * BRImageDB.ImageUrl = "data:image/png;base64," + img; * TextBox1.Text = "data:image/png;base64," + img; * }*/ InsertRequestDAO irDAO = new InsertRequestDAO(); int RNO = Convert.ToInt32(RequesterDetails.Rows[7].Cells[1].Text); string img = irDAO.GetImageURL(RNO); BRImageDB.ImageUrl = "~/" + img; Panel2.Visible = true; Panel3.Visible = false; }