private void Form9_FormClosing(object sender, FormClosingEventArgs e) { if (auto == 1) { DataAcsess dataAcsess = new DataAcsess(); dataAcsess.Name = comboBox1.Text; dataAcsess.Id = Id; dataAcsess.updateShow(); } }
private void button2_Click(object sender, EventArgs e) { if (Auto == 1) { DataAcsess dataAcsess = new DataAcsess(); dataAcsess.Name = Main.Namee; dataAcsess.Id = Id; dataAcsess.updateShow(); this.Close(); } else { if (comboBox1.Text != "" && textBox1.Text != "") { DataAcsess dataAcsess = new DataAcsess(); dataAcsess.Name = comboBox1.Text; dataAcsess.TitleMessage = textBox1.Text; dataAcsess.MainText = textBox2.Text; dataAcsess.SendFrom = Main.Namee; int a = dataAcsess.insertMessage(); if (a == 1) { MessageBox.Show("پیام ارسال شد"); textBox1.Text = ""; textBox2.Text = ""; } else { MessageBox.Show("مشکل در ارسال پیام"); } } else { MessageBox.Show("لطفا گیرنده و موضوع رو پر کنید"); } } }