Ejemplo n.º 1
0
        public override void DataBind()
        {
            if (this._bound)
            {
                return;
            }
            _bound = true;

            int    _itemId = -1;
            object obj     = DataBinder.Eval(this.NamingContainer, "DataItem.Id");

            if (!String.IsNullOrEmpty(obj.ToString()))
            {
                _itemId = (int)obj;
            }
            else
            {
                return;
            }

            CalendarManager cMgr = new CalendarManager();
            DataRow         _event;

            _event = cMgr.GetEventDetails(_itemId);

            DateTime datefrom = (DateTime)_event["DateFrom"];
            DateTime?dateto   = null;

            if (_event["DateTo"] != System.DBNull.Value)
            {
                try
                {
                    dateto = (DateTime)_event["DateTo"];
                }
                catch
                {
                }
            }
            if (datefrom.CompareTo(dateto) == 0)
            {
                this.Text = string.Format(Format, datefrom);
            }
            else
            {
                this.Text = string.Format(Format + Format2, datefrom, dateto);
            }

            base.DataBind();
        }
Ejemplo n.º 2
0
        public override void DataBind()
        {
            if (_bound)
            {
                return;
            }
            _bound = true;

            CalendarManager nMgr = new CalendarManager();

            if (CalendarId != null)
            {
                this.DataItem = nMgr.GetEventDetails(CalendarId.Value);
            }

            base.DataBind();
        }