private void Btn_SaveSetting_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(RText_Name.Text) || string.IsNullOrEmpty(RText_Number.Text) || string.IsNullOrEmpty(RText_Email.Text)) { MessageBox.Show("الرجاء إكمال المعلومات المطلوبة", "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { Students_Mangement_System.Properties.Settings.Default.Name = RText_Name.Text; Students_Mangement_System.Properties.Settings.Default.Number = Convert.ToInt32(RText_Number.Text); Students_Mangement_System.Properties.Settings.Default.Email = RText_Email.Text.ToString(); Properties.Settings.Default.Save(); Properties.Settings.Default.Upgrade(); RText_Email.ResetText(); RText_Name.ResetText(); RText_Number.ResetText(); if (MessageBox.Show(" هل تريد إعادة تشغيل البرنامج الأن أو لاحقا \n لحفظ الإعدادات ؟ ", " تحذير ", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { Application.Restart(); } } }
private void Frm_Setting_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F5) { RText_Name.ResetText(); RText_Number.ResetText(); RText_Email.ResetText(); } }
private void Setting_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F5) { RText_Name.ResetText(); RText_Number.ResetText(); RText_Email.ResetText(); Pic_Box.Image = null; } }
private void Btn_Reset_Click(object sender, EventArgs e) { Btn_Add.Enabled = true; Btn_Update.Enabled = false; RText_Name.ResetText(); Radio_F.Checked = false; Radio_M.Checked = true; string t = "1900-01-01"; DTP_Date.Value = Convert.ToDateTime(t); DTP_Date.Checked = false; RText_Number.ResetText(); RText_Email.ResetText(); DGV_Doctor.ClearSelection(); }
private void Btn_SaveSetting_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(RText_Name.Text) || string.IsNullOrEmpty(RText_Number.Text) || string.IsNullOrEmpty(RText_Email.Text)) { MessageBox.Show("الرجاء إكمال المعلومات المطلوبة", "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { Properties.Settings.Default.Name = RText_Name.Text; Properties.Settings.Default.Number = Convert.ToInt32(RText_Number.Text); Properties.Settings.Default.Email = RText_Email.Text.ToString(); try { Pic_Box.Image.Save(Path.Combine(Environment.CurrentDirectory, "PIC\\" + namePicture + "")); Properties.Settings.Default.Image = Path.Combine(Environment.CurrentDirectory, "PIC\\" + namePicture + "").ToString(); } catch (Exception ex) { } finally { Properties.Settings.Default.Save(); RText_Email.ResetText(); RText_Name.ResetText(); RText_Number.ResetText(); Pic_Box.Image = null; if (MessageBox.Show(" هل تريد إعادة تشغيل البرنامج الأن أو لاحقا \n لحفظ الإعدادات ؟ ", " تحذير ", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { Application.Restart(); Environment.Exit(0); } } } }