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
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (SessRoot != null)
         {
             DDLHelper.LoadNumberDDL(ref drpDay, 31);
             DDLHelper.LoadNumberDDL(ref drpMonth, 12);
             DDLHelper.LoadNumberDDL(ref drpYear, DateTime.Today.Year, 1, 1920);
             UctrlPageCategories1.BindCategories();
             if (Request.QueryString["PageID"] == "0" || Request.QueryString["PageID"] == null)
             {
                 if (Request.QueryString["SubjectID"] != null)
                 {
                     if (Util.IsNumeric(Request.QueryString["SubjectID"]))
                     {
                         this.SubjectID = int.Parse(Request.QueryString["SubjectID"].ToString());
                     }
                 }
                 this.SaveMode = Enumerations.SaveMode.Insert;
                 BindDDL();
             }
             else
             {
                 if (Util.IsNumeric(Request.QueryString["PageID"]))
                 {
                     this.PageID   = int.Parse(Request.QueryString["PageID"]);
                     this.SaveMode = Enumerations.SaveMode.Update;
                     FillForm();
                 }
                 else
                 {
                     Response.Write("<script language='javascript'> { window.close();}</script>");
                 }
             }
         }
         else
         {
             BINROTA.COM.Common.GotoDefaultPage(this.Response);
         }
     }
 }