public List <TOrderItem> SyncOrderItem()
        {
            try
            {
                IEnumerable <OrderHistory> changedOrderIds;

                using (ThanhVanTranSysEntities context = new ThanhVanTranSysEntities())
                    using (OrderItemBusiness business = new OrderItemBusiness())
                    {
                        changedOrderIds = context.OrderHistories
                                          .Where(i => i.date_time.Year == DateTime.Now.Year && i.date_time.Month == DateTime.Now.Month && i.date_time.Day == DateTime.Now.Day)
                                          .OrderBy(i => i.order_id).ThenBy(i => i.date_time);

                        var orderItems = (from oi in business.GetAll()
                                          join co in changedOrderIds on oi.order_id equals co.order_id
                                          select ThriftUtil.ConvertToTOrderItem(oi, co.action == Constants.DELETE_ACTION)).ToList();

                        return(orderItems);
                    }
            }
            catch (Exception exc)
            {
                ServerLogger.logError("[SyncOrderItem]", exc);
                return(new List <TOrderItem>());
            }
        }
 public List <TOrderItem> LoadOrderItem()
 {
     try
     {
         using (OrderItemBusiness business = new OrderItemBusiness())
         {
             return(business.GetAll().ToList().Select(i => ThriftUtil.ConvertToThriftObject(i) as TOrderItem).ToList());
         }
     }
     catch (Exception exc)
     {
         ServerLogger.logError("[LoadOrderItem]", exc);
         return(new List <TOrderItem>());
     }
 }