remove addlocationlist
This commit is contained in:
parent
5840e64d27
commit
7f02aeb6d4
|
@ -36,9 +36,6 @@
|
|||
this.PaymentDateLabel = new System.Windows.Forms.Label();
|
||||
this.RentInsertButton = new System.Windows.Forms.Button();
|
||||
this.RentDateTimePicker = new System.Windows.Forms.DateTimePicker();
|
||||
this.ADDLocationListBox = new System.Windows.Forms.ListBox();
|
||||
this.ADDLocationLabel = new System.Windows.Forms.Label();
|
||||
this.ADDLocationButton = new System.Windows.Forms.Button();
|
||||
this.UserDisplayLabel = new System.Windows.Forms.Label();
|
||||
this.ShowRentListBox = new System.Windows.Forms.ListBox();
|
||||
this.ShowRentLabel = new System.Windows.Forms.Label();
|
||||
|
@ -53,7 +50,7 @@
|
|||
this.LocationListBox.Location = new System.Drawing.Point(9, 118);
|
||||
this.LocationListBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.LocationListBox.Name = "LocationListBox";
|
||||
this.LocationListBox.Size = new System.Drawing.Size(148, 199);
|
||||
this.LocationListBox.Size = new System.Drawing.Size(362, 199);
|
||||
this.LocationListBox.TabIndex = 0;
|
||||
//
|
||||
// LocationTextBox
|
||||
|
@ -88,7 +85,7 @@
|
|||
// RentDateLabel
|
||||
//
|
||||
this.RentDateLabel.AutoSize = true;
|
||||
this.RentDateLabel.Location = new System.Drawing.Point(188, 80);
|
||||
this.RentDateLabel.Location = new System.Drawing.Point(11, 330);
|
||||
this.RentDateLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.RentDateLabel.Name = "RentDateLabel";
|
||||
this.RentDateLabel.Size = new System.Drawing.Size(56, 13);
|
||||
|
@ -106,7 +103,7 @@
|
|||
//
|
||||
// RentInsertButton
|
||||
//
|
||||
this.RentInsertButton.Location = new System.Drawing.Point(352, 321);
|
||||
this.RentInsertButton.Location = new System.Drawing.Point(295, 328);
|
||||
this.RentInsertButton.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.RentInsertButton.Name = "RentInsertButton";
|
||||
this.RentInsertButton.Size = new System.Drawing.Size(76, 19);
|
||||
|
@ -117,42 +114,12 @@
|
|||
//
|
||||
// RentDateTimePicker
|
||||
//
|
||||
this.RentDateTimePicker.Location = new System.Drawing.Point(247, 76);
|
||||
this.RentDateTimePicker.Location = new System.Drawing.Point(78, 327);
|
||||
this.RentDateTimePicker.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.RentDateTimePicker.Name = "RentDateTimePicker";
|
||||
this.RentDateTimePicker.Size = new System.Drawing.Size(182, 20);
|
||||
this.RentDateTimePicker.TabIndex = 21;
|
||||
//
|
||||
// ADDLocationListBox
|
||||
//
|
||||
this.ADDLocationListBox.FormattingEnabled = true;
|
||||
this.ADDLocationListBox.Location = new System.Drawing.Point(247, 118);
|
||||
this.ADDLocationListBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.ADDLocationListBox.Name = "ADDLocationListBox";
|
||||
this.ADDLocationListBox.Size = new System.Drawing.Size(182, 199);
|
||||
this.ADDLocationListBox.TabIndex = 23;
|
||||
//
|
||||
// ADDLocationLabel
|
||||
//
|
||||
this.ADDLocationLabel.AutoSize = true;
|
||||
this.ADDLocationLabel.Location = new System.Drawing.Point(244, 43);
|
||||
this.ADDLocationLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.ADDLocationLabel.Name = "ADDLocationLabel";
|
||||
this.ADDLocationLabel.Size = new System.Drawing.Size(87, 13);
|
||||
this.ADDLocationLabel.TabIndex = 24;
|
||||
this.ADDLocationLabel.Text = "Locations-Added";
|
||||
//
|
||||
// ADDLocationButton
|
||||
//
|
||||
this.ADDLocationButton.Location = new System.Drawing.Point(171, 149);
|
||||
this.ADDLocationButton.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.ADDLocationButton.Name = "ADDLocationButton";
|
||||
this.ADDLocationButton.Size = new System.Drawing.Size(56, 19);
|
||||
this.ADDLocationButton.TabIndex = 25;
|
||||
this.ADDLocationButton.Text = "ADD";
|
||||
this.ADDLocationButton.UseVisualStyleBackColor = true;
|
||||
this.ADDLocationButton.Click += new System.EventHandler(this.ADDLocationButton_Click);
|
||||
//
|
||||
// UserDisplayLabel
|
||||
//
|
||||
this.UserDisplayLabel.AutoSize = true;
|
||||
|
@ -166,17 +133,17 @@
|
|||
// ShowRentListBox
|
||||
//
|
||||
this.ShowRentListBox.FormattingEnabled = true;
|
||||
this.ShowRentListBox.Location = new System.Drawing.Point(473, 118);
|
||||
this.ShowRentListBox.Location = new System.Drawing.Point(384, 118);
|
||||
this.ShowRentListBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.ShowRentListBox.Name = "ShowRentListBox";
|
||||
this.ShowRentListBox.Size = new System.Drawing.Size(367, 199);
|
||||
this.ShowRentListBox.Size = new System.Drawing.Size(351, 199);
|
||||
this.ShowRentListBox.TabIndex = 28;
|
||||
this.ShowRentListBox.SelectedIndexChanged += new System.EventHandler(this.ShowRentListBox_SelectedIndexChanged);
|
||||
//
|
||||
// ShowRentLabel
|
||||
//
|
||||
this.ShowRentLabel.AutoSize = true;
|
||||
this.ShowRentLabel.Location = new System.Drawing.Point(470, 43);
|
||||
this.ShowRentLabel.Location = new System.Drawing.Point(381, 43);
|
||||
this.ShowRentLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.ShowRentLabel.Name = "ShowRentLabel";
|
||||
this.ShowRentLabel.Size = new System.Drawing.Size(91, 13);
|
||||
|
@ -185,7 +152,7 @@
|
|||
//
|
||||
// ShowRentButton
|
||||
//
|
||||
this.ShowRentButton.Location = new System.Drawing.Point(553, 77);
|
||||
this.ShowRentButton.Location = new System.Drawing.Point(464, 74);
|
||||
this.ShowRentButton.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.ShowRentButton.Name = "ShowRentButton";
|
||||
this.ShowRentButton.Size = new System.Drawing.Size(56, 19);
|
||||
|
@ -196,7 +163,7 @@
|
|||
//
|
||||
// RentedTextBox
|
||||
//
|
||||
this.RentedTextBox.Location = new System.Drawing.Point(473, 77);
|
||||
this.RentedTextBox.Location = new System.Drawing.Point(384, 74);
|
||||
this.RentedTextBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.RentedTextBox.Name = "RentedTextBox";
|
||||
this.RentedTextBox.Size = new System.Drawing.Size(76, 20);
|
||||
|
@ -210,22 +177,19 @@
|
|||
this.LoggedInUserLabel.Size = new System.Drawing.Size(100, 13);
|
||||
this.LoggedInUserLabel.TabIndex = 32;
|
||||
this.LoggedInUserLabel.Text = "LoggedInUserLabel";
|
||||
this.LoggedInUserLabel.Click += new System.EventHandler(this.label1_Click);
|
||||
this.LoggedInUserLabel.Click += new System.EventHandler(this.LoggedInUser_Click);
|
||||
//
|
||||
// Dashboard
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(858, 392);
|
||||
this.ClientSize = new System.Drawing.Size(750, 363);
|
||||
this.Controls.Add(this.LoggedInUserLabel);
|
||||
this.Controls.Add(this.RentedTextBox);
|
||||
this.Controls.Add(this.ShowRentButton);
|
||||
this.Controls.Add(this.ShowRentLabel);
|
||||
this.Controls.Add(this.ShowRentListBox);
|
||||
this.Controls.Add(this.UserDisplayLabel);
|
||||
this.Controls.Add(this.ADDLocationButton);
|
||||
this.Controls.Add(this.ADDLocationLabel);
|
||||
this.Controls.Add(this.ADDLocationListBox);
|
||||
this.Controls.Add(this.RentDateTimePicker);
|
||||
this.Controls.Add(this.RentDateLabel);
|
||||
this.Controls.Add(this.PaymentDateLabel);
|
||||
|
@ -253,9 +217,6 @@
|
|||
private System.Windows.Forms.Label PaymentDateLabel;
|
||||
private System.Windows.Forms.Button RentInsertButton;
|
||||
private System.Windows.Forms.DateTimePicker RentDateTimePicker;
|
||||
private System.Windows.Forms.ListBox ADDLocationListBox;
|
||||
private System.Windows.Forms.Label ADDLocationLabel;
|
||||
private System.Windows.Forms.Button ADDLocationButton;
|
||||
private System.Windows.Forms.Label UserDisplayLabel;
|
||||
private System.Windows.Forms.ListBox ShowRentListBox;
|
||||
private System.Windows.Forms.Label ShowRentLabel;
|
||||
|
|
|
@ -39,11 +39,6 @@ namespace db_AI_4
|
|||
|
||||
|
||||
//Loading of the Selected Locations
|
||||
ADDLocationListBox.DataSource = rentlocation;
|
||||
ADDLocationListBox.DisplayMember = "LocationInfo";
|
||||
|
||||
addlocationBinding.DataSource = rentlocation;
|
||||
ADDLocationListBox.DataSource = addlocationBinding;
|
||||
|
||||
// Rented Locations
|
||||
ShowRentListBox.DataSource = rentedlocations;
|
||||
|
@ -74,14 +69,14 @@ namespace db_AI_4
|
|||
DataAccess db = new DataAccess();
|
||||
try
|
||||
{
|
||||
GetLocations selectedItem = (GetLocations)ADDLocationListBox.SelectedItem;
|
||||
GetLocations selectedItem = (GetLocations)LocationListBox.SelectedItem;
|
||||
//var command = "SELECT rent_price_id FROM dbo.locations WHERE locations.location_name = @Location_Name";
|
||||
selectedItem = db.GetLocations(selectedItem.location_name)[0];
|
||||
db.InsertRent(RentDateTimePicker.Value.Date.ToString("yyyyMMdd"), GetMembers.member_id, selectedItem.rent_price_id, selectedItem.location_id);
|
||||
db.InsertRent(RentDateTimePicker.Value.Date.ToString("yyyyMMdd"), GetMembers.member_id, selectedItem.rent_price_id, selectedItem.location_id);
|
||||
//RentDateTimePicker.Text = "";
|
||||
}
|
||||
catch
|
||||
{
|
||||
{
|
||||
MessageBox.Show("Please select a location and a date.");
|
||||
}
|
||||
|
||||
|
@ -89,17 +84,6 @@ namespace db_AI_4
|
|||
// Insert Rent end
|
||||
|
||||
|
||||
//Add Location to ADDBox start
|
||||
private void ADDLocationButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
GetLocations selectedItem = (GetLocations)LocationListBox.SelectedItem;
|
||||
|
||||
rentlocation.Add(selectedItem);
|
||||
|
||||
UpdateBinding();
|
||||
|
||||
}
|
||||
|
||||
private void Dashboard_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
@ -117,14 +101,14 @@ namespace db_AI_4
|
|||
private void ShowRentListBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void label1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//Add Location to ADDBox end
|
||||
|
||||
}
|
||||
|
||||
private void LoggedInUser_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//Add Location to ADDBox end
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue