protected void BindGiftCardsList() { BPGiftCards bpcat = new BPGiftCards(); DSGiftCards = bpcat.SelectAll(); // DSGiftCards.tbl_GiftCards.DefaultView.Sort = "GiftCardSenderName"; dgGiftCards.DataBind(); }
protected void BindSalesList() { BPGiftCards bp = new BPGiftCards(); DSGiftCards = bp.SelectAll(); string searchString = string.Empty; if (dtStart.SelectedDate != DateTime.MinValue) { //searchString += String.Format("GiftCardDateCreated >= '{0}'", dtStart.SelectedDate.ToString("MM/dd/yyyy")); searchString += String.Format("GiftCardDateCreated >= '{0}'", Convert.ToDateTime(dtStart.SelectedDate.ToString("MM/dd/yyyy"))); //searchString += String.Format("GiftCardDateCreated >= '" + dtStart.SelectedDate.ToString("MM/dd/yyyy") + "'"); //searchString += "GiftCardDateCreated >= " + Convert.ToDateTime(dtStart.SelectedDate.ToString("MM/dd/yyyy")); } if (dtEnd.SelectedDate != DateTime.MinValue) { if (searchString != string.Empty) { searchString += " and "; } //searchString += String.Format("GiftCardDateCreated <= '{0}'", dtEnd.SelectedDate.ToString("MM/dd/yyyy")); searchString += String.Format("GiftCardDateCreated < '{0}'", Convert.ToDateTime((dtEnd.SelectedDate.AddDays(1).ToString("MM/dd/yyyy")))); //searchString += String.Format("GiftCardDateCreated <= '" + dtEnd.SelectedDate.ToString("dd/MM/yyyy") + "'"); //searchString += "GiftCardDateCreated <= " + Convert.ToDateTime(dtEnd.SelectedDate.ToString("MM/dd/yyyy")); } string Filter = searchString; if (Filter != null && Filter != "" && Filter != " ") { Filter = "(" + Filter + ") and "; } Filter += " GiftCardApproved = 1"; //DataRow [] somearray; //somearray = DSGiftCards.tbl_GiftCards.Select(Filter); DSGiftCards.tbl_GiftCards.DefaultView.RowFilter = Filter; }