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, "OSNOVAOSIGURANJA", this.m_Mode, this.dsOSNOVAOSIGURANJADataSet1, this.dsOSNOVAOSIGURANJADataSet1.OSNOVAOSIGURANJA.Columns, this.Controls, this.m_DataGrids, this.m_AutoNumber); Binding binding = new Binding("CheckState", this.bindingSourceOSNOVAOSIGURANJA, "RAZDOBLJESESMIJEPREKLAPATI", true); binding.Format += new ConvertEventHandler(this.m_BaseMethods.BooleanFormat); binding.Parse += new ConvertEventHandler(this.m_BaseMethods.BooleanParse); if (this.checkRAZDOBLJESESMIJEPREKLAPATI.DataBindings["CheckState"] != null) { this.checkRAZDOBLJESESMIJEPREKLAPATI.DataBindings.Remove(this.checkRAZDOBLJESESMIJEPREKLAPATI.DataBindings["CheckState"]); } this.checkRAZDOBLJESESMIJEPREKLAPATI.DataBindings.Add(binding); this.m_BaseMethods.FormLoadStyle(); if ((this.m_BaseMethods.IsUpdate() || this.m_BaseMethods.IsDelete()) || (this.m_BaseMethods.IsSelect() || isCopy)) { this.m_CurrentRow = this.dsOSNOVAOSIGURANJADataSet1.OSNOVAOSIGURANJA[0]; } if (this.m_BaseMethods.IsInsert() && !isCopy) { this.m_CurrentRow = (OSNOVAOSIGURANJADataSet.OSNOVAOSIGURANJARow)((DataRowView)this.bindingSourceOSNOVAOSIGURANJA.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(); }
public void SaveAndNew(object sender, EventArgs e) { if (this.InValidState() && this.OSNOVAOSIGURANJAController.Update(this)) { this.OSNOVAOSIGURANJAController.DataSet = new OSNOVAOSIGURANJADataSet(); DataSetUtil.AddEmptyRow(this.OSNOVAOSIGURANJAController.DataSet); this.ChangeBinding(); this.m_CurrentRow = this.OSNOVAOSIGURANJAController.DataSet.OSNOVAOSIGURANJA[0]; DataSetUtil.CopyForeignKeyValues(this.m_CurrentRow, this.m_ForeignKeys); this.SetFocusInFirstField(); } }