Esempio n. 1
0
        // logging helper
        public static string FormatFoodTemplateDTO(FoodTemplateDTO foodTemplateDTO)
        {
            if (foodTemplateDTO == null)
            {
                // null
                return("foodTemplateDTO: null");
            }
            else
            {
                // output values
                return("foodTemplateDTO: \n"
                       + "{ \n"

                       + "    FoodTemplateId: " + "'" + foodTemplateDTO.FoodTemplateId + "'" + ", \n"
                       + "    Name: " + (foodTemplateDTO.Name != null ? "'" + foodTemplateDTO.Name + "'" : "null") + ", \n"
                       + "    Description: " + (foodTemplateDTO.Description != null ? "'" + foodTemplateDTO.Description + "'" : "null") + ", \n"
                       + "    FoodCategory: " + (foodTemplateDTO.FoodCategory != null ? "'" + foodTemplateDTO.FoodCategory + "'" : "null") + ", \n"
                       + "    Calories: " + (foodTemplateDTO.Calories != null ? "'" + foodTemplateDTO.Calories + "'" : "null") + ", \n"
                       + "    AverageExpirationTime: " + (foodTemplateDTO.AverageExpirationTime != null ? "'" + foodTemplateDTO.AverageExpirationTime + "'" : "null") + ", \n"
                       + "    Liquid: " + "'" + foodTemplateDTO.Liquid + "'" + ", \n"
                       + "    NeedsRefrigeration: " + "'" + foodTemplateDTO.NeedsRefrigeration + "'" + ", \n"
                       + "    Active: " + "'" + foodTemplateDTO.Active + "'" + ", \n"
                       + "    IsDeleted: " + "'" + foodTemplateDTO.IsDeleted + "'" + ", \n"
                       + "    CreateBy: " + (foodTemplateDTO.CreateBy != null ? "'" + foodTemplateDTO.CreateBy + "'" : "null") + ", \n"
                       + "    CreateOn: " + (foodTemplateDTO.CreateOn != null ? "'" + foodTemplateDTO.CreateOn + "'" : "null") + ", \n"
                       + "    UpdateBy: " + (foodTemplateDTO.UpdateBy != null ? "'" + foodTemplateDTO.UpdateBy + "'" : "null") + ", \n"
                       + "    UpdateOn: " + (foodTemplateDTO.UpdateOn != null ? "'" + foodTemplateDTO.UpdateOn + "'" : "null") + " \n"
                       + "} \n");
            }
        }
Esempio n. 2
0
        public static R_FoodTemplate ConvertDTOtoEntity(FoodTemplateDTO dto)
        {
            R_FoodTemplate foodTemplate = new R_FoodTemplate();

            foodTemplate.FoodTemplateId        = dto.FoodTemplateId;
            foodTemplate.Name                  = dto.Name;
            foodTemplate.Description           = dto.Description;
            foodTemplate.FoodCategory          = dto.FoodCategory;
            foodTemplate.Calories              = dto.Calories;
            foodTemplate.AverageExpirationTime = dto.AverageExpirationTime;
            foodTemplate.Liquid                = dto.Liquid;
            foodTemplate.NeedsRefrigeration    = dto.NeedsRefrigeration;
            foodTemplate.Active                = dto.Active;
            foodTemplate.IsDeleted             = dto.IsDeleted;
            foodTemplate.CreateBy              = dto.CreateBy;
            foodTemplate.CreateOn              = dto.CreateOn;
            foodTemplate.UpdateBy              = dto.UpdateBy;
            foodTemplate.UpdateOn              = dto.UpdateOn;

            return(foodTemplate);
        }