private void btnAdd_Click(object sender, EventArgs e) { //Glarus.GlobalVars.BufferString = "1"; //add new pacient frmPacient.iIdRecord = 0; frmPacient fr = new frmPacient(); //fr.Owner = this; if (fr.ShowDialog() == DialogResult.OK) { //создан новый пациент } }
//private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) //{ // dataGridView1.Columns[0].Visible=false; // dataGridView1.Columns[1].HeaderCell.Value = "Фамилия"; // dataGridView1.Columns[2].HeaderCell.Value = "Имя"; // dataGridView1.Columns[3].HeaderCell.Value = "Отчество"; // dataGridView1.Columns[4].HeaderCell.Value = "Дата рождения"; // StringFormat sf = new StringFormat(); // sf.Alignment = StringAlignment.Far; // по горизонтали (к правому краю) // sf.LineAlignment = StringAlignment.Center; // по вертикали (по центру) // if ((e.ColumnIndex == -1) && (e.RowIndex >= 0)) // { // int lastDisplyIndex = dataGridView1.Rows.GetLastRow(DataGridViewElementStates.Displayed) + 1; // dataGridView1.RowHeadersWidth = (int)(e.Graphics.MeasureString(lastDisplyIndex.ToString(), // dataGridView1.RowHeadersDefaultCellStyle.Font).Width + 12); // e.Handled = true; // Rectangle rc = e.CellBounds; // e.Paint(rc, DataGridViewPaintParts.All); // rc.Inflate(-3, 0); //'Отступ слева, справа // e.Graphics.DrawString((e.RowIndex + 1).ToString(), dataGridView1.RowHeadersDefaultCellStyle.Font, // new SolidBrush(dataGridView1.RowHeadersDefaultCellStyle.ForeColor), rc, sf); // } //} private void btnFind_Click(object sender, EventArgs e) { frmPacient.iIdRecord = Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value); frmPacient fr = new frmPacient(); //fr.Owner = this; if (fr.ShowDialog() == DialogResult.OK) { //создан новый пациент } //frmPacient.iIdRecord = Convert.ToInt32(txtPacient.Text); //frmPacient fr = new frmPacient(); //fr.ShowDialog(); //MySqlConnection myConnection = new MySqlConnection(Glarus.GlobalVars.ConnectionString); //myConnection.Open(); //MySqlDataAdapter myAdapter = new MySqlDataAdapter(); //DataSet myDataSet = new DataSet(); //myCmd = new MySqlCommand(); //myCmd.Connection = myConnection; //string sSQL; //sSQL = "SELECT idPacient,Family,Name,SecondName,Birthday FROM pacient WHERE idPacient=" ; //myCmd.CommandText = sSQL; }