public int Populate(int patientId, DateTime?fromDate, DateTime?toDate, IEnumerable <string> txExactMatch, IEnumerable <string> txLikeMatch) { MedicalTherapyDa da = new MedicalTherapyDa(); DataView view = da.GetPatientTherapiesByType(patientId, txExactMatch, txLikeMatch).DefaultView; // filter List <string> filters = new List <string>(); if (fromDate.HasValue) { string fromDateFilter = string.Format("{0} > #{1:d}#", MedicalTherapy.MedTxDate, fromDate); filters.Add(fromDateFilter); } if (toDate.HasValue) { string toDateFilter = string.Format("{0} < #{1:d}#", MedicalTherapy.MedTxDate, toDate); filters.Add(toDateFilter); } if (filters.Count() > 0) { view.RowFilter = string.Join(" AND ", filters.ToArray()); } view = view.ToTable().DefaultView; view.Sort = MedicalTherapy.MedTxDate; int recordCount = view.Count; MedTxGrid.VisibleBlankRows = recordCount > 0 ? 0 : 2; MedTxGrid.DataSource = view; MedTxGrid.DataBind(); return(recordCount); }
public IEnumerable <BusinessObject> Save(int patientId) { MedTxGrid.Save(patientId); // todo return(new BusinessObject[0]); }