protected void btnupdate_Click(object sender, EventArgs e) { SqlParameter[] param = new SqlParameter[5]; param[0] = new SqlParameter("@userid", SqlDbType.Int); param[0].Value = Int32.Parse(lblid.Text); param[1] = new SqlParameter("@name", SqlDbType.VarChar); param[1].Value = lblusername.Text; param[2] = new SqlParameter("@email", SqlDbType.VarChar); param[2].Value = lblemail.Text; param[3] = new SqlParameter("@number", SqlDbType.BigInt); param[3].Value = lblContact.Text; param[4] = new SqlParameter("@city", SqlDbType.VarChar); param[4].Value = lblcity.Text; int result = objdf.ExecuteQuery("usp_updateadminuserdetal", param); if (result > 0) { Response.Write("<script>alert('Update Data SuccessFully')</script>"); } else { Response.Write("<script>alert('Update Not Successfilly!! Try Again')</script>"); } }
public void Count_1() { int count = 0; ds = objdf.FillDsS("select * from RequestMaster where Sender_Id = '" + Session["id"] + "' and Confrim ='" + 0 + "' and _Delete ='" + 0 + "'"); ds2 = objdf.FillDsS("Select Count_1 from Count_Master where Person_Id = '" + Session["id"] + "'"); count = Convert.ToInt32(ds2.Tables[0].Rows[0]["Count_1"].ToString()); if (ds.Tables[0].Rows.Count > count) { count = ds.Tables[0].Rows.Count - count; lblSentRequest.Text = count.ToString(); count = ds.Tables[0].Rows.Count; SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@userid", SqlDbType.Int); param[0].Value = Session["id"]; param[1] = new SqlParameter("@Count_1", SqlDbType.Int); param[1].Value = count; int result = objdf.ExecuteQuery("usp_UpdateCount1", param); if (result > 0) { //Response.Write("<script>alert(' sent Count 1 Updated Successfully')</script>"); } } else { if (ds.Tables[0].Rows.Count < count) { count = ds.Tables[0].Rows.Count; //lblSentRequest.Text = null; SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@userid", SqlDbType.Int); param[0].Value = Session["id"]; param[1] = new SqlParameter("@Count_1", SqlDbType.Int); param[1].Value = count; int result = objdf.ExecuteQuery("usp_UpdateCount1", param); if (result > 0) { //Response.Write("<script>alert('sent Count 2 Updated Successfully')</script>"); } } } }
protected void btnSubmit_Click(object sender, EventArgs e) { SqlParameter[] param = new SqlParameter[1]; if (FileUpload1.HasFile) { if (checkextension(FileUpload1.FileName)) { //string path = Server.MapPath("ProfileImage"); //path = path + "\\" + FileUpload1.FileName; //FileUpload1.SaveAs(path); string filename = Path.GetFileName(FileUpload1.PostedFile.FileName); //string str = filename; string imgPath = "D:/Hitesh Gehlot/Shop data/photos/collage/home frnds/"; string img = Imager.PerformImageResizeAndPutOnCanvas(imgPath, filename, 1000, 1000); param[0] = new SqlParameter("@profileimage", SqlDbType.VarChar); param[0].Value = "~\\ProfileImage\\" + filename; } else { Response.Write("<script>alert('Image Extension Not Valid ')</script>"); } } else { Response.Write("<script>alert('Image Not Found ')</script>"); } int result = objdf.ExecuteQuery("usp_Temp", param); if (result > 0) { Response.Write("<script>alert('Image upload ho gai')</script>"); } //string str = DateTime.Now.ToString("hhmmssffffff") + filename; //fuImage.SaveAs(Server.MapPath("ImgDir/" + str)); }
protected void btnsavedetails_Click(object sender, EventArgs e) { SqlParameter[] param = new SqlParameter[27]; param[0] = new SqlParameter("@username", SqlDbType.VarChar); param[0].Value = lblname.Text; param[1] = new SqlParameter("@useremail", SqlDbType.VarChar); param[1].Value = lblemail.Text; param[2] = new SqlParameter("@userpass", SqlDbType.VarChar); param[2].Value = lblpass.Text; param[3] = new SqlParameter("@dob", SqlDbType.VarChar); param[3].Value = lbldob.Text; param[4] = new SqlParameter("@gender", SqlDbType.Int); param[4].Value = lblgender.Text; param[5] = new SqlParameter("@mothertongue", SqlDbType.Int); param[5].Value = lblmothert.Text; param[6] = new SqlParameter("@religion", SqlDbType.Int); param[6].Value = lblreligion.Text; param[7] = new SqlParameter("@caste", SqlDbType.VarChar); param[7].Value = lblcaste.Text; param[8] = new SqlParameter("@country", SqlDbType.Int); param[8].Value = lblcountry.Text; param[9] = new SqlParameter("@state", SqlDbType.Int); param[9].Value = lblstate.Text; param[10] = new SqlParameter("@city", SqlDbType.Int); param[10].Value = lblcity.Text; param[11] = new SqlParameter("@usernumber", SqlDbType.BigInt); param[11].Value = lblnumber.Text; param[12] = new SqlParameter("@profile", SqlDbType.Int); param[12].Value = lblprofile.Text; param[13] = new SqlParameter("@livingstatus", SqlDbType.Int); param[13].Value = ddlfamily.SelectedValue; param[14] = new SqlParameter("@maritalstatus", SqlDbType.Int); param[14].Value = ddlmaritalstatus.SelectedValue; param[15] = new SqlParameter("@familystatus", SqlDbType.Int); param[15].Value = ddlfamilystatus.SelectedValue; param[16] = new SqlParameter("@height", SqlDbType.Int); param[16].Value = ddlheight.SelectedValue; param[17] = new SqlParameter("@age", SqlDbType.Int); param[17].Value = txtage.Text; param[18] = new SqlParameter("@deit", SqlDbType.Int); param[18].Value = ddldeit.SelectedValue; param[19] = new SqlParameter("@hobbies", SqlDbType.Int); param[19].Value = ddldrinking.SelectedValue; param[20] = new SqlParameter("@physicalstatus", SqlDbType.Int); param[20].Value = ddlphysicalstatus.SelectedValue; param[21] = new SqlParameter("@education", SqlDbType.VarChar); param[21].Value = txteducation.Text; param[22] = new SqlParameter("@employeein", SqlDbType.Int); param[22].Value = ddlemployee.SelectedValue; param[23] = new SqlParameter("@occupation", SqlDbType.VarChar); param[23].Value = txtoccupation.Text; param[24] = new SqlParameter("@income", SqlDbType.BigInt); param[24].Value = txtincome.Text; if (FileUpload1.HasFile) { if (checkextension(FileUpload1.FileName)) { //if (FileUpload1.PostedFile.ContentLength < 1000000) //{ // string path = Server.MapPath("ProfileImage"); // path = path + "\\" + FileUpload1.FileName; // FileUpload1.SaveAs(path); // param[25] = new SqlParameter("@profileimage", SqlDbType.VarChar); // param[25].Value = "~\\ProfileImage\\" + FileUpload1.FileName; //} //else //{ // Response.Write("<script>alert('Image Size Minimum 1MB Only ')</script>"); //} string filename = Path.GetFileName(FileUpload1.PostedFile.FileName); string imgPath = "D:/img/"; string img = Imager.PerformImageResizeAndPutOnCanvas(imgPath, filename, 1500, 1500); param[25] = new SqlParameter("@profileimage", SqlDbType.VarChar); param[25].Value = "~\\ProfileImage\\" + filename; } else { Response.Write("<script>alert('Image Extension Not Valid ')</script>"); } } else { Response.Write("<script>alert('Image Not Found ')</script>"); } param[26] = new SqlParameter("@aboutyourself", SqlDbType.VarChar); param[26].Value = txtabout.Text; int result = objdf.ExecuteQuery("usp_insert_usermaster", param); if (result > 0) { Response.Write("<script>alert('Registeration Successfilly')</script>"); Response.Redirect("emailverify.aspx?eid=" + lblemail.Text); //Response.Redirect("savedetails.aspx"); } else { Response.Write("<script>alert('Registeration Not Successfilly!! Try Again')</script>"); } }