private void FillDGV() { DGV_Patient.DataSource = Pa.Get_All_Patient(); DGV_Patient.Columns[0].HeaderText = "الرقم "; DGV_Patient.Columns[1].HeaderText = "الاسم "; DGV_Patient.Columns[2].HeaderText = "العنوان "; DGV_Patient.Columns[3].HeaderText = "رقم الموبايل "; DGV_Patient.Columns[4].HeaderText = "الهاتف الأرضي "; DGV_Patient.Columns[5].HeaderText = "الجنس "; DGV_Patient.Columns[6].HeaderText = "المواليد "; DGV_Patient.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; DGV_Patient.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; DGV_Patient.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; DGV_Patient.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; DGV_Patient.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; foreach (DataGridViewColumn column in DGV_Patient.Columns) { column.SortMode = DataGridViewColumnSortMode.NotSortable; } DGV_Patient.Sort(DGV_Patient.Columns[0], ListSortDirection.Ascending); }
private void Add_Patient_Load(object sender, EventArgs e) { string t = "1900-01-01"; DTP_Date.Value = Convert.ToDateTime(t); DTP_Date.Checked = false; DGV_Patient.ClearSelection(); }
private void Btn_Reset_Click(object sender, EventArgs e) { Btn_Add.Enabled = true; Btn_Update.Enabled = false; RText_Name.ResetText(); RText_Address.ResetText(); string t = "1900-01-01"; DTP_Date.Value = Convert.ToDateTime(t); DTP_Date.Checked = false; RText_Number.ResetText(); RText_Landline.ResetText(); Radio_F.Checked = false; Radio_M.Checked = true; DGV_Patient.ClearSelection(); }
private void DGV_Patient_DoubleClick(object sender, EventArgs e) { try { if (DGV_Patient.SelectedRows.Count == 0) { return; } RText_Name.Text = this.DGV_Patient.CurrentRow.Cells[1].Value.ToString(); string Gender = this.DGV_Patient.CurrentRow.Cells[5].Value.ToString(); if (Gender == "ذكر") { Radio_M.Checked = true; } else { Radio_F.Checked = true; } if (string.IsNullOrEmpty(this.DGV_Patient.CurrentRow.Cells[6].Value.ToString())) { string t = "1900-01-01"; DTP_Date.Value = Convert.ToDateTime(t); } else { DTP_Date.Value = Convert.ToDateTime(this.DGV_Patient.CurrentRow.Cells[6].Value.ToString()); } RText_Number.Text = this.DGV_Patient.CurrentRow.Cells[3].Value.ToString(); RText_Landline.Text = this.DGV_Patient.CurrentRow.Cells[4].Value.ToString(); RText_Address.Text = this.DGV_Patient.CurrentRow.Cells[2].Value.ToString(); DGV_Patient.ClearSelection(); Btn_Update.Enabled = true; Enable_BtnAdd = false; Btn_Add.Enabled = false; } catch (Exception ex) { } }