示例#1
0
        protected void gvResult_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            List <PubEntAdmin.BLL.Announcement> dt = ((List <PubEntAdmin.BLL.Announcement>) this.gvResult.DataSource);

            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PubEntAdmin.BLL.Announcement l_conf = dt[e.Item.ItemIndex];
                ((TableCell)e.Item.Cells[0]).Text             = l_conf.AnnouncementID.ToString();
                ((Label)e.Item.Cells[1].Controls[1]).Text     = Server.HtmlEncode(l_conf.AnnouncementName);
                ((HyperLink)e.Item.Cells[2].Controls[1]).Text = ((HyperLink)e.Item.Cells[2].Controls[1]).NavigateUrl = Server.HtmlEncode(l_conf.AnnouncementURL);
                ((Label)e.Item.Cells[3].Controls[1]).Text     = l_conf.StartDate.ToShortDateString();
                ((Label)e.Item.Cells[4].Controls[1]).Text     = l_conf.EndDate.ToShortDateString();

                ////delete btn col
                Panel l_pnl = e.Item.Cells[6].Controls[1] as Panel;
                ((Label)l_pnl.Controls[1]).Text = "Are you sure you want to delete this Announcement [" + l_conf.AnnouncementName + "]?";
            }
            else if (e.Item.ItemType == ListItemType.EditItem)
            {
                PubEntAdmin.BLL.Announcement l_conf = dt[e.Item.ItemIndex];

                if (this.gvResult.EditItemIndex != -1)
                {
                    ((MaskedEditValidator)e.Item.Cells[3].Controls[7]).Enabled = true;
                    ((MaskedEditValidator)e.Item.Cells[4].Controls[7]).Enabled = true;
                }
                else
                {
                    ((MaskedEditValidator)e.Item.Cells[3].Controls[7]).Enabled = false;
                    ((MaskedEditValidator)e.Item.Cells[4].Controls[7]).Enabled = false;
                }

                ////delete btn col
                Panel l_pnl = e.Item.Cells[6].Controls[1] as Panel;
                ((Label)l_pnl.Controls[1]).Text = "Are you sure you want to delete this Announcement [" + l_conf.AnnouncementName + "]?";
            }
        }
示例#2
0
 public bool Contains(Announcement value)
 {
     return(List.Contains(value));
 }
示例#3
0
 public void Remove(Announcement value)
 {
     List.Remove(value);
 }
示例#4
0
 public void Insert(int index, Announcement value)
 {
     List.Insert(index, value);
 }
示例#5
0
 public int IndexOf(Announcement value)
 {
     return(List.IndexOf(value));
 }
示例#6
0
 public int Add(Announcement value)
 {
     return(List.Add(value));
 }