public bool AddUpdateDeleteOrder(OrderDetail Order, string action)
        {
            bool isSuccess = true;
            try
            {

                //brand.App_User = ReadConfigData.GetDBLoginUser();
                //brand.Audit_User = GlobalUser.getGlobalUser().UserName;
                //brand.RegionID = Convert.ToInt32(GlobalUser.getGlobalUser().RegionID);
                //brand.DisplayOrder = 1;
                //brand.VersionDataID = vid;
                //brand.VersionAction = action;
                if (action == "I")
                {
                    Insert(Order);
                }
                else if (action == "U")
                {
                    Update(Order);
                }
                else if (action == "D")
                {
                    Delete(Order);
                }
                _unitOfWork.SaveChanges();
            }
            catch (Exception ex)
            {
                isSuccess = false;
                throw ex;
            }
            return isSuccess;
        }
 public void Delete(OrderDetail Order)
 {
     _orderRepository.Delete(Order);
 }
 public OrderDetail Insert(OrderDetail Order)
 {
     _orderRepository.Insert(Order);
     return Order;
 }
 public OrderDetail Update(OrderDetail Order)
 {
     _orderRepository.Update(Order);
     return Order;
 }
        public string ValidateOrder(OrderDetail Orderchk, string action)
        {
            string result = string.Empty;
            if (action == "I")
            {
                var OrderList = _orderRepository.Query(u => u.CustomerName == Orderchk.CustomerName).Select();
                if (OrderList.ToList().Count > 0)
                {
                    if (OrderList.Where(u => u.CustomerName == Orderchk.CustomerName).FirstOrDefault() != null)
                    {
                        result = "Order Name already exists!";
                        return result;
                    }

                }
            }
            else if (action == "U")
            {
                var OrderList = _orderRepository.Query(u => u.OrderId != Orderchk.OrderId && (u.CustomerName == Orderchk.CustomerName)).Select();
                if (OrderList.ToList().Count > 0)
                {

                    return result;

                }
            }
            return result;
        }