Ejemplo n.º 1
0
    void LoadData()
    {
        int id = RequestUtils.GetArticleId(this);

        if (id != 0)
        {
            using (GmConnection conn = Global.CreateConnection())
            {
                article = Article.GetArticle(conn, id);
            }
        }
        if (article == null)
        {
            article = new Article();
            int ag = RequestUtils.GetArticleGroupId(this);
            if (ag != 0)
            {
                article.parentId = ag;
            }
            else
            {
                article.isGroup = true;
            }
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     log = AdminMasterPage.InitPage(this, "Candidates", true);
     try
     {
         int articleId = RequestUtils.GetArticleId(this);
         this.SqlDataSource1.SelectParameters["PositionId"].DefaultValue = articleId.ToString();
     }
     catch (Exception ex)
     {
         log.Exception(ex);
     }
 }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         log = AdminMasterPage.InitPage(this, "Edit article");
         int ar = RequestUtils.GetArticleId(this);
         if (ar != 0)
         {
             ucArticleParams.InitControl(ar);
         }
     }
     catch (Exception ex)
     {
         log.Exception(ex);
     }
 }
    void LoadData()
    {
        int id = RequestUtils.GetArticleParamId(this);

        if (id != 0)
        {
            using (GmConnection conn = Global.CreateConnection())
            {
                articleParam = ArticleParam.GetArticleParam(conn, id);
            }
        }
        else
        {
            int ar = RequestUtils.GetArticleId(this);
            articleParam = new ArticleParam(ar);
        }
    }
Ejemplo n.º 5
0
    public static int GetArticleId(Page page)
    {
        int articleId = RequestUtils.GetArticleId(page);

        if (articleId == 0)
        {
            string tag = RequestUtils.GetTag(page);
            if (!String.IsNullOrWhiteSpace(tag))
            {
                using (var conn = Global.CreateConnection())
                {
                    articleId = Article.GetArticleId(conn, tag);
                }
            }
        }
        return(articleId);
    }
    public void SaveData()
    {
        int       positionId = RequestUtils.GetArticleId(this);
        Candidate candidate  = new Candidate();

        candidate.positionId = positionId;
        candidate.name       = tbName.Text.Trim();
        candidate.surname    = tbSurname.Text.Trim();
        candidate.comments   = tbComments.Text.Trim();
        candidate.phone      = tbPhone.Text.Trim();
        candidate.email      = tbEmail.Text.Trim();
        candidate.date       = DateTime.Now;
        using (GmConnection conn = Global.CreateConnection())
        {
            candidate.Save(conn);
            candidate.resume = UploadResume(candidate.Id);
            candidate.UpdateResume(conn);
        }
    }
    public void LoadData()
    {
        int     positionId = RequestUtils.GetArticleId(this);
        Article article    = null;

        using (GmConnection conn = Global.CreateConnection())
        {
            if (positionId != 0)
            {
                article = Article.GetArticle(conn, positionId);
            }
        }
        if (article != null)
        {
            litDate.Text  = article.date.ToShortDateString();//<%# Eval("Date", "{0:MM.dd.yyyy}")%>
            litTitle.Text = article.title;
        }
        tbName.MaxLength     = MaxLength.Candidates.Name;
        tbSurname.MaxLength  = MaxLength.Candidates.Surname;
        tbEmail.MaxLength    = MaxLength.Candidates.Email;
        tbPhone.MaxLength    = MaxLength.Candidates.Phone;
        tbComments.MaxLength = MaxLength.Candidates.Comments;
    }