Пример #1
0
 protected virtual void EditDetail()
 {
     if (this.ValidateEditDetail())
     {
         frmSingleDetailEditBase frm = this.GetEditDetailForm();
         if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             this.grdDetail.Refresh();
         }
     }
 }
Пример #2
0
        protected virtual void AddDetail()
        {
            if (!this.ValidateAddDetail())
            {
                return;
            }

            XModelBase              model      = this.grdData.CurrentRow.DataRow as XModelBase;
            IList <XModelBase>      detailList = this.grdDetail.DataSource as IList <XModelBase>;
            frmSingleDetailEditBase frm        = this.GetAddDetailForm(model, detailList);

            if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.grdDetail.DataSource = null;
                this.grdDetail.DataSource = frm.ModelList;
                this.grdDetail.Refresh();
            }
        }