Exemplo n.º 1
0
        protected virtual void dAdapter_MasterRowUpdating(object sender, RowUpdatingEventArgs e)
        {
            if (OnBeforeRowUpdating != null)
            {
                OnBeforeRowUpdating(sender, e);
            }

            if (e.StatementType == StatementType.Insert)
            {
                if (myRadarDocument == null)
                {
                    myRadarDocument = Activator.CreateInstance(RadarDocument, RadarParams) as IRadarForm;
                }

                lastKey = myRadarDocument.GetRadarParameters(e.Row[ForeignKey.Name].ToString());
            }
        }
Exemplo n.º 2
0
        public bool OpenDocument(string val = "")
        {
            if (iradarform == null || Text.IsEmpty())
            {
                return(false);
            }

            this.Cursor = Cursors.WaitCursor;
            Application.DoEvents();
            radarForm = Activator.CreateInstance(iradarform, args) as IRadarForm;
            IRadarParameters iParam = radarForm.GetRadarParameters(Text);

            radarForm.OpenBrowse(iParam);

            this.Cursor = Cursors.Default;

            return(false);
        }
        public bool OpenDocument(string val = "")
        {
            if (iradarform == null || val.IsEmpty())
            {
                return(false);
            }

            Application.UseWaitCursor = true;
            Application.DoEvents();
            IRadarForm       radarForm = Activator.CreateInstance(iradarform, args) as IRadarForm;
            IRadarParameters iParam    = radarForm.GetRadarParameters(val);

            radarForm.OpenBrowse(iParam);

            Application.UseWaitCursor = false;

            return(false);
        }
Exemplo n.º 4
0
        private void MetroCounterTextBox_Validating(object sender, CancelEventArgs e)
        {
            if (iradarform == null)
            {
                return;
            }
            string cnt = Text;

            radarForm = Activator.CreateInstance(iradarform, args) as IRadarForm;

            IRadarParameters iParam = radarForm.GetRadarParameters(cnt);

            if (!IsEmpty && !radarForm.Find(iParam))
            {
                if (EnableAddOnFly && radarForm.CanOpenNew)
                {
                    DialogResult result = MetroMessageBox.Show(GlobalInfo.MainForm, Properties.Resources.Msg_InsertNewCode,
                                                               Properties.Resources.Warning, MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                    if (result == DialogResult.Yes)
                    {
                        radarForm.OpenNew(iParam);
                        Focus();
                    }
                }
                else if (MustExistData)
                {
                    MessageBox.Show(GlobalInfo.MainForm, Properties.Resources.Msg_CodeNotFound,
                                    Properties.Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Focus();
                }
                e.Cancel = MustExistData;
            }
            else
            {
                if (cnt == string.Empty)
                {
                    Description = string.Empty;
                    return;
                }
            }
            Description = radarForm.Description;
        }
Exemplo n.º 5
0
        public void UpdateDescription()
        {
            if (DescriptionControl == null)
            {
                return;
            }

            if (iradarform != null)
            {
                radarForm = Activator.CreateInstance(iradarform, args) as IRadarForm;
            }

            IRadarParameters iParam = radarForm.GetRadarParameters(Text);

            DescriptionControl.Text = (Text != string.Empty && radarForm.Find(iParam))
                                        ? radarForm.Description
                                        : string.Empty;

            radarForm.Dispose();
        }