protected void Page_Load(object sender, EventArgs e) { try { GetCookie(); if (!IsPostBack) { ViewState["searchText"] = ""; } _bllwebsite = new BllWebsite(); if (Request.QueryString["PageNo"] != null) { _pageNumber = Convert.ToInt32(Request.QueryString["PageNo"]); } if (Request.QueryString["searchterm"] != null) { ViewState["searchText"] = Request.QueryString["searchterm"].ToString(); } Lstdtowebsite = _bllwebsite.GetAllWebsite(_pageNumber, 24, ViewState["searchText"].ToString()); } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
protected void Page_Load(object sender, EventArgs e) { try { IsWebSite(); if (!IsPostBack) { _bllWebsite = new BllWebsite(); var bllPremalink = new BllPremalink(); var lstdto = new List <DtoWebsite> { _bllWebsite.GetUserWebsite(UserId)[0] }; gridwebsite.DataSource = lstdto; gridwebsite.DataBind(); GridView1.DataSource = bllPremalink.GetWebsitePremalink(new DtoPremalink { WebsiteId = lstdto[0].WebsiteId }); GridView1.DataBind(); } } catch (Exception ex) { throw ex; } }
private void IsRegisterUser() { try { _cookie = Request.Cookies["Tagged"]; if (_cookie != null) { if (_cookie["UserID"] != null) { _userId = Convert.ToInt64(UtilityClass.DecryptStringAES(_cookie["UserID"])); } var bllwebsite = new BllWebsite(); var isWebsite = bllwebsite.GetUserWebsite(_userId); if (isWebsite != null) { Response.Redirect("~/WebsiteAdmin/WebsiteGeneralSetting.aspx"); } } else { Response.Redirect("Default.aspx"); } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
public string GetEmotion(string websitename, string premalink) { try { _websiteurl = new Uri(premalink); GetCookie(); _bltag = new BllTag(); _bllemo = new BllEmotions(); _bllwebsite = new BllWebsite(); _lsttag = new List <DtoTag>(); _lstemo = new List <DtoEmotions>(); _dtowebsite = new DtoWebsite(); _lstemo = _bllemo.GetAllEmotion(websitename, premalink, _userId); _dtowebsite = _bllwebsite.GetWebsiteByName(websitename); if (_dtowebsite != null) { ViewState["websiteid"] = _dtowebsite.WebsiteId; ViewState["addEmotion"] = _dtowebsite.AddEmotion; Emotionflag = _dtowebsite.Emotion; if (Emotionflag) { if (Convert.ToBoolean(ViewState["addEmotion"])) { deleteemoanchor.Style.Add("display", "inline"); addemoanchor.Style.Add("display", "inline"); } else { deleteemoanchor.Style.Add("display", "none"); addemoanchor.Style.Add("display", "none"); } } } var emotion = ""; if (_lstemo != null) { foreach (var emo in _lstemo) { emotion += "|" + emo.EmotionName + "," + emo.Emotionid + "," + emo.TotalCount + "," + emo.IsActive; } } return(emotion); } catch (Exception ex) { ex.ToExceptionless().Submit(); } return(null); }
private void BindItemsList() { _bllwebsite = new BllWebsite(); Lstdtowebsite = new List <DtoWebsite>(); if (ViewState["SearchTerm"] == null) { ViewState["SearchTerm"] = ""; } Lstdtowebsite = _bllwebsite.GetAllWebsite(1, 24, ViewState["SearchTerm"].ToString()); }
protected void Page_Load(object sender, EventArgs e) { try { GetCookie(); if (!IsPostBack) { ViewState["websiteId"] = 0; ViewState["UserID"] = 0; _bllwebsite = new BllWebsite(); _blltag = new BllTag(); _bllemotions = new BllEmotions(); if (Request.QueryString["WebsiteId"] != null) { ViewState["websiteId"] = Convert.ToInt64(Request.QueryString["WebsiteId"]); Dtowebsite = _bllwebsite.GetWebsiteById(Convert.ToInt64(ViewState["websiteId"])); Lsttag = _blltag.GetTagByWebsite(Convert.ToInt64(ViewState["websiteId"])); Lstemotions = _bllemotions.GetEmotionByWebsite(Convert.ToInt64(ViewState["websiteId"])); if (Lsttag != null && Lsttag.Count > 0) { foreach (DtoTag t in Lsttag) { Tagstring += t.TagId + ","; } hdntagstring.Value = Tagstring; } if (Lstemotions != null && Lstemotions.Count > 0) { foreach (DtoEmotions E in Lstemotions) { Emostring += E.Emotionid + ","; } hdnemostring.Value = Emostring; } } } else { Response.Redirect("../Default.aspx"); } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
public static IEnumerable SearchWebsite(string PrefixText) { try { BllWebsite bllwebsite = new BllWebsite(); return(bllwebsite.SearchWebsite(PrefixText)); } catch (Exception ex) { ex.ToExceptionless().Submit(); } return(null); }
public string GetTag(string websitename, string premalink) { try { _websiteurl = new Uri(premalink); _bltag = new BllTag(); _bllwebsite = new BllWebsite(); _lsttag = new List <DtoTag>(); _dtowebsite = new DtoWebsite(); _lsttag = _bltag.GetAllTag(websitename, premalink, _userId); _dtowebsite = _bllwebsite.GetWebsiteByName(websitename); if (_dtowebsite != null) { ViewState["websiteid"] = _dtowebsite.WebsiteId; ViewState["addTag"] = _dtowebsite.AddTag; ViewState["rateTag"] = _dtowebsite.RateTag; ViewState["addEmotion"] = _dtowebsite.AddEmotion; if (Convert.ToBoolean(ViewState["addTag"])) { Minusanchor.Style.Add("display", "inline"); addanchor.Style.Add("display", "inline"); } else { Minusanchor.Style.Add("display", "none"); addanchor.Style.Add("display", "none"); } } var tags = ""; if (_lsttag != null) { foreach (var tag in _lsttag) { tags += "|" + tag.TagName + "," + tag.TagId + "," + tag.TagCount + "," + tag.IsActive; } } _metaTagCheck = _lsttag != null && _lsttag[0].MetaTagCheck; return(tags); } catch (Exception ex) { ex.ToExceptionless().Submit(); } return(null); }
protected void btnwebregister_Click(object sender, EventArgs e) { var emailRegex = new Regex(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"); var passwordRegex = new Regex("^([a-zA-Z0-9@*#]{8,15})$"); if (emailRegex.IsMatch(txtwebemail.Text) && passwordRegex.IsMatch(txtwebpassword.Text)) { var dtowebsite = new DtoWebsite { WebsiteLogo = txtwebemail.Text, Image = txtwebpassword.Text, RateTag = false, WebSiteName = txtwebsitename.Text, WebsiteUrl = txtwebsiteurl.Text, WebsiteType = Guid.NewGuid().ToString() }; var bllWebsite = new BllWebsite(); var flag = bllWebsite.RegisterWebsiteAndUser(dtowebsite); if (flag == -1) { lblwebauthentication.Text = "Email Already Exists"; lblwebauthentication.Visible = true; } else { var st = SendVerificationEmail(TxtLEmail.Text, _dtouser.Guid); if (st == false) { lblwebauthentication.Text = "Email Cannot be Sent at this Time."; lblwebauthentication.Visible = true; } else { lblwebauthentication.Text = "Please Verify Your Email"; lblwebauthentication.Visible = true; } } } else { lblwebauthentication.Text = "Incorrect Username Or Password"; lblwebauthentication.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { try { IsWebSite(); if (!IsPostBack) { _bllEmotion = new BLLEmotionGroup(); _bllWebsite = new BllWebsite(); grdtags.DataSource = _bllEmotion.GetRateableEmotion(_bllWebsite.GetUserWebsite(UserId)[0].WebsiteId); grdtags.DataBind(); } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
protected void IsWebSite() { Cookie = Request.Cookies["Tagged"]; if (Cookie != null) { UserId = long.Parse(UtilityClass.DecryptStringAES(Cookie["d"])); var bllwebsite = new BllWebsite(); var isWebsite = bllwebsite.GetUserWebsite(UserId); if (isWebsite == null) { Response.Redirect("~/MainPage.aspx"); } } else { Response.Redirect("~/Default.aspx"); } }
protected void IsUser() { Cookie = Request.Cookies["Tagged"]; if (Cookie != null) { if (Cookie["d"] != null) { UserId = long.Parse(UtilityClass.DecryptStringAES(Cookie["d"])); } var bllwebsite = new BllWebsite(); var isWebsite = bllwebsite.GetUserWebsite(UserId); if (isWebsite != null) { Response.Redirect("~/WebsiteAdmin/WebsiteGeneralSetting.aspx"); } } else { Response.Redirect("Default.aspx"); } }
protected void Button1_Click1(object sender, EventArgs e) { try { _dtowebsite = new DtoWebsite(); _bllwebsite = new BllWebsite(); _dtowebsite.UserId = GetUserId(); _dtowebsite.WebSiteName = TextBox1.Text; _dtowebsite.WebsiteUrl = TextBox2.Text; _dtowebsite.WebsiteId = Convert.ToInt64(ViewState["websiteid"]); _dtowebsite.WebsiteType = dplstwebsitetype.SelectedValue; _dtowebsite.Tag = chktag.Checked; _dtowebsite.Emotion = chkemotion.Checked; if (chktag.Checked) { _dtowebsite.AddTag = chkaddable.Checked; _dtowebsite.RateTag = chkrateable.Checked; } else { chkaddable.Style.Add("display", "none"); chkrateable.Style.Add("display", "none"); } if (chkemotion.Checked) { _dtowebsite.AddEmotion = chkemoaddable.Checked; } else { chkemoaddable.Style.Add("display", "none"); } var isValidFile = false; if (ImgUpload.FileName != "") { string[] validFileTypes = { "bmp" }; var ext = Path.GetExtension(ImgUpload.PostedFile.FileName); for (var i = 0; i < validFileTypes.Length; i++) { if (ext == "." + validFileTypes[i]) { isValidFile = true; _dtowebsite.WebsiteLogo = Guid.NewGuid() + "." + ext; ImgUpload.SaveAs(Server.MapPath("~/Images/WebsiteLogo/") + _dtowebsite.WebsiteLogo); break; } } if (!isValidFile) { lbluplderrmsg.Text = "Invalid File. Please upload a File with extension " + string.Join(",", validFileTypes); } } else { if (imgweblogo.ImageUrl == "") { _dtowebsite.WebsiteLogo = ConvertTextToImage(TextBox1.Text.Substring(0, 1).ToUpper(), "Arial", 30, Color.White, Color.Black, 50, 50); } isValidFile = true; } if (isValidFile) { int flag = Convert.ToInt16(_bllwebsite.UpdateWebsite(_dtowebsite)); switch (flag) { case -1: LblRegisterWebsite.Text = "Website URL Already Exists"; LblRegisterWebsite.Visible = true; break; case -2: LblRegisterWebsite.Text = "WebsiteName Already Exists"; LblRegisterWebsite.Visible = true; break; default: LblRegisterWebsite.Visible = false; Response.Redirect("../User/Setting.aspx"); break; } Response.Redirect("../User/Setting.aspx"); } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
protected void Page_Load(object sender, EventArgs e) { try { IsUser(); if (!IsPostBack) { ViewState["websiteid"] = 0; _bllwebsite = new BllWebsite(); _dtowebsite = new DtoWebsite(); _dtopremalink = new DtoPremalink(); _bllpremalink = new BllPremalink(); TextBox1.Attributes.Add("onblur", "blurfunction('shortnamespan','" + TextBox1.ClientID + "')"); TextBox2.Attributes.Add("onblur", "blurfunction('websitespan','" + TextBox2.ClientID + "')"); TxtSearch.Attributes.Add("onblur", "blurfunction('searchsspan','" + TxtSearch.ClientID + "')"); if (Request.QueryString["WebsiteID"] != null & Convert.ToInt64(Request.QueryString["WebsiteID"]) != 0) { ViewState["websiteid"] = Convert.ToInt64(Request.QueryString["WebsiteID"]); _dtowebsite = _bllwebsite.GetWebsiteById(Convert.ToInt64(ViewState["websiteid"])); TextBox1.Text = _dtowebsite.WebSiteName; TextBox2.Text = _dtowebsite.WebsiteUrl; chktag.Checked = _dtowebsite.Tag; chkemotion.Checked = _dtowebsite.Emotion; chkaddable.Checked = _dtowebsite.AddTag; chkrateable.Checked = _dtowebsite.RateTag; chkemoaddable.Checked = _dtowebsite.AddEmotion; if (!string.IsNullOrEmpty(_dtowebsite.WebsiteLogo)) { imgweblogo.ImageUrl = Server.MapPath("~/Images/WebsiteLogo/") + _dtowebsite.WebsiteLogo; } if (_dtowebsite.WebSiteName != "") { Page.ClientScript.RegisterStartupScript(GetType(), "shortnamespand", "<script type='text/javascript'>document.getElementById('shortnamespan').style.opacity = 0;</script>"); } if (_dtowebsite.WebsiteUrl != "") { Page.ClientScript.RegisterStartupScript(GetType(), "websitespand", "<script type='text/javascript'>document.getElementById('websitespan').style.opacity = 0;</script>"); } txtcode.InnerText = "<div id='taghead'></div><script type ='text/javascript' language='javascript'>" + "var Websitename_shortname = '" + _dtowebsite.WebSiteName + "';</script>" + "<script src='http://www.glozzary.com/Script/NewJScript.js' type='text/javascript'></script>"; BtnDone.Visible = true; BtnRegister.Visible = false; dplstwebsitetype.DataSource = _bllwebsite.GetWebsiteType(); dplstwebsitetype.DataBind(); dplstwebsitetype.SelectedValue = _dtowebsite.WebsiteType; _dtopremalink.WebsiteId = Convert.ToInt64(ViewState["websiteid"]); _dtopremalink.Link = TxtSearch.Text; GridPremalink.DataSource = _bllpremalink.GetWebsitePremalink(_dtopremalink); GridPremalink.DataBind(); } else { BtnRegister.Visible = true; BtnDone.Visible = false; dplstwebsitetype.DataSource = _bllwebsite.GetWebsiteType(); dplstwebsitetype.DataBind(); } } else { if (TextBox1.Text != "") { Page.ClientScript.RegisterStartupScript(GetType(), "shortnamespan", "<script type='text/javascript'>document.getElementById('shortnamespan').style.opacity = 0;</script>"); } if (TextBox2.Text != "") { Page.ClientScript.RegisterStartupScript(GetType(), "websitespans", "<script type='text/javascript'>document.getElementById('websitespan').style.opacity = 0;</script>"); } if (TxtSearch.Text != "") { Page.ClientScript.RegisterStartupScript(GetType(), "searchsspans", "<script type='text/javascript'>document.getElementById('searchsspan').style.opacity = 0;</script>"); } } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
protected void Page_Load(object sender, EventArgs e) { try { IsWebSite(); if (!IsPostBack) { _bllwebsite = new BllWebsite(); _dtowebsite = new DtoWebsite(); _dtopremalink = new DtoPremalink(); if (UserId > 0) { var isWebsite = _bllwebsite.GetUserWebsite(UserId); if (isWebsite != null) { _dtowebsite = isWebsite[0]; ViewState["websiteid"] = _dtowebsite.WebsiteId; TextBox1.Text = _dtowebsite.WebSiteName; TextBox2.Text = _dtowebsite.WebsiteUrl; chktag.Checked = _dtowebsite.Tag; chkemotion.Checked = _dtowebsite.Emotion; chkaddable.Checked = _dtowebsite.AddTag; chkrateable.Checked = _dtowebsite.RateTag; chkemoaddable.Checked = _dtowebsite.AddEmotion; if (!string.IsNullOrEmpty(_dtowebsite.WebsiteLogo)) { imgweblogo.ImageUrl = "../Images/WebsiteLogo/" + _dtowebsite.WebsiteLogo; } if (_dtowebsite.WebSiteName != "") { Page.ClientScript.RegisterStartupScript(GetType(), "shortnamespand", "<script type='text/javascript'>document.getElementById('shortnamespan').style.opacity = 0;</script>"); } if (_dtowebsite.WebsiteUrl != "") { Page.ClientScript.RegisterStartupScript(GetType(), "websitespand", "<script type='text/javascript'>document.getElementById('websitespan').style.opacity = 0;</script>"); } txtcode.InnerText = "<div id='taghead'></div><script type ='text/javascript' language='javascript'>" + "var Websitename_shortname = '" + _dtowebsite.WebSiteName + "';</script>" + "<script src='http://www.glozzary.com/Script/NewJScript.js' type='text/javascript'></script>"; BtnDone.Visible = true; BtnRegister.Visible = false; dplstwebsitetype.DataSource = _bllwebsite.GetWebsiteType(); dplstwebsitetype.DataBind(); dplstwebsitetype.SelectedValue = _dtowebsite.WebsiteType; _dtopremalink.WebsiteId = Convert.ToInt64(_dtowebsite.WebsiteId); } else { Response.Redirect("~/Default.aspx"); } } else { BtnRegister.Visible = true; BtnDone.Visible = false; dplstwebsitetype.DataSource = _bllwebsite.GetWebsiteType(); dplstwebsitetype.DataBind(); } } else { if (TextBox1.Text != "") { Page.ClientScript.RegisterStartupScript(GetType(), "shortnamespan", "<script type='text/javascript'>document.getElementById('shortnamespan').style.opacity = 0;</script>"); } if (TextBox2.Text != "") { Page.ClientScript.RegisterStartupScript(GetType(), "websitespans", "<script type='text/javascript'>document.getElementById('websitespan').style.opacity = 0;</script>"); } // if (TxtSearch.Text != "") // Page.ClientScript.RegisterStartupScript(GetType(), "searchsspans", // "<script type='text/javascript'>document.getElementById('searchsspan').style.opacity = 0;</script>"); } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
protected void Page_Load(object sender, EventArgs e) { try { GetCookie(); _bllwebsite = new BllWebsite(); _blltag = new BllTag(); _bllemotion = new BllEmotions(); Lstdtonewsfeed = new List <DtoNewsFeed>(); string[] items; if (!IsPostBack) { ViewState["UserID"] = 0; } if (Request.QueryString["WebsiteId"] != null) { Websiteid = Convert.ToInt64(Request.QueryString["WebsiteId"]); if (Request.QueryString["TagId"] != null) { string tagarray = Request.QueryString["TagId"]; if (tagarray.Split(',').Length > 0) { items = tagarray.Split(','); for (int i = 0; i < (items.Length - 1); i++) { if (!(Convert.ToInt64(items[i]) > 0)) { TagId = ""; // error SQL injection break; } } TagId = Request.QueryString["TagId"]; } else { TagId = Request.QueryString["TagId"]; } } else { TagId = ""; } if (Request.QueryString["EmoId"] != null) { string emoarray = Request.QueryString["EmoId"]; if (emoarray.Split(',').Length > 0) { items = emoarray.Split(','); for (int i = 0; i < (items.Length - 1); i++) { if (!(Convert.ToInt64(items[i]) > 0)) { EmoId = ""; // error SQL injection break; } } EmoId = Request.QueryString["EmoId"]; } else { EmoId = Request.QueryString["EmoId"]; } } else { EmoId = ""; } if (EmoId.Length > 0) { EmoId = EmoId.Remove(EmoId.Length - 1, 1); } if (TagId.Length > 0) { TagId = TagId.Remove(TagId.Length - 1, 1); } Lstdtonewsfeed = _bllwebsite.GetWebsiteFeed(Convert.ToInt64(ViewState["UserID"]), Websiteid, TagId, EmoId, 1, 10); } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
protected void Page_Load(object sender, EventArgs e) { try { GetCookie(); if (!IsPostBack) { ViewState["tagid"] = 0; _bllwebsite = new BllWebsite(); _blltag = new BllTag(); _blluser = new BllUser(); if (Request.QueryString["PageNo"] != null) { _pageNumber = Convert.ToInt32(Request.QueryString["PageNo"]); } if (Request.QueryString["flow"] == "inlinecode") { if (Request.QueryString["Id"] != null) { ViewState["tagid"] = Convert.ToInt64(Request.QueryString["Id"]); } Lstdtonewsfeed = _blltag.GetTagNewsFeed(_userId, Convert.ToInt64(ViewState["tagid"]), _pageNumber, 40); } else if (Request.QueryString["flow"] == "wall") { Lstdtonewsfeed = _blluser.GetUserNewsFeed(_userId, _pageNumber, 40); } else if (Request.QueryString["flow"] == "profile") { if (Request.QueryString["TagId"] != null && Request.QueryString["EmoId"] != null) { var tagstr = Request.QueryString["TagId"]; var emostr = Request.QueryString["EmoId"]; Lstdtonewsfeed = _blluser.GetUserTagFeed(_userId, tagstr, emostr, _pageNumber, 10); } } else if (Request.QueryString["flow"] == "website") { if (Request.QueryString["TagId"] != null && Request.QueryString["EmoId"] != null && Request.QueryString["WebsiteId"] != null) { var tagstr = Request.QueryString["TagId"]; var emostr = Request.QueryString["EmoId"]; var websiteId = Convert.ToInt64(Request.QueryString["WebsiteId"]); Lstdtonewsfeed = _bllwebsite.GetWebsiteFeed(_userId, websiteId, tagstr, emostr, _pageNumber, 10); } } } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }