private void deleteP_Click(object sender, EventArgs e) { // SqlConnection con = new SqlConnection(); con.ConnectionString = Helper.ConnectionString; // if (bunifuCustomDataGrid2.SelectedCells.Count > 0) { SqlDataAdapter adapt = new SqlDataAdapter("select class_id from classrooms where class_name= '" + className + "'", con); DataTable dt = new DataTable(); adapt.Fill(dt); int ID = int.Parse(dt.Rows[0][0].ToString());//Getting the ID of The Classroom SqlDataAdapter add = new SqlDataAdapter("select participant_id from participant where fullname= '" + participantName + "'", con); DataTable data = new DataTable(); add.Fill(data); int id = int.Parse(data.Rows[0][0].ToString());//Getting the ID of The Participant DialogResult result = Dialogue1.Show("Are You Sure?", "", "Ok", "Cancel"); if (result == DialogResult.Yes) { con.Open(); String query = "DELETE FROM classlist WHERE class_id= '" + ID + "' AND facilitator_id = '" + Program.user_id + "' AND participant_id= '" + id + "' "; SqlDataAdapter sda = new SqlDataAdapter(query, con); int m = sda.SelectCommand.ExecuteNonQuery(); con.Close(); if (m > 0) { load_class(); load_participant(); Dialogue.Show("Successfully Deleted!", "", "Ok", "Cancel"); } else { Dialogue.Show("Fail to Delete!", "", "Ok", "Cancel"); load_class(); load_participant(); } }//end if result } else { Dialogue.Show("Nothing Selected", "", "Ok", "Cancel"); } }
public void StartDialogue(Dialogue1 dialogue) { nameText.text = dia.name; sentences.Clear(); foreach (string sentence in dia.sentences) { sentences.Enqueue(sentence); } DisplayNextSentence(); }
public void AddDialogue1(float _time, string _text) { GameObject obj = Instantiate(dialogue1_prefab, transform); Dialogue1 dialogue1 = obj.GetComponent <Dialogue1>(); dialogue1.Init(this); dialogue1.SetTime(_time); dialogue1.SetText(_text); obj.SetActive(false); object_pool.Enqueue(obj); }
public void StartDialogue(Dialogue1 dialogue) { Debug.Log("Starting convo with " + dialogue.name); sentences.Clear(); foreach (string sentence in dialogue.sentences) { sentences.Enqueue(sentence); } DisplayNextSentence(); }