//
        // WORKS IN GALLERY
        //
        private static WorkInGalleryDto Convert(WorkInGallery workInGallery)
        {
            if (workInGallery == null)
            {
                return(null);
            }
            WorkInGalleryDto workInGalleryDto = new WorkInGalleryDto();

            workInGalleryDto.Id          = workInGallery.Id;
            workInGalleryDto.Title       = workInGallery.Title;
            workInGalleryDto.Copy        = workInGallery.Copy;
            workInGalleryDto.Name        = workInGallery.Name;
            workInGalleryDto.AskingPrice = workInGallery.AskingPrice;
            workInGalleryDto.Description = workInGallery.Description;
            return(workInGalleryDto);
        }
示例#2
0
        public WorkInGallery LoadWork(SqlDataReader dataReader)
        {
            WorkInGallery work = new WorkInGallery
            {
                WorkID      = dataReader.GetInt32(dataReader.GetOrdinal("WorkID")),
                Copy        = dataReader.GetString(dataReader.GetOrdinal("Copy")),
                Description = dataReader.GetString(dataReader.GetOrdinal("Description")),
                Name        = dataReader.GetString(dataReader.GetOrdinal("Name")),
                Title       = dataReader.GetString(dataReader.GetOrdinal("Title"))
            };
            object AskingPrice = dataReader["AskingPrice"];

            if (AskingPrice != DBNull.Value)
            {
                work.AskingPrice = Convert.ToDecimal(AskingPrice);
            }
            return(work);
        }
示例#3
0
        public static WorkInGallery Convert(WorkInGalleryDto workDto)
        {
            if (workDto == null)
            {
                return(null);
            }
            WorkInGallery work = new WorkInGallery()
            {
                WorkID      = workDto.WorkID,
                AskingPrice = workDto.AskingPrice,
                Copy        = workDto.Copy,
                Description = workDto.Description,
                Name        = workDto.Name,
                Title       = workDto.Title
            };

            return(work);
        }
示例#4
0
        private static WorkInGallery LoadWork(SqlDataReader reader)
        {
            WorkInGallery workInGallery = new WorkInGallery();

            workInGallery.Id          = reader.GetInt32(reader.GetOrdinal("WorkID"));
            workInGallery.Name        = reader.GetString(reader.GetOrdinal("Name"));
            workInGallery.Title       = reader.GetString(reader.GetOrdinal("Title"));
            workInGallery.Copy        = reader.GetString(reader.GetOrdinal("Copy"));
            workInGallery.Description = reader.GetString(reader.GetOrdinal("Description"));
            object askingprice = reader["AskingPrice"];

            if (askingprice != DBNull.Value)
            {
                workInGallery.AskingPrice = Convert.ToDecimal(askingprice);
            }

            return(workInGallery);
        }