Пример #1
0
		private void LoadList()
		{	
			Int64 PromoID =  Convert.ToInt64(lblPromoID.Text);
			PromoItems clsPromoItems = new PromoItems();
			lstStuff.DataSource = clsPromoItems.ListAsDataTable(PromoID).DefaultView;
			lstStuff.DataBind();
			clsPromoItems.CommitAndDispose();
		}
Пример #2
0
		private void lstItem_ItemDataBound(object sender, DataListItemEventArgs e)
		{
			if(e.Item.ItemType == ListItemType.Header)
			{
				LoadSortFieldOptions(e);
			}
			else if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
			{
				DataRowView dr = (DataRowView) e.Item.DataItem;				

				HtmlInputCheckBox chkList = (HtmlInputCheckBox) e.Item.FindControl("chkList");
				chkList.Value = dr["PromoID"].ToString();

				Label lblPromoCode = (Label) e.Item.FindControl("lblPromoCode");
				lblPromoCode.Text = dr["PromoCode"].ToString();

				Label lblPromoName = (Label) e.Item.FindControl("lblPromoName");
				lblPromoName.Text = dr["PromoName"].ToString();

				Label lblPromoType = (Label) e.Item.FindControl("lblPromoType");
				lblPromoType.Text = dr["PromoTypeCode"].ToString();

				Label lblStartDate = (Label) e.Item.FindControl("lblStartDate");
				lblStartDate.Text = Convert.ToDateTime(dr["StartDate"].ToString()).ToString("MM/dd/yyyy HH:mm:ss");
				
				Label lblEndDate = (Label) e.Item.FindControl("lblEndDate");
				lblEndDate.Text = Convert.ToDateTime(dr["EndDate"].ToString()).ToString("MM/dd/yyyy HH:mm:ss");

				Label lblStatus = (Label) e.Item.FindControl("lblStatus");
				PromoStatus Status = (PromoStatus) Enum.Parse(typeof(PromoStatus), dr["Status"].ToString());
				lblStatus.Text = Status.ToString("G");

				Int64 PromoID = Convert.ToInt64(dr["PromoID"].ToString());
				DataList lstStuff = (DataList) e.Item.FindControl("lstStuff");
				PromoItems clsPromoItems = new PromoItems();
				DataClass clsDataClass = new DataClass();

				lstStuff.ItemDataBound += new System.Web.UI.WebControls.DataListItemEventHandler(this.lstStuff_ItemDataBound);
				lstStuff.DataSource = clsPromoItems.ListAsDataTable(PromoID).DefaultView;
				lstStuff.DataBind();
				clsPromoItems.CommitAndDispose();

				//For anchor
				HtmlGenericControl divExpCollAsst = (HtmlGenericControl) e.Item.FindControl("divExpCollAsst");
				
				HtmlAnchor anchorDown = (HtmlAnchor) e.Item.FindControl("anchorDown");
				anchorDown.HRef = "javascript:ToggleDiv('" +  divExpCollAsst.ClientID + "')";
			}
		}