protected void Button1_Click1(object sender, EventArgs e) { string username = Session["USERNAME"].ToString(); Security.UserInfo usrs = new Security.UserInfo(); usrs = usrs.getUserProfileFromEmail(username); NGOs objngo = new NGOs(); objngo.NGOName = txtbrandname.Text; objngo.NGODescription = txtdiscption.InnerText; objngo.Website = txtwebsite.Text; objngo.FacebookPage = facebook.Text; objngo.TwitterPage = Twitter.Text; // objngo.YoutubeChannel = Youtube.Text; // objngo.GooglePlus = GooglePlus.Text; // objngo.Blog = Blog.Text; // objngo.Flicker = Flickr.Text; objngo.Website = txtwebsite.Text; objngo.LINKIND = facebook.Text; // objngo.FourSquareAccount = FoursquareAccount.Text; //objngo.BrandCategoryID = ddlcategory.SelectedValue; //objngo.BrandDescription = txtdiscption.InnerText; objngo.AllowsCommentsOnWebsite = "0"; objngo.USERID = usrs.UserID; string str = objngo.CreateBransh(objngo); }
protected void btnsubmit(object sender, ImageClickEventArgs e) { string username = Session["USERNAME"].ToString(); Security.UserInfo usrs = new Security.UserInfo(); usrs = usrs.getUserProfileFromEmail(username); NGOs objngo = new NGOs(); objngo.NGOName = txtbrandname.Text; objngo.NGODescription = txtdiscption.InnerText; objngo.Website = txtwebsite.Text; objngo.FacebookPage = facebook.Text; objngo.TwitterPage = Twitter.Text; objngo.YoutubeChannel = youtube.Text; objngo.GooglePlus = googleplus.Text; objngo.Blog = blog.Text; objngo.Flicker = flickr.Text; objngo.Website = txtwebsite.Text; objngo.LINKIND = facebook.Text; objngo.FourSquareAccount = foursquareaccount.Text; objngo.NGOCategoryID = ddlcategory.SelectedValue; objngo.NGODescription = txtdiscption.InnerText; objngo.USERID = usrs.UserID; string str = objngo.CreateBransh(objngo); //bank account NGOBank ngobank = new NGOBank(); ngobank.NGOID = "1"; ngobank.Bank = bankname.Text; ngobank.IBAN = iBan.Text; ngobank.SWIFTCode = swiftcode.Text; ngobank.Branch = branchname.Text; ngobank.AccountNB = "123"; string strs = ngobank.CreateNGOBank(ngobank); }
public void listing() { Security.UserInfo usr = new Security.UserInfo(); Table tblusers = new Table(); tblusers.Width = Unit.Percentage(100); tblusers.CellPadding = 1; tblusers.CellSpacing = 1; TableRow tblrow = new TableRow(); TableCell tblcell = new TableCell(); tblrow = new TableRow(); tblrow.Style.Add("background-color", "#EDE9D3"); tblcell = new TableCell(); tblrow.HorizontalAlign = HorizontalAlign.Center; tblcell.Text = "Image"; tblcell.CssClass = "Headerlbl"; // Allcell.Style(" tblrow.Cells.Add(tblcell); tblcell = new TableCell(); tblcell.Text = "First name"; tblcell.CssClass = "Headerlbl"; tblrow.Cells.Add(tblcell); tblcell = new TableCell(); tblcell.Text = "Last name"; tblcell.CssClass = "Headerlbl"; tblrow.Cells.Add(tblcell); // Allrow.Style.Add(" tblcell = new TableCell(); tblcell.Text = "User Email"; tblcell.CssClass = "Headerlbl"; tblrow.Cells.Add(tblcell); tblcell = new TableCell(); tblcell.Text = "User Role"; tblcell.CssClass = "Headerlbl"; tblrow.Cells.Add(tblcell); tblcell = new TableCell(); tblcell.Text = "Edit"; tblcell.CssClass = "Headerlbl"; tblrow.Cells.Add(tblcell); tblcell = new TableCell(); tblcell.Text = "Delete"; tblcell.CssClass = "Headerlbl"; tblrow.Cells.Add(tblcell); tblusers.Controls.Add(tblrow); listingtblbody(tblusers, tblrow, tblcell); phtable.Controls.Add(tblusers); }
protected void loadpage() { Security.UserInfo usr = new Security.UserInfo(); string username = Session["USERNAME"].ToString(); Security.UserInfo usrs = usr.getUserProfileFromEmail(username); lblname.Text = usrs.Fname; lbllastname.Text = usrs.Lname; lblemail.Text = usrs.Username; lblfacebook.Text = usrs.FBHandler; lbltwitter.Text = usrs.TwiterHandler; }
protected void btndonation(object sender, ImageClickEventArgs e) { Security.UserInfo usr = new Security.UserInfo(); string username = Session["USERNAME"].ToString(); Security.UserInfo usrs = usr.getUserProfileFromEmail(username); NGOs.DonateNGO objNGO = new NGOs.DonateNGO(); objNGO.UserID = usrs.UserID; objNGO.NGOID = Request.QueryString["id"]; objNGO.RepresentingBrand = "1"; objNGO.Amount = "100"; objNGO.DateOfDonation = DateTime.Now.ToString(); string hi = objNGO.createNGODonation(objNGO); }
protected void load() { Security.UserInfo usr = new Security.UserInfo(); string del = Request.QueryString["id"]; Security.UserInfo usrs = usr.getUserProfile(del); txtlast.Text = usrs.Lname; txtfirst.Text = usrs.Fname; txtusername.Text = usrs.Username; txtfacebook.Text = usrs.FBHandler; txttwiter.Text = usrs.TwiterHandler; Image1.ImageUrl = "~/images/" + usrs.PhotoUrl; }
protected void loadpage() { Security.UserInfo usr = new Security.UserInfo(); string username = Session["USERNAME"].ToString(); Security.UserInfo usrs = usr.getUserProfileFromEmail(username); lblname.Text = usrs.Fname + " " + usrs.Lname; txtfacebook.Text = usrs.FBHandler; txttwitter.Text = usrs.TwiterHandler; Image1.ImageUrl = "~/images/" + usrs.PhotoUrl; Brand.PostBackUrl = "~/Brand/AddBrand.aspx"; NGO.PostBackUrl = "~/NGO/AddNGO.aspx"; changepass.PostBackUrl = "~/User/Forgetpass.aspx"; }
protected void addcomment(object sender, ImageClickEventArgs e) { Security.UserInfo usr = new Security.UserInfo(); string username = Session["USERNAME"].ToString(); Security.UserInfo usrs = usr.getUserProfileFromEmail(username); Comments com = new Comments(); string brandid = Request.QueryString["id"]; com.BrandID =""+ brandid+""; com.Comment = txtdiscption.InnerText; com.UserID = usrs.UserID; com.Deleted = false; com.Date = System.DateTime.Now; com.PostAsAnonymous = false; com.BrandCommentID = 0; com.CreateComment(com); }
protected void txtedit_Click(object sender, EventArgs e) { Security.UserInfo usr = new Security.UserInfo(); string del = Request.QueryString["id"]; Security.UserInfo usrs = usr.getUserProfile(del); try { usrs.Fname = txtfirst.Text; usrs.Lname = txtlast.Text; usrs.FBHandler = txtfacebook.Text; usrs.TwiterHandler = txttwiter.Text; } catch (Exception ex) { ex.ToString(); } string szID = usr.UpdateUserInfo(usrs); }
protected void btnsubmit_Click(object sender, ImageClickEventArgs e) { Security.UserInfo usr = new Security.UserInfo(); usr.Username = txtemail.Text; usr.Password = txtregisterpassword.Text; string szID = usr.CheckLogin(usr); if (szID == "1") { Session["USERNAME"] = usr.Username; Session["USERID"] = usr.UserID; Response.Redirect("~/User/UserProfile.aspx"); } else { } }
protected void insert(object sender, EventArgs e) { Security.UserInfo usr = new Security.UserInfo(); usr.Lname= txtfirst.Text; usr.Fname = txtlast.Text; usr.Username = txtemail.Text; usr.Password = txtpassword.Text; string szID = usr.CheckLogin(usr); if (szID == "0") { usr.RegisterUser(usr); Response.Redirect("login.aspx"); } else { lblemail.Text = "Email found"; } }
protected void btnregistersubmit_Click(object sender, ImageClickEventArgs e) { Security.UserInfo usr = new Security.UserInfo(); usr.Lname = txtfirst.Text; usr.Fname = txtlast.Text; usr.Username = txtemails.Text; usr.Password = txtpasswords.Text; string szID = usr.CheckLogin(usr); if (szID == "0") { usr.RegisterUser(usr); Response.Redirect("~/Default2.aspx"); } else { // lblemail.Text = "Email found"; } }
protected void btnupdate_Click(object sender, EventArgs e) { Security.UserInfo usr = new Security.UserInfo(); try { string email = Session["USERNAME"].ToString(); usr.Username = email; usr.Password = txtold.Text; string update = usr.CheckLogin(usr); if (update == "1") { usr.Password = txtnew.Text; update=usr.UpdateUserInfoEmail(usr); } } catch (Exception ex) { // prevent the exception from propagating, but return false to // signal the error ex.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { // string username = Session["USERNAME"].ToString(); string username = "******"; Security.UserInfo usrs = new Security.UserInfo(); // usrs = usrs.getUserProfileFromEmail(username); usrs = usrs.getUserProfile("22"); try { if (usrs.Active == "0") { Response.Redirect("~/User/login.aspx"); } if (!Page.IsPostBack) { db.Brandcategories(ddlcategory); } } catch { Response.Redirect("~/User/login.aspx"); } }
public void info() { string t = Request.QueryString["brandid"]; Brand brand = new Brand(); int brandid = int.Parse(t); brand = brand.getBrandDetails(brandid.ToString()); desc.Text = brand.BrandDescription; name.Text = brand.BrandName; A1.HRef = "http://" + brand.Website; A1.InnerText = brand.Website; Table All = new Table(); All.CssClass = "bdetails"; All.Width = Unit.Percentage(100); All.CellPadding = 1; All.CellSpacing = 1; TableRow Allrow = new TableRow(); TableCell Allcell = new TableCell(); Comments testing = new Comments(); string page = Request.QueryString["Page"]; if (page == null) page = "1"; int HOWMANYPAGES = 0; List<Comments> www = testing.getCommentall(brandid, page.ToString(), "3", out HOWMANYPAGES); for (int i = 0; i < www.Count; i++) { Security.UserInfo usr = new Security.UserInfo(); usr = usr.getUserProfile(www[i].UserID.ToString()); Allrow = new TableRow(); Allcell = new TableCell(); Image imag = new Image(); imag.Width = 40; imag.Height = 40; Allcell.Width = 40; imag.ImageUrl = "~/images/" + usr.PhotoUrl; Allcell.Controls.Add(imag); Allrow.Cells.Add(Allcell); // Allrow.Style.Add("background-color", "#EDE9D3"); Allcell = new TableCell(); Allcell.Style.Add("align", "left"); Table tbl = new Table(); tbl.Width = Unit.Percentage(100); TableRow tblrow = new TableRow(); TableCell tblcell = new TableCell(); tblcell.Text = usr.Fname + " " + usr.Lname; tblcell.Style.Add("color", "blue"); tblrow.Cells.Add(tblcell); tbl.Controls.Add(tblrow); tblrow = new TableRow(); tblcell = new TableCell(); tblcell.Text = www[i].Comment; tblcell.Style.Add("color", "blue"); tblrow.Cells.Add(tblcell); tbl.Controls.Add(tblrow); tblrow = new TableRow(); tblcell = new TableCell(); LinkButton lbdelete = new LinkButton(); tblcell.Controls.Add(lbdelete); lbdelete.Text = " Delete"; lbdelete.Style.Add("text-decoration", "none"); tblcell.Style.Add("color", "blue"); tblrow.Cells.Add(tblcell); tbl.Controls.Add(tblrow); tblrow = new TableRow(); tblcell = new TableCell(); tblcell.Controls.Add(new LiteralControl("<hr>")); tblrow.Cells.Add(tblcell); tbl.Controls.Add(tblrow); Allcell.Controls.Add(tbl); Allrow.Cells.Add(Allcell); All.Controls.Add(Allrow); } php.Controls.Add(All); string firstPageUrl = "http://localhost/f**k/Brand/Branddetail.aspx"; //SHARIF Page={0} shoule be like this string pagerFormat = "http://localhost/f**k/Brand/Branddetail.aspx?Page={0}"; bottomPager.Show(int.Parse(page), HOWMANYPAGES, firstPageUrl, pagerFormat, true); }
protected void positive(object sender, ImageClickEventArgs e) { Security.UserInfo usr = new Security.UserInfo(); string username = Session["USERNAME"].ToString(); Security.UserInfo usrs = usr.getUserProfileFromEmail(username); Brand.UserBrandlike objuserlike = new Brand.UserBrandlike(); objuserlike.UserID = usrs.UserID; objuserlike.BrandID = Request.QueryString["id"]; objuserlike = objuserlike.getdetails(usrs.UserID, objuserlike.BrandID); if (objuserlike.UserID != "") { string a = objuserlike.update(objuserlike, "1", "0"); } else { objuserlike.PositiveClick = "1"; objuserlike.NegativeClick = "0"; objuserlike.BrandID = Request.QueryString["id"]; objuserlike.UserID = usrs.UserID; string a = objuserlike.createUserBrandlike(objuserlike); } }
public void delete() { Security.UserInfo usr = new Security.UserInfo(); string del = Request.QueryString["id"]; usr.DeleteUser(int.Parse(del)); }
public void listingtblbody(Table tblusers, TableRow tblrow, TableCell tblcell) { Security.UserInfo usr = new Security.UserInfo(); string page = Request.QueryString["Page"]; if (page == null) page = "1"; int HOWMANYPAGES = 0; List<Security.UserInfo> objectuser = usr.getAlluser(1, page.ToString(), "5", out HOWMANYPAGES); string firstPageUrl = "http://localhost/f**k/Admintools/viewusers.aspx"; string pagerFormat = "http://localhost/f**k/Admintools/viewusers.aspx?Page={0}"; bottomPager.Show(int.Parse(page), HOWMANYPAGES, firstPageUrl, pagerFormat, true); for (int i = 0; i < objectuser.Count; i++) { tblrow = new TableRow(); tblcell.CssClass = "bodycells"; tblrow.HorizontalAlign = HorizontalAlign.Center; tblrow.Style.Add("background-color", "#EDE9D3"); tblcell = new TableCell(); Image imag = new Image(); imag.Width = 40; imag.Height = 40; imag.ImageUrl = "~/images/" + objectuser[i].PhotoUrl; // imag.PostBackUrl="Branddetail.aspx?brandid=" + a + ""; tblcell.Controls.Add(imag); tblrow.Cells.Add(tblcell); tblcell = new TableCell(); tblcell.Text = objectuser[i].Fname; tblrow.Cells.Add(tblcell); tblcell = new TableCell(); tblcell.Text = objectuser[i].Lname; tblrow.Cells.Add(tblcell); tblcell = new TableCell(); tblcell.Text = objectuser[i].Username; tblrow.Cells.Add(tblcell); tblcell = new TableCell(); tblcell.Text = objectuser[i].UserRole; tblrow.Cells.Add(tblcell); tblcell = new TableCell(); Button btnedit = new Button(); btnedit.Text = "Edit"; string str = ""; if (int.Parse(page) > 1) { int number = int.Parse(page); str = "edituser.aspx?id=" + objectuser[i].UserID + ""; } else { str = "edituser.aspx?id=" + objectuser[i].UserID + ""; } btnedit.Attributes["onclick"] = "javascript:window.open('" + str + "');"; tblcell.Controls.Add(btnedit); tblrow.Cells.Add(tblcell); tblcell = new TableCell(); Button btndelete = new Button(); btndelete.Text = "Delete"; str = ""; if (int.Parse(page) > 1) { int number = int.Parse(page); str = "viewusers.aspx?Page=" + number + "&dl=1&id=" + objectuser[i].UserID + ""; } else { str = "viewusers.aspx?Page=1&dl=1&id=" + objectuser[i].UserID + ""; } btndelete.PostBackUrl = str; tblcell.Controls.Add(btndelete); tblrow.Cells.Add(tblcell); tblusers.Controls.Add(tblrow); } phtable.Controls.Add(tblusers); }
public void Addcomments(TableCell allcells,int num) { Table tblComments = new Table(); tblComments.Style.Add("background-color", "#EDEFF4"); tblComments.Width = Unit.Percentage(100); tblComments.Height = Unit.Percentage(100); TableRow tblrowcom = new TableRow(); TableCell tblcellcom = new TableCell(); Comments comments = new Comments(); List<Comments> topcomments = comments.TopThreeComments(num); for (int j = 0; j < topcomments.Count; j++) { Security.UserInfo usr = new Security.UserInfo(); usr = usr.getUserProfile(topcomments[j].UserID.ToString()); Image imag = new Image(); imag.Width = 40; imag.Height = 40; tblcellcom.Width = 40; imag.ImageUrl = "~/images/" + usr.PhotoUrl; tblcellcom.Controls.Add(imag); tblrowcom.Cells.Add(tblcellcom); // Allrow.Style.Add("background-color", "#EDE9D3"); tblcellcom = new TableCell(); tblcellcom.Style.Add("align", "left"); Table tbl = new Table(); tbl.Width = Unit.Percentage(100); TableRow tblrow = new TableRow(); TableCell tblcell = new TableCell(); tblcell.Text = usr.Fname + " " + usr.Lname + " commented on "; tblcell.Style.Add("color", "blue"); tblrow.Cells.Add(tblcell); tbl.Controls.Add(tblrow); tblrow = new TableRow(); tblcell = new TableCell(); tblcell.Text = topcomments[j].Comment; // tblcell.Style.Add("color", "blue"); tblrow.Cells.Add(tblcell); tbl.Controls.Add(tblrow); tblrow = new TableRow(); tblcell = new TableCell(); Button lbdelete = new Button(); tblcell.Controls.Add(lbdelete); lbdelete.Text = " Delete " + topcomments[j].Date; string v= HttpContext.Current.Request.Url.AbsoluteUri+"&dl="+ topcomments[j].BrandCommentID+""; lbdelete.Attributes["onclick"]="javascript:window.location.replace('"+v+"');"; lbdelete.Style.Add("text-decoration", "none"); tblcell.Style.Add("color", "blue"); tblrow.Cells.Add(tblcell); tbl.Controls.Add(tblrow); tblrow = new TableRow(); tblcell = new TableCell(); tblcell.Controls.Add(new LiteralControl("<hr>")); tblrow.Cells.Add(tblcell); tbl.Controls.Add(tblrow); tblcellcom.Controls.Add(tbl); tblrowcom.Cells.Add(tblcellcom); tblComments.Controls.Add(tblrowcom); tblrowcom = new TableRow(); tblcellcom = new TableCell(); } allcells.Controls.Add(tblComments); }
protected void Button1_Click1(object sender, EventArgs e) { string username = Session["USERNAME"].ToString(); int counterSocailMedia = 0; Security.UserInfo usrs = new Security.UserInfo(); usrs = usrs.getUserProfileFromEmail(username); Brand objbrand = new Brand(); objbrand.BrandName = txtbrandname.Text; objbrand.BrandCategoryID = ddlcategory.SelectedValue; objbrand.BrandDescription = txtdiscption.InnerText; objbrand.USERID = usrs.UserID; //socail media directly counted if (txtwebsite.Text.Length > 0) { objbrand.Website = txtwebsite.Text; counterSocailMedia = counterSocailMedia + 5; } if (ddlyes.SelectedValue.Length > 0) { objbrand.AllowsCommentsOnWebsite = ddlyes.SelectedValue; counterSocailMedia = counterSocailMedia + 3; } if (Blog.Text.Length > 0) { objbrand.Blog = Blog.Text; counterSocailMedia = counterSocailMedia + 2; } //socail media objbrand.FacebookPage = facebook.Text; objbrand.TwitterPage = Twitter.Text; if (Youtube.Text.Length > 0) { objbrand.YoutubeChannel = Youtube.Text; counterSocailMedia = counterSocailMedia + 2; } if (GooglePlus.Text.Length > 0) { objbrand.GooglePlus = GooglePlus.Text; counterSocailMedia = counterSocailMedia + 2; } objbrand.Blog = Blog.Text; objbrand.Flicker = Flickr.Text; if (FoursquareAccount.Text.Length > 0) { objbrand.FourSquareAccount = FoursquareAccount.Text; counterSocailMedia = counterSocailMedia + 2; } if (LinkedIn.Text.Length > 0) { objbrand.LINKIND = LinkedIn.Text; counterSocailMedia = counterSocailMedia + 2; } Arhimedes objarchimedes = new Arhimedes(); objarchimedes.PositiveClicks = 0; objarchimedes.SocialMediaScore = counterSocailMedia; objarchimedes.PhilanthropyScore = 0; objarchimedes.PopularityScore = 0; objarchimedes.TotalScore = 0; objarchimedes.PositiveClicks = 0; objarchimedes.NegativeClicks = 0; objarchimedes.Active = false; objarchimedes.Date = System.DateTime.Now; string szID = objbrand.CreateBransh(objbrand, objarchimedes); }