private void loadCleanDelo()
 {
     ___BASA__DataSet.PersonalRow newPersRow = this.___BASA__DataSet.Personal.AddPersonalRow("", "", null, "", DateTime.Today, DateTime.Today, null, "", "", "", "", "", null, null, false, "", "", "", null);
     newPersRow.Uliza      = newPersRow.Gorod = 1;
     newPersRow.DProfessia = newPersRow.DProfessia = 1;
     change();
 }
        bool check_Basa()
        {
            bool da = true;

            if (DID == 0)
            {
                ___BASA__DataSet.PersonalRow CurPatrow = ___BASA__DataSet.Personal[0];
                foreach (DataRow Prow in personalTableAdapter.GetDataByAll(CurPatrow.DF, CurPatrow.DI, CurPatrow.DO, CurPatrow.DBD, CurPatrow.Uliza, CurPatrow.Gorod).Rows)
                {
                    if (kadryTableAdapter1.GetDataByDID((int)Prow["DID"]).Count > 0)
                    {
                        da = false;
                        break;
                    }
                }
            }
            return(da);
        }
        private void loadDelo()
        {
            this.personalTableAdapter.FillByID(this.___BASA__DataSet.Personal, DID);
            ___BASA__DataSet.PersonalRow PersRow = ___BASA__DataSet.Personal[0];
            this.Text = "Персонал: " + PersRow.DFIO;

            if (!PersRow.IsUlizaNull())
            {
                ulizaBindingSource.Position = ulizaBindingSource.Find("UlizaID", PersRow.Uliza);
            }
            else
            {
                ulizaBindingSource.Position = ulizaBindingSource.Find("UlizaID", 1);
            }

            if (!PersRow.IsGorodNull())
            {
                oblastBindingSource.Position = oblastBindingSource.Find("OblastID", ___BASA__DataSet.Gorod.FindByGorodID((int)PersRow.Gorod).Oblast);
                gorodBindingSource.Position  = gorodBindingSource.Find("GorodID", PersRow.Gorod);
            }
            else
            {
                oblastBindingSource.Position = oblastBindingSource.Find("OblastID", 1);
                gorodBindingSource.Position  = gorodBindingSource.Find("GorodID", 1);
            }

            if (!PersRow.IsSexNull())
            {
                sexBindingSource.Position = sexBindingSource.Find("ID", PersRow.Sex.ToString());
            }
            else
            {
                textBoxS.Text  = "";
                PersRow.SexRow = null;
            }
            if (!PersRow.IsDProfessiaNull())
            {
                personalProfessiaBindingSource.Position = personalProfessiaBindingSource.Find("PersProfessiaID", PersRow.DProfessia);
            }
            else
            {
                PersRow.PersonalProfessiaRow = null;
                textBoxProf.Text             = "";
            }

            if (!PersRow.IsDBDNull())
            {
                textBoxVozr.Text = Vozrast((DateTime)PersRow.DBD).ToString();
            }
            else
            {
                textBoxVozr.Text = "";
            }
            ggrafikToolStripMenuItem.Enabled = chengToolStripMenuItem.Enabled =
                toolStripButtonMoney.Enabled = toolStripButton_change.Enabled = true;

            toolStripButton_Save.Enabled = false;
            if (pictureBoxPhoto.Image != null)
            {
                toolStripDropDownButtonZUMM.Enabled = true;
            }
        }