Пример #1
0
 private void dgv_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex > -1 && e.RowIndex > -1)
     {
         MainClass.OpenCardPerson(dgv.Rows[e.RowIndex].Cells["Id"].Value.ToString(), this, e.RowIndex);
     }
 }
Пример #2
0
 private void dgvRight_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         string abId = dgvRight.Rows[dgvRight.CurrentCell.RowIndex].Cells["Id"].Value.ToString();
         if (abId != "")
         {
             MainClass.OpenCardPerson(abId, this, dgvRight.CurrentRow.Index);
         }
     }
 }
Пример #3
0
 //открытие карточки для конкретного человека
 private void OpenPersonCard()
 {
     if (dgvAbitList.CurrentCell != null && dgvAbitList.CurrentCell.RowIndex > -1)
     {
         string abId = dgvAbitList.Rows[dgvAbitList.CurrentCell.RowIndex].Cells["Id"].Value.ToString();
         if (abId != "")
         {
             MainClass.OpenCardPerson(abId, this, dgvAbitList.CurrentRow.Index);
         }
     }
 }
Пример #4
0
 //открытие карточки
 private void OpenCard()
 {
     if (dgvChanges.CurrentCell != null && dgvChanges.CurrentCell.RowIndex > -1)
     {
         string perId = dgvChanges.Rows[dgvChanges.CurrentCell.RowIndex].Cells["Id"].Value.ToString();
         if (perId != "")
         {
             MainClass.OpenCardPerson(perId, this, dgvChanges.CurrentRow.Index);
         }
     }
 }
Пример #5
0
 protected override void OpenCard(string id, BaseFormEx formOwner, int?index)
 {
     MainClass.OpenCardPerson(id, formOwner, index);
 }
Пример #6
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            loadClass = new LoadFromInet();
            bdcInet   = loadClass.BDCInet;

            int fileNum = 0;

            string barcText = tbPersonNum.Text.Trim();

            if (barcText == string.Empty)
            {
                WinFormsServ.Error("Не введен номер");
                return;
            }

            //if (barcText.Length == 7)
            //{
            //    if (barcText.StartsWith("2"))
            //    {
            //        WinFormsServ.Error("Выбран человек, подавший заявления в магистратуру");
            //        return;
            //    }

            //    barcText = barcText.Substring(1);
            //}

            if (!int.TryParse(barcText, out fileNum))
            {
                WinFormsServ.Error("Неправильно введен номер");
                return;
            }

            if (MainClass.CheckPersonBarcode(fileNum))
            {
                try
                {
                    //extPerson person = loadClass.GetPersonByBarcode(fileNum);
                    DataTable dtEge = new DataTable();

                    //if(person != null)
                    //{
                    //    string queryEge = "SELECT EgeMark.Id, EgeMark.EgeExamNameId AS ExamId, EgeMark.Value, EgeCertificate.PrintNumber, EgeCertificate.Number, EgeMark.EgeCertificateId FROM EgeMark LEFT JOIN EgeCertificate ON EgeMark.EgeCertificateId = EgeCertificate.Id LEFT JOIN Person ON EgeCertificate.PersonId = Person.Id";
                    //    DataSet dsEge = bdcInet.GetDataSet(queryEge + " WHERE Person.Barcode = " + fileNum + " ORDER BY EgeMark.EgeCertificateId ");
                    //    dtEge = dsEge.Tables[0];
                    //}

                    CardFromInet crd = new CardFromInet(fileNum, null, true);
                    crd.ToUpdateList += UpdateDataGrid;
                    crd.Show();
                }
                catch (Exception exc)
                {
                    WinFormsServ.Error(exc.Message);
                    tbPersonNum.Text = "";
                    tbPersonNum.Focus();
                }
            }
            else
            {
                UpdateDataGrid();
                using (PriemEntities context = new PriemEntities())
                {
                    extPersonAll person = (from per in context.extPersonAll
                                           where per.Barcode == fileNum
                                           select per).FirstOrDefault();

                    string fio    = person.FIO;
                    string num    = person.PersonNum;
                    string persId = person.Id.ToString();

                    WinFormsServ.Search(this.dgvAbiturients, "PersonNum", num);
                    DialogResult dr = MessageBox.Show(string.Format("Абитуриент {0} с данным номером баркода уже импортирован в базу.\nОткрыть карточку абитуриента?", fio), "Внимание", MessageBoxButtons.YesNo);
                    if (dr == System.Windows.Forms.DialogResult.Yes)
                    {
                        MainClass.OpenCardPerson(persId, this, null);
                    }
                }
            }

            tbPersonNum.Text = "";
            tbPersonNum.Focus();
            loadClass.CloseDB();
        }
Пример #7
0
 protected override void OpenCard(string itemId, BaseFormEx formOwner, int?index)
 {
     MainClass.OpenCardPerson(itemId, this, dgvAbiturients.CurrentRow.Index);
 }
Пример #8
0
 private void btnOpenPersonCard_Click(object sender, EventArgs e)
 {
     MainClass.OpenCardPerson(_PersonId.ToString(), null, null);
 }