public void Initialize(DeklaritMode mode, DataRow parentRow, bool isCopy) { this.m_ParentRow = parentRow; this.dsBLAGAJNADataSet1 = (BLAGAJNADataSet)this.m_ParentRow.Table.DataSet; this.bindingSourceBLAGAJNAStavkeBlagajne.DataSource = DataSetUtil.GetSubTreeDataView(this.m_ParentRow, this.dsBLAGAJNADataSet1.Tables["BLAGAJNAStavkeBlagajne"]); this.bindingSourceBLAGAJNAStavkeBlagajne.DataMember = ""; this.bindingSourceBLAGAJNAStavkeBlagajneStavkeBlagajneKontiranje.DataMember = "BLAGAJNAStavkeBlagajne_BLAGAJNAStavkeBlagajneStavkeBlagajneKontiranje"; this.RegisterBindingSources(); this.m_Mode = mode; this.m_BaseMethods = new GenericFormClass(this.m_FrameworkDescription, this.m_FirstLevelName, "BLAGAJNA", this.m_Mode, this.dsBLAGAJNADataSet1, this.dsBLAGAJNADataSet1.BLAGAJNAStavkeBlagajne.Columns, this.Controls, this.m_DataGrids, this.m_AutoNumber); Binding binding = new Binding("Text", this.bindingSourceBLAGAJNAStavkeBlagajne, "BLGDATUMDOKUMENTA", true); binding.Format += new ConvertEventHandler(this.m_BaseMethods.DateFormat); binding.Parse += new ConvertEventHandler(this.m_BaseMethods.DateParseNotNull); if (this.datePickerBLGDATUMDOKUMENTA.DataBindings["Text"] != null) { this.datePickerBLGDATUMDOKUMENTA.DataBindings.Remove(this.datePickerBLGDATUMDOKUMENTA.DataBindings["Text"]); } this.datePickerBLGDATUMDOKUMENTA.DataBindings.Add(binding); this.m_BaseMethods.FormLoadStyle(); if ((this.m_BaseMethods.IsUpdate() || this.m_BaseMethods.IsDelete()) || (this.m_BaseMethods.IsSelect() || isCopy)) { this.m_CurrentRow = (BLAGAJNADataSet.BLAGAJNAStavkeBlagajneRow)((DataRowView)this.bindingSourceBLAGAJNAStavkeBlagajne.Current).Row; this.textIDBLGVRSTEDOK.ButtonsRight[0].Visible = false; this.textblggodineIDGODINE.ButtonsRight[0].Visible = false; } if (this.m_BaseMethods.IsInsert() && !isCopy) { this.textIDBLGVRSTEDOK.ButtonsRight[0].Visible = true; this.textblggodineIDGODINE.ButtonsRight[0].Visible = true; this.m_CurrentRow = (BLAGAJNADataSet.BLAGAJNAStavkeBlagajneRow)((DataRowView)this.bindingSourceBLAGAJNAStavkeBlagajne.AddNew()).Row; this.m_CurrentRow.SetParentRow(this.m_ParentRow); } this.SetFocusInFirstField(); }
public void AddLineAndNew(object sender, EventArgs e) { if (this.InValidState()) { this.SetFocusInFirstField(); this.m_CurrentRow = (BLAGAJNADataSet.BLAGAJNAStavkeBlagajneRow)((DataRowView)this.bindingSourceBLAGAJNAStavkeBlagajne.AddNew()).Row; this.m_CurrentRow.SetParentRow(this.m_ParentRow); } }