Пример #1
0
        public void Initialize(DeklaritMode mode, DataRow parentRow, bool isCopy)
        {
            this.m_ParentRow      = parentRow;
            this.dsRADNIKDataSet1 = (RADNIKDataSet)this.m_ParentRow.Table.DataSet;
            this.bindingSourceRADNIKOdbitak.DataSource = DataSetUtil.GetSubTreeDataView(this.m_ParentRow, this.dsRADNIKDataSet1.Tables["RADNIKOdbitak"]);
            this.bindingSourceRADNIKOdbitak.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.RADNIKOdbitak.Columns, this.Controls, this.m_DataGrids, this.m_AutoNumber);
            Binding binding = new Binding("Text", this.bindingSourceRADNIKOdbitak, "FAKTOROSOBNOGODBITKA", true);

            binding.Format += new ConvertEventHandler(this.m_BaseMethods.NumericFormat);
            if (this.labelFAKTOROSOBNOGODBITKA.DataBindings["Text"] != null)
            {
                this.labelFAKTOROSOBNOGODBITKA.DataBindings.Remove(this.labelFAKTOROSOBNOGODBITKA.DataBindings["Text"]);
            }
            this.labelFAKTOROSOBNOGODBITKA.DataBindings.Add(binding);
            this.m_BaseMethods.FormLoadStyle();
            if ((this.m_BaseMethods.IsUpdate() || this.m_BaseMethods.IsDelete()) || (this.m_BaseMethods.IsSelect() || isCopy))
            {
                this.m_CurrentRow = (RADNIKDataSet.RADNIKOdbitakRow)((DataRowView)this.bindingSourceRADNIKOdbitak.Current).Row;
                this.textOSOBNIODBITAKZADUZENJEIDOSOBNIODBITAK.ButtonsRight[0].Visible = false;
            }
            if (this.m_BaseMethods.IsInsert() && !isCopy)
            {
                this.textOSOBNIODBITAKZADUZENJEIDOSOBNIODBITAK.ButtonsRight[0].Visible = true;
                this.m_CurrentRow = (RADNIKDataSet.RADNIKOdbitakRow)((DataRowView)this.bindingSourceRADNIKOdbitak.AddNew()).Row;
                this.m_CurrentRow.SetParentRow(this.m_ParentRow);
            }
            this.SetFocusInFirstField();
        }
Пример #2
0
 public void AddLineAndNew(object sender, EventArgs e)
 {
     if (this.InValidState())
     {
         this.SetFocusInFirstField();
         this.m_CurrentRow = (RADNIKDataSet.RADNIKOdbitakRow)((DataRowView)this.bindingSourceRADNIKOdbitak.AddNew()).Row;
         this.m_CurrentRow.SetParentRow(this.m_ParentRow);
     }
 }