public void Initialize(DeklaritMode mode, DataRow parentRow, bool isCopy) { this.m_ParentRow = parentRow; this.dsRADNIKDataSet1 = (RADNIKDataSet)this.m_ParentRow.Table.DataSet; this.bindingSourceRADNIKNeto.DataSource = DataSetUtil.GetSubTreeDataView(this.m_ParentRow, this.dsRADNIKDataSet1.Tables["RADNIKNeto"]); this.bindingSourceRADNIKNeto.DataMember = ""; this.RegisterBindingSources(); this.m_Mode = mode; this.m_BaseMethods = new GenericFormClass(this.m_FrameworkDescription, this.m_FirstLevelName, "RADNIK", this.m_Mode, this.dsRADNIKDataSet1, this.dsRADNIKDataSet1.RADNIKNeto.Columns, this.Controls, this.m_DataGrids, this.m_AutoNumber); this.m_BaseMethods.FormLoadStyle(); if ((this.m_BaseMethods.IsUpdate() || this.m_BaseMethods.IsDelete()) || (this.m_BaseMethods.IsSelect() || isCopy)) { this.m_CurrentRow = (RADNIKDataSet.RADNIKNetoRow)((DataRowView)this.bindingSourceRADNIKNeto.Current).Row; } if (this.m_BaseMethods.IsInsert() && !isCopy) { this.m_CurrentRow = (RADNIKDataSet.RADNIKNetoRow)((DataRowView)this.bindingSourceRADNIKNeto.AddNew()).Row; this.m_CurrentRow.SetParentRow(this.m_ParentRow); } this.FillProviderCombocomboNETOELEMENTIDELEMENT(); if (this.m_BaseMethods.IsInsert()) { this.comboNETOELEMENTIDELEMENT.SelectedIndex = -1; } if (this.comboNETOELEMENTIDELEMENT.DataBindings["Value"] != null) { this.comboNETOELEMENTIDELEMENT.DataBindings.Remove(this.comboNETOELEMENTIDELEMENT.DataBindings["Value"]); } this.comboNETOELEMENTIDELEMENT.DataBindings.Add(new Binding("Value", this.bindingSourceRADNIKNeto, "NETOELEMENTIDELEMENT")); this.SetFocusInFirstField(); }
public void AddLineAndNew(object sender, EventArgs e) { if (this.InValidState()) { this.SetFocusInFirstField(); this.m_CurrentRow = (RADNIKDataSet.RADNIKNetoRow)((DataRowView)this.bindingSourceRADNIKNeto.AddNew()).Row; this.m_CurrentRow.SetParentRow(this.m_ParentRow); } }