public QuestionForm(string statusType) { InitializeComponent(); if (statusType == "İnceleme") { for (int i = 0; i < read.homeList.Count; i++) { read.HouseRentTextFileListReader(); RentHouseDataGrid(); string search = dataGridView1.CurrentRow.Cells[i].Value.ToString(); read.HouseRentTextFileListReader(); nmOdaSayisi.Enabled = false; nmKatNo.Enabled = false; cmbSehir.Enabled = false; cmbSemt.Enabled = false; cmTur.Enabled = false; rdKiralık.Enabled = false; rdSatilik.Enabled = false; txtFiyat.Enabled = false; txtRent.Enabled = false; txtAlan.Enabled = false; dtYapimTarihi.Enabled = false; txtDepozito.Enabled = false; rdAktif.Enabled = false; } } else if (statusType == "silme") { } else { } }
/// <summary> /// Kiralık seçilip ARA butonuna tıklanıldığında DataGrid de sütun ve satırlar seçilen kiralık bilgilerine göre listelenecektir ... /// </summary> public void RentHouseDataGrid() { FileWriteOrFileReadClasses read = new FileWriteOrFileReadClasses(); read.HouseRentTextFileListReader(); dataGridView1.Columns.Clear(); for (int i = 0; i < read.homeList.Count; i++) { if (read.homeList[i].EvTipi == "Kiralık") { DataTable dataTable = new DataTable(); dataTable.Columns.Add("Oda Sayısı"); dataTable.Columns.Add("Kat No"); dataTable.Columns.Add("Semt"); dataTable.Columns.Add("Alan"); dataTable.Columns.Add("Yapım Tarihi"); dataTable.Columns.Add("Aktif"); dataTable.Columns.Add("Emlak Numarası"); dataTable.Columns.Add("Tür"); dataTable.Columns.Add("Kira"); dataTable.Columns.Add("Depozito"); dataTable.Rows.Add(read.homeList[i].NumberOfRooms, read.homeList[i].NumberOfFloors, read.homeList[i].District, read.homeList[i].Area, read.homeList[i].DateOfConstructor, read.homeList[i].Active, read.homeList[i].HomeNumber, read.homeList[i].IsType, ((HouseForRent)read.homeList[i]).Rent, ((HouseForRent)read.homeList[i]).Deposito); dataGridView1.DataSource = dataTable; } } }