Пример #1
0
        // logging helper
        public static string FormatDistrictDTO(DistrictDTO districtDTO)
        {
            if (districtDTO == null)
            {
                // null
                return("districtDTO: null");
            }
            else
            {
                // output values
                return("districtDTO: \n"
                       + "{ \n"

                       + "    DistrictId: " + "'" + districtDTO.DistrictId + "'" + ", \n"
                       + "    CountryId: " + (districtDTO.CountryId != null ? "'" + districtDTO.CountryId + "'" : "null") + ", \n"
                       + "    Name: " + (districtDTO.Name != null ? "'" + districtDTO.Name + "'" : "null") + ", \n"
                       + "    Code: " + (districtDTO.Code != null ? "'" + districtDTO.Code + "'" : "null") + ", \n"
                       + "    Latitude: " + (districtDTO.Latitude != null ? "'" + districtDTO.Latitude + "'" : "null") + ", \n"
                       + "    Longitude: " + (districtDTO.Longitude != null ? "'" + districtDTO.Longitude + "'" : "null") + ", \n"
                       + "    Active: " + "'" + districtDTO.Active + "'" + ", \n"
                       + "    IsDeleted: " + "'" + districtDTO.IsDeleted + "'" + ", \n"
                       + "    CreateBy: " + (districtDTO.CreateBy != null ? "'" + districtDTO.CreateBy + "'" : "null") + ", \n"
                       + "    CreateOn: " + (districtDTO.CreateOn != null ? "'" + districtDTO.CreateOn + "'" : "null") + ", \n"
                       + "    UpdateBy: " + (districtDTO.UpdateBy != null ? "'" + districtDTO.UpdateBy + "'" : "null") + ", \n"
                       + "    UpdateOn: " + (districtDTO.UpdateOn != null ? "'" + districtDTO.UpdateOn + "'" : "null") + " \n"
                       + "} \n");
            }
        }
Пример #2
0
        public static R_District ConvertDTOtoEntity(DistrictDTO dto)
        {
            R_District district = new R_District();

            district.DistrictId = dto.DistrictId;
            district.CountryId  = dto.CountryId;
            district.Name       = dto.Name;
            district.Code       = dto.Code;
            district.Latitude   = dto.Latitude;
            district.Longitude  = dto.Longitude;
            district.Active     = dto.Active;
            district.IsDeleted  = dto.IsDeleted;
            district.CreateBy   = dto.CreateBy;
            district.CreateOn   = dto.CreateOn;
            district.UpdateBy   = dto.UpdateBy;
            district.UpdateOn   = dto.UpdateOn;

            return(district);
        }