コード例 #1
0
 void loadCleanKarta()
 {
     ___BASA__DataSet.Patients.Clear();
     this.Text = "Карточка: Новая";
     ___BASA__DataSet.PatientsRow newPatRow = this.___BASA__DataSet.Patients.AddPatientsRow(null, null, "", "", DateTime.Today, "", "", DateTime.Today, "", "", null, "", "", "", null, null, null, "");
     newPatRow.Uliza  = newPatRow.Gorod = 1;
     newPatRow.Rabota = newPatRow.Professia = 2;
     change();
 }
コード例 #2
0
        bool check_Basa()
        {
            bool da = true;

            if (PID == 0)
            {
                ___BASA__DataSet.PatientsRow CurPatrow = ___BASA__DataSet.Patients[0];
                foreach (DataRow Prow in patientsTableAdapter.GetDataByAllColumns(CurPatrow.PF, CurPatrow.PI, CurPatrow.PO, CurPatrow.PBD, CurPatrow.Gorod, CurPatrow.Uliza).Rows)
                {
                    if (kartaTableAdapter.ScalarQueryCuontByPID((int)Prow["PID"]) > 0)
                    {
                        da = false;
                        break;
                    }
                }
            }
            return(da);
        }
コード例 #3
0
        private void loadPatientKarta()
        {
            patientsTableAdapter.FillBy(___BASA__DataSet.Patients, PID);
            ___BASA__DataSet.PatientsRow PatRow = ___BASA__DataSet.Patients[0];
            this.Text = "Карточка: " + PatRow.PFIO;
            if (!PatRow.IsUlizaNull())
            {
                ulizaBindingSource.Position = ulizaBindingSource.Find("UlizaID", PatRow.Uliza);
            }
            else
            {
                ulizaBindingSource.Position = ulizaBindingSource.Find("UlizaID", 1);
            }

            if (!PatRow.IsGorodNull())
            {
                oblastBindingSource.Position = oblastBindingSource.Find("OblastID", ___BASA__DataSet.Gorod.FindByGorodID((int)PatRow.Gorod).Oblast);
                gorodBindingSource.Position  = gorodBindingSource.Find("GorodID", PatRow.Gorod);
            }
            else
            {
                oblastBindingSource.Position = oblastBindingSource.Find("OblastID", 1);
                gorodBindingSource.Position  = gorodBindingSource.Find("GorodID", 1);
            }
            if (!PatRow.IsRabotaNull())
            {
                patientsRabotaBindingSource.Position = patientsRabotaBindingSource.Find("ID", PatRow.Rabota);
            }
            else
            {
                patientsRabotaBindingSource.Position = patientsRabotaBindingSource.Find("ID", 2);
            }
            if (!PatRow.IsSexNull())
            {
                sexBindingSource.Position = sexBindingSource.Find("ID", PatRow.Sex.ToString());
            }
            else
            {
                textBoxS.Text = "";
                PatRow.SexRow = null;
            }
            if (!PatRow.IsProfessiaNull())
            {
                patientsProfessiaBindingSource.Position = patientsProfessiaBindingSource.Find("ProfessiaID", PatRow.Professia);
            }
            else
            {
                patientsProfessiaBindingSource.Position = patientsProfessiaBindingSource.Find("ProfessiaID", 2);
            }
            if (!PatRow.IsPBDNull())
            {
                textBoxVozr.Text = Vozrast((DateTime)PatRow.PBD).ToString();
            }
            else
            {
                textBoxVozr.Text = "";
            }

            moneyToolStripMenuItem.Enabled   = newTRToolStripMenuItem.Enabled = chengToolStripMenuItem.Enabled =
                toolStripButtonMoney.Enabled = toolStripButtonNewTreat.Enabled = toolStripButton_change.Enabled = true;
            saveToolStripMenuItem.Enabled    = toolStripButton_Save.Enabled = false;

            if (pictureBoxPhoto.Image != null)
            {
                toolStripDropDownButtonZUMM.Enabled = true;
            }
            posesenieTableAdapter.FillByPID(___BASA__DataSet.Posesenie, PID);
            History();
        }