Example #1
0
    protected void rptPages_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
        {
            int PageID = int.Parse(e.CommandArgument.ToString());
            //SetComments(PageID);
            DataTable dt = BINROTA.BUS.Pages.GetPageForExistanceControl(PageID);
            if (dt.Rows.Count > 0)
            {
                UctrlPageContent1.ContentText = dt.Rows[0]["PageContent"].ToString();
                UctrlPageContent1.Title       = dt.Rows[0]["Title"].ToString();
                DateTime TravelDate = DateTime.Parse(dt.Rows[0]["TravelDate"].ToString());
                UctrlPageContent1.ContentDay      = int.Parse(TravelDate.Day.ToString());
                UctrlPageContent1.ContentMonth    = int.Parse(TravelDate.Month.ToString());
                UctrlPageContent1.ContentYear     = int.Parse(TravelDate.Year.ToString());
                UctrlPageContent1.ContentCategory = int.Parse(dt.Rows[0]["PageCategoryID"].ToString());
            }

            DataTable dtCategories = BINROTA.BUS.Categories.GetCategories();
            UctrlPageCategories1.BindCategories();
            foreach (DataRow dr in dtCategories.Rows)
            {
                dt = BINROTA.BUS.Pages.GetPageForExistanceControl(PageID, int.Parse(dr["CategoryID"].ToString()));
                foreach (DataRow dr1 in dt.Rows)
                {
                    UctrlPageCategories1.SetCategoryContent(int.Parse(dr1["CategoryID"].ToString()), dr1["PageContent"].ToString());
                }
            }
        }
    }
Example #2
0
    private void TreeChildChange(int SubjectID)
    {
        try
        {
            //DataTable dt = BINROTA.BUS.Pages.GetPageForExistanceControl(SessRoot.UserID, SubjectID, (int)Enumerations.PageType.TravelPage);
            DataTable dt = BINROTA.BUS.Pages.GetPageForExistanceControl(SubjectID);//SubjectID aslýnda PageID
            if (dt.Rows.Count > 0)
            {
                DataTable dtCategories = new DataTable();
                int       PageID       = int.Parse(dt.Rows[0]["PageID"].ToString());
                ((DropDownList)UctrlPageContent1.FindControl("drpPageCategory")).SelectedValue = dt.Rows[0]["PageCategoryID"].ToString();
                ((TextBox)UctrlPageContent1.FindControl("txtTitle")).Text = dt.Rows[0]["Title"].ToString();
                UctrlPageContent1.ContentText = dt.Rows[0]["PageContent"].ToString();

                DateTime TravelDate = DateTime.Parse(dt.Rows[0]["ModifyDate"].ToString());
                UctrlPageContent1.ContentYear  = TravelDate.Year;
                UctrlPageContent1.ContentMonth = TravelDate.Month;
                UctrlPageContent1.ContentDay   = TravelDate.Day;

                dtCategories = BINROTA.BUS.Categories.GetCategories();
                if (dtCategories.Rows.Count > 0)
                {
                    for (int i = 0; i < dtCategories.Rows.Count; i++)
                    {
                        int CategoryID = int.Parse(dtCategories.Rows[i]["CategoryID"].ToString());
                        UctrlPageCategories1.SetCategoryContent(CategoryID, (BINROTA.BUS.Pages.GetPageForExistanceControl(PageID, CategoryID).Rows[0]["PageContent"]).ToString());
                    }
                }
            }
        }
        catch (Exception)
        {
        }
    }
Example #3
0
    private void FillForm()
    {
        DDLHelper.BindDDL(ref drpPageCategory, BINROTA.BUS.PageCategories.GetPageCategoriesAll(), "PageCategoryName", "PageCategoryID", "");
        DDLHelper.BindDDL(ref drpContinent, BINROTA.BUS.Subjects.GetSubjectByParentSubjectID(0), "Name", "SubjectID", "");
        DataTable dt = BINROTA.BUS.Pages.GetPageForExistanceControl(PageID);

        if (dt.Rows.Count > 0)
        {
            if (SessRoot.UserID == Convert.ToInt32(dt.Rows[0]["MemberID"]))
            {
                ftbPageContent.Text = dt.Rows[0]["PageContent"].ToString();
                txtTitle.Text       = dt.Rows[0]["Title"].ToString();
                DateTime travelDate = Convert.ToDateTime(dt.Rows[0]["TravelDate"]);
                drpDay.SelectedValue          = travelDate.Day.ToString();
                drpMonth.SelectedValue        = travelDate.Month.ToString();
                drpYear.SelectedValue         = travelDate.Year.ToString();
                drpPageCategory.SelectedValue = dt.Rows[0]["PageCategoryID"].ToString();

                BindDLLBySubjectID(int.Parse(dt.Rows[0]["SubjectID"].ToString()));
            }
            else
            {
                Response.Write("<script language='javascript'> { window.close();}</script>");
                Response.End();
            }
        }
        else
        {
            Response.Write("<script language='javascript'> { window.close();}</script>");
            Response.End();
        }

        DataTable dtCategories = BINROTA.BUS.Categories.GetCategories();

        foreach (DataRow dr in dtCategories.Rows)
        {
            dt = BINROTA.BUS.Pages.GetPageForExistanceControl(PageID, int.Parse(dr["CategoryID"].ToString()));
            foreach (DataRow dr1 in dt.Rows)
            {
                UctrlPageCategories1.SetCategoryContent(int.Parse(dr1["CategoryID"].ToString()), dr1["PageContent"].ToString());
            }
        }
    }