66 lines
1.6 KiB
C#
66 lines
1.6 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.ComponentModel;
|
|||
|
using System.Data;
|
|||
|
using System.Drawing;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using System.Windows.Forms;
|
|||
|
|
|||
|
namespace db_AI_4
|
|||
|
{
|
|||
|
public partial class Dashboard : Form
|
|||
|
{
|
|||
|
|
|||
|
//Search Locations start
|
|||
|
|
|||
|
List<GetLocations> locations = new List<GetLocations>();
|
|||
|
public Dashboard()
|
|||
|
{
|
|||
|
InitializeComponent();
|
|||
|
|
|||
|
UpdateBinding();
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
private void UpdateBinding()
|
|||
|
{
|
|||
|
LocationListBox.DataSource = locations;
|
|||
|
LocationListBox.DisplayMember = "LocationInfo";
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
private void LocationSearchButton_Click(object sender, EventArgs e)
|
|||
|
{
|
|||
|
DataAccess db = new DataAccess();
|
|||
|
|
|||
|
locations = db.GetLocations(LocationTextBox.Text);
|
|||
|
|
|||
|
UpdateBinding();
|
|||
|
|
|||
|
}
|
|||
|
// Search Locations end
|
|||
|
|
|||
|
//Insert Locations start
|
|||
|
private void LocationInsertButton_Click(object sender, EventArgs e)
|
|||
|
{
|
|||
|
DataAccess db = new DataAccess();
|
|||
|
|
|||
|
int CapacityValue;
|
|||
|
CapacityValue = Convert.ToInt32(LocationCapacityInputBox.Text);
|
|||
|
CapacityValue = int.Parse(LocationCapacityInputBox.Text);
|
|||
|
|
|||
|
db.InsertLocations(StreetnameInsertBox.Text, Convert.ToInt32(LocationCapacityInputBox.Text), LocationNameInputBox.Text);
|
|||
|
|
|||
|
StreetnameInsertBox.Text = "";
|
|||
|
LocationCapacityInputBox.Text = "";
|
|||
|
LocationNameInputBox.Text = "";
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
// Insert Locations end
|
|||
|
|
|||
|
}
|
|||
|
}
|