// загрузка формы public void frAddEditHistoryRoleJobs_Load(object sender, EventArgs e) { mdVariables.EventChangedControl = false; if (AddEdit == 3) { this.lbNameForm.Text = "Редактировать должности сотрудника"; } this.Location = MousePosition; this.txtDtBegin.EditValue = DateTime.Now; this.txtDtBegin.Select(); // дерево должностей clsOrganizationStructure RoleJobsFilial = new clsOrganizationStructure() { sender = this.cmbRoleJobsFilial.Properties.TreeList, TableName = "tlRoleJobsFilial." + this.Name }; this.cmbRoleJobsFilial.Properties.DisplayMember = "RoleJobsString"; this.cmbRoleJobsFilial.Properties.ValueMember = "Id"; RoleJobsFilial.GetOrganizationStructure(ExpandedRoot: 1, OnlyCurentFillial: "1"); tlRoleJobsFilial.NodeCellStyle += RoleJobsFilial.NodeCellStyle; // если новая запись выходим из процедуры if (AddEdit == 2) { mdVariables.EventChangedControl = true; return; } // текущая строка в таблице iRowCurrent = mdQuery.iDataSet.Tables["HistoryRoleJobs." + frAddEditPerformer.Default.Name].Rows[frAddEditPerformer.Default.gvHistoryRoleJobs.FocusedRowHandle]; this.cmbRoleJobsFilial.EditValue = iRowCurrent["RoleJobsId"]; this.txtDtBegin.EditValue = iRowCurrent["DtChange"]; this.tlRoleJobsFilial.FocusedNode = this.tlRoleJobsFilial.FindNodeByKeyID(iRowCurrent["RoleJobsId"]); mdVariables.EventChangedControl = true; }