private void dataGridView1_CellContentClick_1(object sender, DataGridViewCellEventArgs e) { if (dgv_Pending.Columns[e.ColumnIndex].Name == "Accept") { MessageBox.Show(dgv_Pending.CurrentRow.Cells[2].Value.ToString()); string[] param = { "r_id" }; int[] val = { Convert.ToInt32(dgv_Pending.CurrentRow.Cells[2].Value.ToString()) }; _sqlMng.insertDB("acceptR", param, val); dgv_Pending.Refresh(); _utils.Load_DataGrid(dgv_Pending, new SQLConnection(), "sp_view_cpending"); } else if (dgv_Pending.Columns[e.ColumnIndex].Name == "Reject") { string[] param = { "r_id" }; int[] val = { Convert.ToInt32(dgv_Pending.CurrentRow.Cells[2].Value.ToString()) }; _sqlMng.insertDB("rejectR", param, val); } }
private void dataGridView1_CellContentClick_1(object sender, DataGridViewCellEventArgs e) { if (dgv_AReservations.Columns[e.ColumnIndex].Name == "Completed") { string[] param = { "r_id" }; int[] val = { Convert.ToInt32(dgv_AReservations.CurrentRow.Cells[1].Value.ToString()) }; _sqlMng.insertDB("sp_comR", param, val); _utils.Load_DataGrid(dgv_AReservations, _sqlMng, "sp_view_AReservations"); } }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (dgv_UserReq.Columns[e.ColumnIndex].Name == "Allow") { string[] param = { "std_id" }; int[] val = { Convert.ToInt32(dgv_UserReq.CurrentRow.Cells[2].Value.ToString()) }; _sqlMng.insertDB("sp_approveUser", param, val); dgv_UserReq.Refresh(); _utils.Load_DataGrid(dgv_UserReq, _sqlMng, "sp_getusers"); } else if (dgv_UserReq.Columns[e.ColumnIndex].Name == "Decline") { string[] param = { "std_id" }; int[] val = { Convert.ToInt32(dgv_UserReq.CurrentRow.Cells[2].Value.ToString()) }; _sqlMng.insertDB("sp_declineUser", param, val); dgv_UserReq.Refresh(); _utils.Load_DataGrid(dgv_UserReq, _sqlMng, "sp_getusers"); } }
private void dataGridView1_CellContentClick_1(object sender, DataGridViewCellEventArgs e) { if (dgv_AdminReq.Columns[e.ColumnIndex].Name == "Approve") { string[] param = { "a_id" }; int[] val = { Convert.ToInt32(dgv_AdminReq.CurrentRow.Cells[2].Value.ToString()) }; _sqlMng.insertDB("sp_approveAdmin", param, val); dgv_AdminReq.Refresh(); _utils.Load_DataGrid(dgv_AdminReq, _sqlMng, "sp_adminReq_view"); MessageBox.Show("Admin Added"); } else if (dgv_AdminReq.Columns[e.ColumnIndex].Name == "Decline") { string[] param = { "a_id" }; int[] val = { Convert.ToInt32(dgv_AdminReq.CurrentRow.Cells[2].Value.ToString()) }; _sqlMng.insertDB("sp_declineAdmin", param, val); _utils.Load_DataGrid(dgv_AdminReq, _sqlMng, "sp_adminReq_view"); dgv_AdminReq.Refresh(); } }
//SqlMng mng = new SqlMng(); private void btn_AddSlots_Click(object sender, EventArgs e) { string[] param = { "s_name" }; string[] val = { txt_Slot.Text }; if (!_validate.checkEmpty(val)) { _sqlMng.insertDB("sp_addSlot", param, val); } else { } }
//SqlMng mng = new SqlMng(); private void btn_AddDevice_Click(object sender, EventArgs e) { string[] param = { "d_name" }; string[] val = { txt_Devices.Text }; if (!_validate.checkEmpty(val)) { _sqlMng.insertDB("add_device", param, val); _utils.Load_DataGrid(dgv_Devices, _sqlMng, "sp_getDevices"); } else { MessageBox.Show("Please provide the Device Name"); } // dataGridView1.Refresh(); }
private void btn_submit_Click(object sender, EventArgs e) { bool IsValidPass = _validate.IsValidPassword(txt_pass.Text); bool IsValidEmail = _validate.IsValidEmail(txt_email.Text); bool EmailPresent = _validate.EmailPresent(txt_email.Text); if (txt_pass.Text.Equals(txt_c_pass.Text) && IsValidPass && IsValidEmail && !EmailPresent) { string[] param = { "a_name", "a_email", "a_pass" }; string[] values = { txt_name.Text, txt_email.Text, txt_pass.Text }; //SqlMng mng = new SqlMng(); if (!_validate.checkEmpty(values)) { sqlMng.insertDB("admin_signup", param, values); MessageBox.Show("Your request has been sent"); } else { MessageBox.Show("All Fields are required!"); } } else if (!IsValidPass) { MessageBox.Show("Password must be more then 6 characters!"); } else if (!IsValidEmail) { MessageBox.Show("Enter a proper Email"); } else if (EmailPresent) { MessageBox.Show("Email already in use"); } else if (!txt_pass.Text.Equals(txt_c_pass.Text)) { MessageBox.Show("Passwords do not match"); } }