Пример #1
0
    private void FillArticleWriterInfo()
    {
        int ArticleWriterId = 0;

        if (int.TryParse(Request.QueryString["Arid"], out ArticleWriterId))
        {
            if (ArticleWriterId > 0)
            {
                MyComponent.Entities.User ArticleWriter = BLL.GetUserById(ArticleWriterId);
                if (ArticleWriter != null)
                {
                    lblArticleWriterName.Text = ArticleWriter.FirstName + " " + ArticleWriter.LastName;
                    if (File.Exists(Server.MapPath("~/UsersImages/" + ArticleWriter.ImageName)))
                    {
                        imgArticleWriter.ImageUrl = ResolveUrl("~/UsersImages/" + ArticleWriter.ImageName);
                    }

                    dvCv.InnerHtml = ArticleWriter.Cv;
                    this.Title     = "معلومات الكاتب " + ArticleWriter.FirstName + " " + ArticleWriter.LastName;
                    lblArticleWriterInfoTitle.Text = "معلومات الكاتب " + ArticleWriter.FirstName + " " + ArticleWriter.LastName;

                    btnSaveComment.Enabled = true;

                    string metaTags    = ArticleWriter.FirstName + " " + ArticleWriter.LastName;
                    string description = "معلومات الكاتب";
                    AddMetaTagsAndPageDescription(metaTags, description);
                }

                FillContentGrid(ArticleWriterId);
                FillComments();
            }
        }
    }
Пример #2
0
    void ddlTeachers_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(ddlTeachers.SelectedValue))
        {
            MyComponent.Entities.User teacher = BLL.GetUserById(Convert.ToInt32(ddlTeachers.SelectedValue));
            if (teacher != null)
            {
                txtUserName.Text = teacher.Email;

                txtPassword.Text = teacher.Password;
                upnlChangePassword.Update();
            }
        }
    }
Пример #3
0
    private void FillArticleWriterInfo()
    {
        MyComponent.Entities.User ArticleWriter = BLL.GetUserById(Convert.ToInt32(Session["ArticleWriterId"]));
        if (ArticleWriter != null)
        {
            txtArticleWriterFirstName.Text = ArticleWriter.FirstName;
            txtArticleWriterLastName.Text  = ArticleWriter.LastName;

            if (File.Exists(Server.MapPath("~/UsersImages/" + ArticleWriter.ImageName)))
            {
                imgArticleWriter.ImageUrl = ResolveUrl("~/UsersImages/" + ArticleWriter.ImageName);
            }

            txtMyCv.Text = ArticleWriter.Cv;
        }
        FillContentGrid();
    }
Пример #4
0
    void btnUpdate_Click(object sender, EventArgs e)
    {
        if (Session["ArticleWriterId"] != null)
        {
            MyComponent.Entities.User ArticleWriter = BLL.GetUserById(Convert.ToInt32(Session["ArticleWriterId"]));
            if (ArticleWriter != null)
            {
                ArticleWriter.FirstName = txtArticleWriterFirstName.Text;
                ArticleWriter.LastName  = txtArticleWriterLastName.Text;
                ArticleWriter.Cv        = txtMyCv.Text;

                BLL.UpdateUser(ArticleWriter);

                SetAlert(operationMessage);
                upnlMyProfile.Update();
            }
        }
    }