/// <summary> /// Signals that a request has been completed, therefore it no longer /// has to display on the list /// </summary> private void FoodRequest_Completed(object sender, DataGridViewCellEventArgs e) { // Get the values needed to identify each unique row string date = RequestsList.Rows[e.RowIndex].Cells[8].Value.ToString(); string time = RequestsList.Rows[e.RowIndex].Cells[9].Value.ToString(); string uid = RequestsList.Rows[e.RowIndex].Cells[10].Value.ToString(); // Have to reformat the string to fix Visual studio's stupid crap // Visual studio formats date to: "MM/DD/YYYY HH:MM:SS" When it needs to be "YYYY-MM-DD" date = date.Replace("/", "-"); date = date.Substring(0, date.IndexOf(" ")); // Remove everything after the space string[] _splitdate = date.Split('-'); // Split up d, m, y string[] _reverseddate = new string[3]; _reverseddate[0] = _splitdate[2]; // Map date to correct area _reverseddate[1] = _splitdate[0]; // Map month to correct area _reverseddate[2] = _splitdate[1]; // Map day to correct area date = String.Join("-", _reverseddate); // Combine strings // If it was able to complete the request, reload the list if (Requests_Handler.Complete_Request(uid, date, time)) { Display_Lists(); } }
public void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { timedRowToDel = dataGridView1.Rows[e.RowIndex].Cells[6].Value.ToString(); Debug.WriteLine(timedRowToDel); Requests_Handler.Complete_Request(timedRowToDel, "NEWTimedRequest"); Display_Lists(); }
private void Add_New_User_Button_CellContentClick(object sender, DataGridViewCellEventArgs e) { rowToDel = Add_New_User_Button.Rows[e.RowIndex].Cells[4].Value.ToString(); Debug.WriteLine(rowToDel); Requests_Handler.Complete_Request(rowToDel, "NEWVisitorSignIn"); Requests_Handler.Show_Visitors(); Add_New_User_Button.DataSource = Requests_Handler.DataTable1; MessageBox.Show("Thanks for visiting!"); }
/// <summary> /// Signals that a request has been completed, therefore it no longer /// has to display on the list /// </summary> public void FoodRequest_Completed(object sender, DataGridViewCellEventArgs e) { rowToDel = Add_New_User_Button.Rows[e.RowIndex].Cells[10].Value.ToString(); Debug.WriteLine(rowToDel); Requests_Handler.Complete_Request(rowToDel, "NEWFoodRequest"); // Get the values needed to identify each unique row /* string date = RequestsList.Rows[e.RowIndex].Cells[8].Value.ToString(); * string time = RequestsList.Rows[e.RowIndex].Cells[9].Value.ToString(); * string uid = RequestsList.Rows[e.RowIndex].Cells[10].Value.ToString(); * * // Have to reformat the string to fix Visual studio's stupid crap * // Visual studio formats date to: "MM/DD/YYYY HH:MM:SS" When it needs to be "YYYY-MM-DD" * date = date.Replace("/", "-"); * date = date.Substring(0, date.IndexOf(" ")); // Remove everything after the space * * string[] _splitdate = date.Split('-'); // Split up d, m, y * string[] _reverseddate = new string[3]; * * _reverseddate[0] = _splitdate[2]; // Map date to correct area * _reverseddate[1] = _splitdate[0]; // Map month to correct area * _reverseddate[2] = _splitdate[1]; // Map day to correct area * * date = String.Join("-", _reverseddate); // Combine strings * * * * // If it was able to complete the request, reload the list * if (Requests_Handler.Complete_Request(uid, date, time)) * { * Display_Lists(); * } */ Display_Lists(); }