db_AI-4/csharp/marketconnectionNET2.0/db_AI-4_V3/db_AI-4/Dashboard.cs

86 lines
2.1 KiB
C#
Raw Normal View History

2017-07-26 18:18:37 +02:00
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
2017-07-26 20:20:14 +02:00
// Insert Rent start
private void RentInsertButton_Click(object sender, EventArgs e)
{
DataAccess db = new DataAccess();
int RentPriceID;
RentPriceID = 1;
int MemberID;
MemberID = 1;
db.InsertRent(RentDateTimePicker.Value.Date.ToString("yyyyMMdd"), PaymentDateTimePicker2.Value.Date.ToString("yyyyMMdd"), RentPriceID, MemberID);
RentDateTimePicker.Text = "";
PaymentDateTimePicker2.Text = "";
}
// Insert Rent end
2017-07-26 18:18:37 +02:00
}
}