Пример #1
0
    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;
    }
Пример #2
0
 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);
 }
Пример #3
0
    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");
        }
    }
Пример #4
0
    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);
    }
Пример #5
0
    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);
    }