public void SaveAndNew(object sender, EventArgs e) { if (this.InValidState() && this.RAD1GELEMENTIVEZAController.Update(this)) { this.RAD1GELEMENTIVEZAController.DataSet = new RAD1GELEMENTIVEZADataSet(); DataSetUtil.AddEmptyRow(this.RAD1GELEMENTIVEZAController.DataSet); this.ChangeBinding(); this.m_CurrentRow = this.RAD1GELEMENTIVEZAController.DataSet.RAD1GELEMENTIVEZA[0]; DataSetUtil.CopyForeignKeyValues(this.m_CurrentRow, this.m_ForeignKeys); this.SetFocusInFirstField(); } }
public void Initialize(DeklaritMode mode, DataRow foreignKeys, bool isCopy) { this.ChangeBinding(); this.m_ForeignKeys = foreignKeys; this.RegisterBindingSources(); this.m_Mode = mode; this.m_BaseMethods = new GenericFormClass(this.m_FrameworkDescription, this.m_FirstLevelName, "RAD1GELEMENTIVEZA", this.m_Mode, this.dsRAD1GELEMENTIVEZADataSet1, this.dsRAD1GELEMENTIVEZADataSet1.RAD1GELEMENTIVEZA.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 = this.dsRAD1GELEMENTIVEZADataSet1.RAD1GELEMENTIVEZA[0]; } if (this.m_BaseMethods.IsInsert() && !isCopy) { this.m_CurrentRow = (RAD1GELEMENTIVEZADataSet.RAD1GELEMENTIVEZARow)((DataRowView)this.bindingSourceRAD1GELEMENTIVEZA.AddNew()).Row; foreach (string str in DataSetUtil.CopyForeignKeyValues(this.m_CurrentRow, foreignKeys)) { this.m_BaseMethods.SetReadOnly(str, true); this.m_BaseMethods.GetLabelControl(str).Visible = false; this.m_BaseMethods.GetControl(str).Visible = false; } } this.SetFocusInFirstField(); }