/// <summary> /// Submetted Feedback message /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button1_Click(object sender, EventArgs e) { try { HttpCookie cookie = new HttpCookie("rowenref"); sitename Sitnme = db.sitenames.First(); SmtpClient client = new SmtpClient("smtp.live.com", 587); client.EnableSsl = true; client.Timeout = 10000; client.DeliveryMethod = SmtpDeliveryMethod.Network; client.UseDefaultCredentials = false; client.Credentials = new NetworkCredential("*****@*****.**", "123gonzales"); MailMessage msg = new MailMessage(); msg.To.Add("*****@*****.**"); msg.From = new MailAddress("*****@*****.**"); msg.Subject = "Online Information"; msg.Body = "From " + txtname.Text + " Using " + Sitnme.title.ToString() + " Message: " + txtbody.Text + " " + txtemail.Text; client.Send(msg); lblmsgbox.Text = "<span class='promtedinformation'>Your Messaged has Successfully sent</span>"; Page.Title = string.Format(Sitnme.title.ToString()); txtname.Text = ""; txtemail.Text = ""; txtbody.Text = ""; } catch (Exception ex) { lblmsgbox.Text = "<span class='promtedinformation'>Your Messaged has Successfully sent</span>"; sitename Sitnme = db.sitenames.First(); Page.Title = string.Format(Sitnme.title.ToString()); } }
protected void Button1_Click(object sender, EventArgs e) { //check to make sure a file is selected if (FileUpload1.HasFile) { try { string filename = Path.GetFileName(FileUpload1.FileName); FileUpload1.SaveAs(Server.MapPath("../images/banner/") + filename); db.homebanners.InsertOnSubmit(new homebanner { filename = FileUpload1.FileName, description = TextBox1.Text, status = 1 }); db.SubmitChanges(); GridView1.DataBind(); } catch (Exception ex) { Label1.Text = "Error " + ex.ToString(); } } sitename Sitnme = db.sitenames.First(); Page.Title = string.Format(Sitnme.title.ToString()) + " Banner"; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { sitename Sitnme = db.sitenames.First(); Page.Title = string.Format(Sitnme.title.ToString()) + " Banner"; } }
protected void Button1_Click(object sender, EventArgs e) { MultiView1.ActiveViewIndex = 1; HttpCookie cookie = Request.Cookies["rowenref"];//declaration of cookie user Usr = db.users.First(u => u.username == cookie["username"]); Label2.Text = "Do you want Deactivate your account?"; sitename Sitnme = db.sitenames.First(); Page.Title = string.Format(Sitnme.title.ToString()); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string reg = Request.QueryString["pg"].ToString(); switch (reg) { case "login": MultiView1.ActiveViewIndex = 0; break; case "errorlog": string error = Request.QueryString["error"].ToString(); MultiView1.ActiveViewIndex = 0; promt.Text = "<div class='error'>" + encryptype.psDescrypt(error) + "</div><br/>"; break; case "reguser": MultiView1.ActiveViewIndex = 1; break; case "K/nGKCEBhtE=": MultiView1.ActiveViewIndex = 0; string nwuser = Request.QueryString["usersave"].ToString(); user Usr = db.users.First(u => u.username == nwuser); txtuser.Text = Usr.username; break; } sitename Sitnme = db.sitenames.First(); Page.Title = string.Format(Sitnme.title.ToString()); menu Mne = db.menus.First(use => use.menu_name == "home"); lbl_sitename.Text = "<a style='font-size:20px;' class='TextLightI WatermarkedInputContainer' href='" + Mne.alias + "'>" + Sitnme.title.ToString() + "</a>"; //call sitename lbltitle2.Text = "<a style='font-size:20px;' class='TextLightI WatermarkedInputContainer' href='" + Mne.alias + "'>" + Sitnme.title.ToString() + "</a>"; //call sitename //var sption = from s in db.soptions // where s.disc == "gender" // select s.name; //if (sption != null) //{ // drpgender.DataSource = sption.Distinct().ToList(); // drpgender.DataBind(); //} } catch (Exception ex) { } } }
protected void btnlogin_Click(object sender, EventArgs e) { //logins(); try { if (chkRememberMe.Checked) { logins(); } else { if (db.f_login(txtuser.Text, encryptype.psEncrypt(txtpass.Text)) == true) { setcookie(); } else { promt.Text = "<div class='error'>Invalide Username!!!</div>"; } if (db.f_passwordExist(encryptype.psEncrypt(txtpass.Text)) == true) { setcookie(); Response.Cookies["username"].Expires = DateTime.Now.AddDays(-1); Response.Cookies["userpassword"].Expires = DateTime.Now.AddDays(-1); } else { promt.Text = "<div class='error'>Incorect Password</div>"; } } sitename Sitnme = db.sitenames.First(); Page.Title = string.Format(Sitnme.title.ToString()); } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { HttpCookie cookie = new HttpCookie("rowenref"); try { category(); string frm = Request.QueryString["qZcZSFkBxBw"].ToString(); switch (frm) { case "iQkJHCUtPcA=": MultiView1.ActiveViewIndex = 0; MultiView2.ActiveViewIndex = 0; lblslct_title.Text = "Gallery"; lblsitemap.Text = " <ol class='breadcrumb'><li><a href='home.aspx'>Home</a></li><li class='active'>Gallery</li></ol>"; Panelsidebar.Visible = false; viewgallery(); break; //selected gallery case "Fa7v03FdlaUM7Tb4YLoWLg=": string id = Request.QueryString["3FE8tKkfmgY"].ToString(); tbl_gallery gall = db.tbl_galleries.First(use => use.gallery_id == Convert.ToInt16(id)); MultiView1.ActiveViewIndex = 0; MultiView2.ActiveViewIndex = 1; lblslct_title.Text = "Gallery"; Label1.Text = "<a target='_blank' href='../images/goreginal/" + gall.filename + "'><img class='img-responsive' src='../images/gthumbs/" + gall.filename + "'</a>"; lblsitemap.Text = "<ol class='breadcrumb'><li><a href='home.aspx'>Home</a></li><li><a href='request.aspx?qZcZSFkBxBw=iQkJHCUtPcA='>Gallery</a></li><li class='active'>" + gall.title + "</li></ol>"; lblselectedgallery.Text = id.ToString(); var galleryselected = from pst in db.gallerylists where pst.gallery_id == Convert.ToInt16(id) orderby pst.gallery_id ascending select pst; listgalleryslcted.DataSource = galleryselected; listgalleryslcted.DataBind(); Panelsidebar.Visible = false; break; case "ZFyBy4NRXDY=": MultiView1.ActiveViewIndex = 1; lblslct_title.Text = "Contact"; lblsitemap.Text = " <ol class='breadcrumb'><li><a href='home.aspx'>Home</a></li><li class='active'>Contact</li></ol>"; user User = db.users.First(use => use.id == Convert.ToInt16(cookie["userid"])); break; case "6V8tKqNxDZg=": MultiView1.ActiveViewIndex = 2; lblslct_title.Text = "FAQ"; smltooltip.Text = "<small>Frequently Asked Questions</small>"; lblsitemap.Text = " <ol class='breadcrumb'><li><a href='home.aspx'>Home</a></li><li class='active'>FAQ</li></ol>"; Panelsidebar.Visible = false; sitename Stename = db.sitenames.First(); lblfaq.Text = Stename.faq.ToString(); break; case "Fcl56ePHIPM=": MultiView1.ActiveViewIndex = 3; lblslct_title.Text = "Account"; lblsitemap.Text = " <ol class='breadcrumb'><li><a href='home.aspx'>Home</a></li><li class='active'>Account</li></ol>"; break; case "M/P0MxbAsE8=": MultiView1.ActiveViewIndex = 4; cookie.Expires = DateTime.Now.AddDays(-1); Response.Cookies.Add(cookie); Response.Redirect("home.aspx"); break; case "qIV2NKe/Bco=": MultiView1.ActiveViewIndex = 5; lblslct_title.Text = "About us"; lblsitemap.Text = " <ol class='breadcrumb'><li><a href='home.aspx'>Home</a></li><li class='active'>About us</li></ol>"; Panelsidebar.Visible = false; sitename Stname = db.sitenames.First(p => p.id == 1); lblaboutus.Text = Stname.about.ToString(); break; case "psQKgMQTuHo=": MultiView1.ActiveViewIndex = 5; string otherpage = Request.QueryString["D/OTj7WyY5Y"].ToString(); otherpage other = db.otherpages.First(use => use.Pagetitle == otherpage); lblslct_title.Text = other.Pagetitle; lblsitemap.Text = " <ol class='breadcrumb'><li><a href='home.aspx'>Home</a></li><li class='active'>dfsf</li></ol>"; lblaboutus.Text = other.body; Panelsidebar.Visible = false; break; } } catch (Exception ex) { } }
public void set() { carousel(); //site name sitename Sitnme = db.sitenames.First(); lbl_sitename.Text = Sitnme.title.ToString();//call sitename lblfootertitle.Text = Sitnme.title.ToString(); Page.Title = string.Format(Sitnme.title.ToString()); HttpCookie cookie = Request.Cookies["rowenref"];// declaration cookie if (cookie == null)//if cookie null { int ID = 4; soption options = db.soptions.First(use => use.id == ID);//call soption db var mnu = from p in db.menus where p.menu_type == ID orderby p.menu_id ascending select p; ListView1.DataSource = mnu; ListView1.DataBind(); var mnuvisible = from p in db.menus where p.status == 15 orderby p.menu_id ascending select p; ListView1.DataSource = mnuvisible; ListView1.DataBind(); lnklogin.Visible = true; lblSignUp.Visible = true; } else { //Image1.Visible = true; cookie.Expires = DateTime.Now.AddMinutes(30); Response.Cookies.Add(cookie); user User = db.users.First(aa => aa.id == Convert.ToInt16(cookie["userid"])); lbluser.Text = "<li class='dropdown'><a href='#' class='dropdown-toggle' data-toggle='dropdown'>" + "Hi " + User.username + "<b class='caret'></b></a>" + "<ul class='dropdown-menu'>" + "<li><a href='account.aspx'>My Account</a></li>" + "<li><a href='logout.aspx'>Logout</a></li>" + "</ul></li>"; // Image1.ImageUrl = ("../profilepic/thumb/" + cookie["profilepic"]); // lnk_logout.Visible = true; lnklogin.Visible = false; lblSignUp.Visible = false; // lnkregister.Visible = false; //acount type "guest" if (cookie["usertype"] == "4") { var mnuvisible = from p in db.menus where p.status == 15 orderby p.menu_id ascending select p; ListView1.DataSource = mnuvisible; ListView1.DataBind(); } //acount type "admin" else if (cookie["perms"] == "3") { var mnuvisible = from p in db.menus where p.status == 15 orderby p.menu_id ascending select p; ListView1.DataSource = mnuvisible; ListView1.DataBind(); lbladmin.Visible = true; soption optiontab = db.soptions.First(use => use.id == 3); lbladmin.Text = "<li><a href='admin.aspx'>" + optiontab.name + "</a></li>"; } else if (cookie["perms"] == "5") { var mnuvisible = from p in db.menus where p.status == 15 orderby p.menu_id ascending select p; ListView1.DataSource = mnuvisible; ListView1.DataBind(); lbladmin.Visible = true; soption optiontab = db.soptions.First(use => use.id == 5); lbladmin.Text = "<li><a href='admin.aspx'>" + optiontab.name + "</a></li>"; } } }
protected void btnreg_Click(object sender, EventArgs e) { try { if (db.f_usernameExist(txtusername.Text) == true) { promted2.Text = "<div class='error'>Username is Already Exist</div>"; } else if (db.f_emailExist(txtemailuser.Text) == true) { promted2.Text = "<div class='error'>Email is Already Exist</div>"; } else if (txtimgcode.Text == "") { promted2.Text = "<div class='error'>Please enter Security Code</div>"; } else if (this.txtimgcode.Text == this.Session["CaptchaImageText"].ToString()) { //string sub = string.Empty, imagePath = string.Empty, imgFilename = string.Empty; //// Check that there is a file //if (fileuserimage.PostedFile != null) //{ // //Path to store uploaded files on server - make sure your paths are unique // string Id = Request.QueryString["id"]; // string filePath = "../profilepic/oreginal/" + txtusername.Text + ".jpg"; // string thumbPath = "../profilepic/thumb/" + txtusername.Text + ".jpg"; // // Check file size (mustn’t be 0) // HttpPostedFile myFile = fileuserimage.PostedFile; // int nFileLen = myFile.ContentLength; // if ((nFileLen > 0) && (System.IO.Path.GetExtension(myFile.FileName).ToLower() == ".jpg")) // { // // Read file into a data stream // byte[] myData = new Byte[nFileLen]; // myFile.InputStream.Read(myData, 0, nFileLen); // myFile.InputStream.Dispose(); // // Save the stream to disk as temporary file. make sure the path is unique! // System.IO.FileStream newFile = new System.IO.FileStream(Server.MapPath(filePath + "_temp.jpg"), // System.IO.FileMode.Create); // newFile.Write(myData, 0, myData.Length); // // run ALL the image optimisations you want here..... make sure your paths are unique // // you can use these booleans later if you need the results for your own labels or so. // // dont call the function after the file has been closed. // bool success = ResizeImageAndUpload(newFile, thumbPath, 300, 300); // success = ResizeImageAndUpload(newFile, filePath, 1200, 900); // // tidy up and delete the temp file. // newFile.Close(); // System.IO.File.Delete(Server.MapPath(filePath + "_temp.jpg")); // } // imgFilename = Path.GetFileName(thumbPath); //} //if (fileuserimage.PostedFile == null) //{ /*Here you Write Code To Insert User details*/ db.sp_APPEND_tbl_user(txtusername.Text, encryptype.psEncrypt(txtpass2.Text), null, null, txtemailuser.Text, Convert.ToInt16(3), null, Convert.ToInt16(5), null, null, "default.png"); Response.Redirect("req.aspx?pg=K/nGKCEBhtE=&usersave=" + txtusername.Text); txtuser.Text = txtusername.Text; //} //else //{ /*Here you Write Code To Insert User details*/ //db.sp_APPEND_tbl_user(txtusername.Text, encryptype.psEncrypt(txtpass2.Text), txtfname.Text, txtlname.Text, txtemailuser.Text, Convert.ToInt16(4), drpgender.Text, Convert.ToInt16(4), txtmname.Text, txtaddress.Text, imgFilename); //Response.Redirect("req.aspx?pg=K/nGKCEBhtE=&usersave=" + txtusername.Text); //txtuser.Text = txtusername.Text; // } //} //else //{ // promted2.Text = "<div class='error'>Security Code not Match</div>"; //} } sitename Sitnme = db.sitenames.First(); Page.Title = string.Format(Sitnme.title.ToString()); } catch (Exception ex) { } }