예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["UserName"] != null)
                {
                    String usrName = Request.QueryString["UserName"].ToString();

                    using (eYillikEntities veri = new eYillikEntities())
                    {
                        try
                        {
                            var kullanici = veri.sys_ProfilSayfasiGetir(usrName).FirstOrDefault();

                            imgAvatar.ImageUrl = kullanici.UserPicture;
                            spKullaniciAdi.Text = kullanici.UserName + " " + kullanici.UserSurname;
                            hypFacebook.NavigateUrl = kullanici.UserFacebook;
                            hypLinkedin.NavigateUrl = kullanici.UserLinkedin;
                            hypPlus.NavigateUrl = kullanici.UserGooglePlus;
                            hypTwitter.NavigateUrl = kullanici.UserTwitter;
                            hypGithub.NavigateUrl = kullanici.UserGithub;
                            hypPinterest.NavigateUrl = kullanici.UserPinterest;
                            lblKisisel.Text = kullanici.UserPersonal;
                            lblDostlar.Text = kullanici.UserFriend;
                            lblTavsiye.Text = kullanici.UserRecommend;
                            lblYeniden.Text = kullanici.UserRetry;
                        }
                        catch { }
                    }
                }
                else
                    Response.Redirect("~/Student/Profile.aspx");
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            using (eYillikEntities veri = new eYillikEntities())
            {
                try
                {
                    var kullanici = veri.sys_ProfilSayfasiGetir(User.Identity.Name).FirstOrDefault();

                    imgAvatar.ImageUrl = kullanici.UserPicture;
                    spKullaniciAdi.Text = kullanici.UserName + " " + kullanici.UserSurname;
                    hypFacebook.NavigateUrl = kullanici.UserFacebook;
                    hypLinkedin.NavigateUrl = kullanici.UserLinkedin;
                    hypPlus.NavigateUrl = kullanici.UserGooglePlus;
                    hypTwitter.NavigateUrl = kullanici.UserTwitter;
                    hypGithub.NavigateUrl = kullanici.UserGithub;
                    hypPinterest.NavigateUrl = kullanici.UserPinterest;
                    lblKisisel.Text = kullanici.UserPersonal;
                    lblDostlar.Text = kullanici.UserFriend;
                    lblTavsiye.Text = kullanici.UserRecommend;
                    lblYeniden.Text = kullanici.UserRetry;
                    username.Text = User.Identity.Name;
                    firstname.Text = kullanici.UserName;
                    lastname.Text = kullanici.UserSurname;

                    SqlConnection conn = new SqlConnection(@"Server=.\sqlexpress;Database=eYillik;Trusted_Connection=True;");

                    SqlCommand cmd1 = new SqlCommand("Select RememberContent from sys_Remembers as r inner join sys_Users as u on u.UserId = r.ToUser where u.UserNumber = '" + User.Identity.Name + "'", conn);

                    SqlDataAdapter da = new SqlDataAdapter(cmd1);

                    DataSet ds = new DataSet();

                    da.Fill(ds, "sys_Remember");

                    rptAni.DataSource = ds.Tables["sys_Remember"];
                    rptAni.DataBind();
                }
                catch { }
            }
        }