Example #1
0
 public string GetAllOrdersList(string ID)
 {
     try
     {
         List <OrderDetailViewModel> OrderHeaderList = Mapper.Map <List <OrderDetail>, List <OrderDetailViewModel> >(_orderBusiness.GetAllOrdersList(ID));
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = OrderHeaderList }));
     }
     catch (Exception ex)
     {
         return(JsonConvert.SerializeObject(new { Result = "", Message = ex.Message }));
     }
     // return JsonConvert.SerializeObject(new { Result = "OK", Records = productList });
 }
 public object GetCustomerOrderDetails(OrderDetail OrderObj)
 {
     try
     {
         string OrderId = OrderObj.OrderID.ToString();
         List <OrderAppViewModel> CartList = Mapper.Map <List <OrderDetail>, List <OrderAppViewModel> >(_orderBusiness.GetAllOrdersList(OrderId));
         if (CartList.Count == 0)
         {
             throw new Exception(constants.NoItems);
         }
         return(JsonConvert.SerializeObject(new { Result = true, Records = CartList }));
     }
     catch (Exception ex)
     {
         return(JsonConvert.SerializeObject(new { Result = false, Message = ex.Message }));
     }
 }