public static List <ComboDTO> Search(int idthuonghieu, int idmausac, int kieudang) { List <EFModels.Combo> entities = new List <Combo>(); List <ComboDTO> dtoes = new List <ComboDTO>(); entities = ComboDAO.Search(idthuonghieu, idmausac, kieudang); foreach (Combo item in entities) { string img = ChiTietComboBUS.getComboImage(item.IDCombo); double?price = 0; double?total = ChiTietComboBUS.caculateComboTotalPrice(item.IDCombo); if (item.GiaThayDoi == 1) { price = ChiTietComboBUS.caculateComboTotalPrice(item.IDCombo); } else if (item.GiaThayDoi > 1) { price = total + total * item.GiaThayDoi; } else if (item.GiaThayDoi < 1) { price = total - total * item.GiaThayDoi; } dtoes.Add(ComboConverter.ConvertToDTO(item, img, price)); } return(dtoes); }
public List <Combo> Search(string searchString) { return(dao.Search(searchString)); }