private void InitAdvertisementAvailable() { DataRow[] drs = Advertisements.GetAdvertisements(type).Select("endtime < '" + DateTime.Now.ToString() + "'"); if (drs.Length == 0) { return; } string aidList = ""; foreach (DataRow dr in drs) { aidList += dr["advid"] + ","; } if (aidList != "") { Advertisements.UpdateAdvertisementAvailable(aidList.TrimEnd(','), 0); } }
public void BindData(int type) { DataGrid1.AllowCustomPaging = false; DataGrid1.BindData(Advertisements.GetAdvertisements(type)); }