public WCFStationery GetStationery(string itemCode) { try { Stationery s = stationeryService.FindStationeryByItemCode(itemCode); return(WCFModelConvertUtility.ConvertToWCFStationery(s)); } catch (Exception e) { throw new Exception(e.Message); } }
public List <WCFStationery> GetAllStationeries() { try { List <Stationery> stationeries = stationeryService.GetAllStationery(); return(WCFModelConvertUtility.ConvertToWCFStationery(stationeries)); } catch (Exception e) { throw new Exception(e.Message); } }
public List <WCFStationery> GetStationeryByCategory(string categoryName) { try { string categoryID = "-1"; if (categoryName != "All") { List <Category> categories = stationeryService.GetAllCategory(); categoryID = categories.Find(x => x.categoryName == categoryName).categoryID.ToString(); } List <Stationery> stationeries = stationeryService.GetStationeriesBasedOnCriteria(null, categoryID); return(WCFModelConvertUtility.ConvertToWCFStationery(stationeries)); } catch (Exception e) { throw new Exception(e.Message); } }