Example #1
0
        public static R_Food ConvertDTOtoEntity(FoodDTO dto)
        {
            R_Food food = new R_Food();

            food.FoodId                  = dto.FoodId;
            food.Name                    = dto.Name;
            food.Quantity                = dto.Quantity;
            food.FoodTemplateId          = dto.FoodTemplateId;
            food.SpecificObservations    = dto.SpecificObservations;
            food.Location                = dto.Location;
            food.Progress                = dto.Progress;
            food.Expired                 = dto.Expired;
            food.Liquid                  = dto.Liquid;
            food.Rating                  = dto.Rating;
            food.FeedbackFromBeneficiary = dto.FeedbackFromBeneficiary;
            food.DeliveredBy             = dto.DeliveredBy;
            food.DeliveredTo             = dto.DeliveredTo;
            food.OrderDateTime           = dto.OrderDateTime;
            food.CookedDateTime          = dto.CookedDateTime;
            food.PickupDateTime          = dto.PickupDateTime;
            food.StorageDateTime         = dto.StorageDateTime;
            food.DeliveryDateTime        = dto.DeliveryDateTime;
            food.Active                  = dto.Active;
            food.IsDeleted               = dto.IsDeleted;
            food.CreateBy                = dto.CreateBy;
            food.CreateOn                = dto.CreateOn;
            food.UpdateBy                = dto.UpdateBy;
            food.UpdateOn                = dto.UpdateOn;

            return(food);
        }
Example #2
0
        // logging helper
        public static string FormatFoodDTO(FoodDTO foodDTO)
        {
            if (foodDTO == null)
            {
                // null
                return("foodDTO: null");
            }
            else
            {
                // output values
                return("foodDTO: \n"
                       + "{ \n"

                       + "    FoodId: " + "'" + foodDTO.FoodId + "'" + ", \n"
                       + "    Name: " + (foodDTO.Name != null ? "'" + foodDTO.Name + "'" : "null") + ", \n"
                       + "    Quantity: " + (foodDTO.Quantity != null ? "'" + foodDTO.Quantity + "'" : "null") + ", \n"
                       + "    FoodTemplateId: " + (foodDTO.FoodTemplateId != null ? "'" + foodDTO.FoodTemplateId + "'" : "null") + ", \n"
                       + "    SpecificObservations: " + (foodDTO.SpecificObservations != null ? "'" + foodDTO.SpecificObservations + "'" : "null") + ", \n"
                       + "    Location: " + (foodDTO.Location != null ? "'" + foodDTO.Location + "'" : "null") + ", \n"
                       + "    Progress: " + (foodDTO.Progress != null ? "'" + foodDTO.Progress + "'" : "null") + ", \n"
                       + "    Expired: " + "'" + foodDTO.Expired + "'" + ", \n"
                       + "    Liquid: " + "'" + foodDTO.Liquid + "'" + ", \n"
                       + "    Rating: " + (foodDTO.Rating != null ? "'" + foodDTO.Rating + "'" : "null") + ", \n"
                       + "    FeedbackFromBeneficiary: " + (foodDTO.FeedbackFromBeneficiary != null ? "'" + foodDTO.FeedbackFromBeneficiary + "'" : "null") + ", \n"
                       + "    DeliveredBy: " + (foodDTO.DeliveredBy != null ? "'" + foodDTO.DeliveredBy + "'" : "null") + ", \n"
                       + "    DeliveredTo: " + (foodDTO.DeliveredTo != null ? "'" + foodDTO.DeliveredTo + "'" : "null") + ", \n"
                       + "    OrderDateTime: " + (foodDTO.OrderDateTime != null ? "'" + foodDTO.OrderDateTime + "'" : "null") + ", \n"
                       + "    CookedDateTime: " + (foodDTO.CookedDateTime != null ? "'" + foodDTO.CookedDateTime + "'" : "null") + ", \n"
                       + "    PickupDateTime: " + (foodDTO.PickupDateTime != null ? "'" + foodDTO.PickupDateTime + "'" : "null") + ", \n"
                       + "    StorageDateTime: " + (foodDTO.StorageDateTime != null ? "'" + foodDTO.StorageDateTime + "'" : "null") + ", \n"
                       + "    DeliveryDateTime: " + (foodDTO.DeliveryDateTime != null ? "'" + foodDTO.DeliveryDateTime + "'" : "null") + ", \n"
                       + "    Active: " + "'" + foodDTO.Active + "'" + ", \n"
                       + "    IsDeleted: " + "'" + foodDTO.IsDeleted + "'" + ", \n"
                       + "    CreateBy: " + (foodDTO.CreateBy != null ? "'" + foodDTO.CreateBy + "'" : "null") + ", \n"
                       + "    CreateOn: " + (foodDTO.CreateOn != null ? "'" + foodDTO.CreateOn + "'" : "null") + ", \n"
                       + "    UpdateBy: " + (foodDTO.UpdateBy != null ? "'" + foodDTO.UpdateBy + "'" : "null") + ", \n"
                       + "    UpdateOn: " + (foodDTO.UpdateOn != null ? "'" + foodDTO.UpdateOn + "'" : "null") + " \n"
                       + "} \n");
            }
        }