Exemple #1
0
 private void frmProductDistributionEdit_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (_frmpl != null)
     {
         if (_frmpl.IsDisposed)
         {
             _frmpl = null;
         }
         else
         {
             _frmpl.Close();
         }
     }
 }
Exemple #2
0
        public void AddDetail()
        {
            if (ReadOnly)
            {
                return;
            }
            try
            {
                if (ds_Production.SP_GetProductDistributionHeader.Rows.Count == 0)
                {
                    throw new Exception("გთხოვთ შეავსოთ ძირითადი პარამეტრები.");
                }

                bool  isContainsForm = FormHelper.ContainsForm(FormHelper.GetFormID(typeof(frmProductLocationBrowse), Handle));
                IForm frm            = FormHelper.CreateInstance(typeof(frmProductLocationBrowse), MdiParent, Handle);
                if (!isContainsForm)
                {
                    if (frm is frmProductLocationBrowse)
                    {
                        _frmpl = ((frmProductLocationBrowse)frm);
                        _frmpl.OptionsListForm.ServerMode      = true;
                        _frmpl.OptionsListForm.BrowseFormStyle = BrowseFormStyle.Browse;
                        _frmpl.OperationCurrencyRate           = CurrencyRate;
                        //_frmpl.CrossRate = CrossRate;
                        _frmpl.OnChooseRecord += new CancelEventHandler(OnChooseProduct);
                        _frmpl.OptionsListForm.CloseAfterChoose = false;
                        _frmpl.BranchID = FromBranchID;
                    }
                }


                frm.Show();
                frm.BringToFront();
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "შეცდომა", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }