private void makeSaleRequest_Click(object sender, EventArgs e) { using (var db = new DbController()) { var newSaleRequest = new SaleRequest(); newSaleRequest.AgentName = this.agentName.Text; newSaleRequest.ClientName = this.clientName.Text; newSaleRequest.ApartmentRoomCount = int.Parse(this.apartmentRoomCount.Text); newSaleRequest.ApartmentFloor = int.Parse(this.apartmentFloor.Text); newSaleRequest.ApartmentArea = float.Parse(this.apartmentArea.Text); newSaleRequest.Type = this.saleRequestType.Text; db.SetSaleRequest(newSaleRequest); } this.Update(); }