public IActionResult Update([FromBody] ProjectionUpdateDto _update)
 {
     if (_update.ProjectionID > 0)
     {
         var returndata = _projection.ProjectionUpdate(_update);
         return(Ok(returndata));
     }
     else
     {
         return(BadRequest());
     }
 }
        //public void AddProjectionDetails(int ProjectionID, int Quantity, DateTime updateDate)
        //{
        //    var IsdetailsExists = _context.ProjectionUpdateDetails
        //        .Where(p => p.FK_ProjectionID == ProjectionID && p.Quantity == Quantity)
        //        .Where(d => DateTime.Compare(d.Updated, updateDate) <= 0).FirstOrDefault();

        //    if (IsdetailsExists ==null)
        //    {
        //        var _AddprojectionDetails = new ProjectionUpdateDetails()
        //        {
        //            FK_ProjectionID = ProjectionID,
        //            Quantity=Quantity,
        //            Updated=updateDate
        //        };
        //        _context.ProjectionUpdateDetails.Add(_AddprojectionDetails);
        //        Save();
        //    }
        //}

        public ReturnDto ProjectionUpdate(ProjectionUpdateDto EntryModel)
        {
            var ReturnData = new ReturnDto();

            try
            {
                var UpdateProjection = _context.Projection.Where(x => x.Id == EntryModel.ProjectionID).FirstOrDefault();
                if (UpdateProjection != null)
                {
                    UpdateProjection.DateModified = DateTime.Now;
                    if (UpdateProjection.Quantity != EntryModel.ProjectionQuantity)
                    {
                        UpdateProjection.Quantity = EntryModel.ProjectionQuantity;
                    }
                    if (UpdateProjection.DateAllocated != EntryModel.DateAllocated)
                    {
                        UpdateProjection.DateAllocated = EntryModel.DateAllocated;
                    }
                    if (UpdateProjection.DateInvoiced != EntryModel.DateInvoiced)
                    {
                        UpdateProjection.DateInvoiced = EntryModel.DateInvoiced;
                    }
                    if (UpdateProjection.Comments != EntryModel.Comments)
                    {
                        UpdateProjection.Comments = EntryModel.Comments;
                    }
                    if (UpdateProjection.WarehouseId != EntryModel.WarehouseID)
                    {
                        UpdateProjection.WarehouseId = EntryModel.WarehouseID;
                    }
                    Save();
                    ReturnData.IsSuccess = true;
                    ReturnData.Message   = "Record Updated Sucessfuly";
                }
            }
            catch (Exception ex)
            {
                ReturnData.IsSuccess = false;
                ReturnData.Message   = ex.Message;
            }
            return(ReturnData);
        }