コード例 #1
0
 public WCFStationery GetStationery(string itemCode)
 {
     try
     {
         Stationery s = stationeryService.FindStationeryByItemCode(itemCode);
         return(WCFModelConvertUtility.ConvertToWCFStationery(s));
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
コード例 #2
0
 public List <WCFStationery> GetAllStationeries()
 {
     try
     {
         List <Stationery> stationeries = stationeryService.GetAllStationery();
         return(WCFModelConvertUtility.ConvertToWCFStationery(stationeries));
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
コード例 #3
0
        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);
            }
        }