public void Initialize(DeklaritMode mode, DataRow parentRow, bool isCopy) { this.m_ParentRow = parentRow; this.dsGRUPEKOEFDataSet1 = (GRUPEKOEFDataSet)this.m_ParentRow.Table.DataSet; this.bindingSourceGRUPEKOEFLevel1.DataSource = DataSetUtil.GetSubTreeDataView(this.m_ParentRow, this.dsGRUPEKOEFDataSet1.Tables["GRUPEKOEFLevel1"]); this.bindingSourceGRUPEKOEFLevel1.DataMember = ""; this.RegisterBindingSources(); this.m_Mode = mode; this.m_BaseMethods = new GenericFormClass(this.m_FrameworkDescription, this.m_FirstLevelName, "GRUPEKOEF", this.m_Mode, this.dsGRUPEKOEFDataSet1, this.dsGRUPEKOEFDataSet1.GRUPEKOEFLevel1.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 = (GRUPEKOEFDataSet.GRUPEKOEFLevel1Row)((DataRowView)this.bindingSourceGRUPEKOEFLevel1.Current).Row; } if (this.m_BaseMethods.IsInsert() && !isCopy) { this.m_CurrentRow = (GRUPEKOEFDataSet.GRUPEKOEFLevel1Row)((DataRowView)this.bindingSourceGRUPEKOEFLevel1.AddNew()).Row; this.m_CurrentRow.SetParentRow(this.m_ParentRow); } this.FillProviderCombocomboIDELEMENT(); if (this.m_BaseMethods.IsInsert()) { this.comboIDELEMENT.SelectedIndex = -1; } if (this.comboIDELEMENT.DataBindings["Value"] != null) { this.comboIDELEMENT.DataBindings.Remove(this.comboIDELEMENT.DataBindings["Value"]); } this.comboIDELEMENT.DataBindings.Add(new Binding("Value", this.bindingSourceGRUPEKOEFLevel1, "IDELEMENT")); this.SetFocusInFirstField(); }
public void AddLineAndNew(object sender, EventArgs e) { if (this.InValidState()) { this.SetFocusInFirstField(); this.m_CurrentRow = (GRUPEKOEFDataSet.GRUPEKOEFLevel1Row)((DataRowView)this.bindingSourceGRUPEKOEFLevel1.AddNew()).Row; this.m_CurrentRow.SetParentRow(this.m_ParentRow); } }