public AddTravelProject(TravelProjectDto modifyTravelProject) { InitializeComponent(); GetProjectTypes(); travelProject = new TravelProjectDto { SupplierID = modifyTravelProject.SupplierID, ProjectID = modifyTravelProject.ProjectID }; txtProjectName.Text = modifyTravelProject.ProjectName; txtAdultFee.Text = modifyTravelProject.AdultFee.ToString(); txtChildFee.Text = modifyTravelProject.ChildFee.ToString(); txtAgentAdult.Text = modifyTravelProject.AgentAdultFee.ToString(); txtAgentChild.Text = modifyTravelProject.AgentChildFee.ToString(); txtRemark.Text = modifyTravelProject.Remark; txtDesc.Text = modifyTravelProject.Description; cbxType.Text = modifyTravelProject.ProjectTypeName; if (modifyTravelProject.CoverPic != null && !modifyTravelProject.CoverPic.ToString().Equals(string.Empty)) { Stream picStream = WebCall.GetPic(modifyTravelProject.CoverPic); if (picStream != null) { btnPic.BackgroundImage = Image.FromStream(picStream); picStream.Close(); } pic = modifyTravelProject.CoverPic; } }
public AddHotel(HotelDto hotelDto) { InitializeComponent(); hotel = hotelDto; txtHotelName.Text = hotel.HouseName; txtFee.Text = hotel.Fee.ToString(); txtAgentFee.Text = hotel.AgentFee.ToString(); txtRemark.Text = hotel.Remark; txtDesc.Text = hotel.Description; txtLocation.Text = hotel.Location; txtRoomCount.Text = hotel.RoomCount.ToString(); pic = AppUtils.ToString(hotel.CoverPic); if (!pic.Equals(string.Empty)) { Stream picSteam = WebCall.GetPic(pic); btnPic.BackgroundImage = Image.FromStream(picSteam); picSteam.Close(); } if (hotel.Pics != null) { otherPics = hotel.Pics.ToString(); } }
public AddHotelPictures(string pics) { InitializeComponent(); Pics = pics; if (!Pics.Equals(string.Empty)) { picNames = AppUtils.JsonDeserialize <List <string> >(Pics); //for (int i = 1; i <= picNames.Count; i++) for (int i = picNames.Count; i > 0; i--) { string file = picNames[i - 1]; PictureBox pic = new PictureBox(); pic.SizeMode = PictureBoxSizeMode.StretchImage; Stream picSteam = WebCall.GetPic(file); pic.Image = Image.FromStream(picSteam); picSteam.Close(); pic.Size = new Size(picSize, picSize); pic.Left = 5 + i % rowCount * picSize + i % rowCount * 5; pic.Top = 5 + i / rowCount * picSize + i / rowCount * 5; this.Controls.Add(pic); } } btnAdd.Image = Properties.Resources.pic_add; }