// // 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); }
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); }
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); }
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); }