示例#1
0
        private void treeListHistory_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            try
            {
                TreeListHitInfo hitInfo = treeListHistory.CalcHitInfo(e.Location);
                if (hitInfo != null && hitInfo.Node != null)
                {
                    TreeListNode node  = hitInfo.Node;
                    EmrModel     model = node.Tag as EmrModel;
                    if (model != null)
                    {
                        //弹出病历内容
                        HistoryEmrForm printForm = new HistoryEmrForm(m_patUtil, m_RecordDal, model, node);
                        printForm.ShowDialog();
                        if (CurrentForm != null)
                        {
                            CurrentForm.Focus();
                        }

                        if (printForm.IsNeedInsertContent && CurrentForm != null)
                        {
                            if (CanEdit())
                            {
                                CurrentForm.zyEditorControl1.EMRDoc._Paste();
                                Clipboard.Clear();
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#2
0
 public virtual void ShowDialog(Form owner)
 {
     _Owner            = owner;
     _CurrentFormIndex = 0;
     CurrentForm.ShowDialog(_Owner);
     GC.ReRegisterForFinalize(this);
 }
示例#3
0
 /// <summary>
 /// 隐藏左侧工具栏
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void lblPlaceholder7_Click(object sender, EventArgs e)
 {
     if (lblPlaceholder7.Text == "<")
     {
         lblPlaceholder7.Text  = ">";
         tbn_show.Text         = "显示";
         tbn_show.Tag          = "显示左侧菜单";
         lblPlaceholder7.Tag   = "显示左侧菜单";
         MainToolBar.Width     = 0;
         lblPlaceholder6.Width = 0;
     }
     else
     {
         lblPlaceholder7.Text  = "<";
         tbn_show.Text         = "隐藏";
         tbn_show.Tag          = "隐藏左侧菜单";
         lblPlaceholder7.Tag   = "隐藏左侧菜单";
         MainToolBar.Width     = 170;
         lblPlaceholder6.Width = 8;
     }
     if (CurrentForm != null)
     {
         currentForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
         if (!CurrentForm.IsDisposed)
         {
             CurrentForm.Show();
         }
     }
 }
示例#4
0
        private async Task <bool> RuinII()
        {
            if (CurrentForm.Equals(SummonerForm.DreadwormTrance) || CurrentForm.Equals(SummonerForm.FirebirdTrance))
            {
                return(false);
            }


            if (MovementManager.IsMoving ||
                //Core.Player.HasAura("Further Ruin") ||
                UseBane ||
                UseFester ||
                UsePainflare ||
                UseTriDisaster ||
                (ResourceArcanist.Aetherflow == 0 && MySpells.EnergyDrain.Cooldown() <= 0) ||
                ActionManager.CanCast(MySpells.EnkindleBahamut.Name, Core.Player) ||
                ActionManager.CanCast(MySpells.EnkindlePhoenix.Name, Core.Player) ||
                ActionManager.CanCast(MySpells.SummonBahamut.Name, Core.Player) ||
                ActionManager.CanCast(MySpells.DreadwyrmTrance.Name, Core.Player) ||
                ActionManager.CanCast(MySpells.FirebirdTrance.Name, Core.Player))
            {
                return(await MySpells.RuinII.Cast());
            }
            return(false);
        }
示例#5
0
        private void openWatchMain()
        {
            try
            {
                string key      = "设备调度";
                string formText = "  " + key;
                formName = Dictionary[key].ToString();
                if (!ShowChildrenForm(formText))
                {
                    //以下是通过反射 获得该窗体的实例
                    Type t = Type.GetType(Global.namespceName + "." + formName);
                    CurrentForm = (Form)Activator.CreateInstance(t);

                    CurrentForm.MdiParent = this;
                    //设置窗体的标题
                    CurrentForm.Text = formText;
                    if (!CurrentForm.IsDisposed)
                    {
                        CurrentForm.WindowState = FormWindowState.Maximized;
                        CurrentForm.Show();
                    }
                }
            }
            catch (Exception)
            {
            }
        }
示例#6
0
        private void CheckCurrentFormState()
        {
            Helpers.Debug($"Form:  {CurrentForm.ToString()}  PrevTrance: {PreviousTrance.ToString()}");
            if ((int)PetManager.ActivePetType == 10)
            {
                PreviousTrance = SummonerForm.DreadwormTrance;
                CurrentForm    = SummonerForm.Bahamut;
            }
            if ((int)PetManager.ActivePetType == 14)
            {
                if (CurrentForm.Equals(SummonerForm.DreadwormTrance))
                {
                    CurrentFormExpireTime += TimeSpan.FromSeconds(5);
                }
                CurrentForm = SummonerForm.FirebirdTrance;
            }
            if ((int)PetManager.ActivePetType != 14 && CurrentForm.Equals(SummonerForm.FirebirdTrance) && Resource.DreadwyrmTrance)
            {
                PreviousTrance         = SummonerForm.DreadwormTrance;
                CurrentForm            = SummonerForm.DreadwormTrance;
                CurrentFormExpireTime -= TimeSpan.FromSeconds(5);
            }


            if (!CurrentForm.Equals(SummonerForm.Normal) && IsCurrentFormExpired() && (!ShinraEx.Settings.SummonerOpener || Helpers.OpenerFinished))
            {
                Helpers.Debug("Set form to Normal");
                CurrentForm = SummonerForm.Normal;
            }
        }
示例#7
0
 void iClose_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (CurrentForm != null)
     {
         CurrentForm.Close();
     }
 }
示例#8
0
 private async Task <bool> BrandOfPurgatory()
 {
     if (Core.Player.HasAura("Hellish Conduit") && CurrentForm.Equals(SummonerForm.FirebirdTrance))
     {
         return(await MySpells.BrandOfPurgatory.Cast());
     }
     return(false);
 }
示例#9
0
 private async Task <bool> FountainOfFire()
 {
     if (CurrentForm.Equals(SummonerForm.FirebirdTrance))
     {
         return(await MySpells.BrandOfPurgatory.Cast());
     }
     return(false);
 }
示例#10
0
 private async Task <bool> EgiAssaultII()
 {
     if (PetExists &&
         (!CurrentForm.Equals(SummonerForm.Bahamut) || !CurrentForm.Equals(SummonerForm.FirebirdTrance)) &&
         ActionManager.CanCast(MySpells.EgiAssaultII.Name, Core.Player) && Core.Me.InCombat)
     {
         return(await MySpells.EgiAssaultII.Cast());
     }
     return(false);
 }
示例#11
0
        private void WorkerOnRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs runWorkerCompletedEventArgs)
        {
            AppSettings.RefreshSettings();
            UsuarioActual.ResetearValoresCacheados();

            if (_secuenciaDesfasada)
            {
                CurrentForm.Invoke(new ActualizarMensajeDelegate(ActualizarMensaje), "Reanudando sincronización en pocos segundos..");
            }
            else
            {
                if (_huboError)
                {
                    CurrentForm.Invoke(new ActualizarMensajeDelegate(ActualizarMensaje), "Sincronización finalizada con errores");
                }
                else
                {
                    CurrentForm.Invoke(new ActualizarMensajeDelegate(ActualizarMensaje), "Sincronización finalizada");
                    ActualizacionPantallasHelper.ActualizarPantallaVentas();

                    if (SyncExitosaEvent != null)
                    {
                        SyncExitosaEvent();
                    }
                }
            }

            if (SyncTimer != null)
            {
                SyncTimer.Stop();
            }
            else
            {
                SyncTimer       = new Timer();
                SyncTimer.Tick += SyncTimerOnTick;
            }

            if (UsuarioActual.Cuenta.SincronizarAutomaticamente.GetValueOrDefault())
            {
                var interval = _secuenciaDesfasada
                                    ? 10 * 1000                                                                       //10 segundos
                                    : (_huboError
                                        ? 5 * 60 * 1000                                                               //5 minutos
                                        : UsuarioActual.Cuenta.IntervaloSincronizacion.GetValueOrDefault() * 360000); //confiuracion
                SyncTimer.Interval = interval;
                SyncTimer.Start();
            }

            Timer = new Timer {
                Interval = 5000
            };
            Timer.Tick += TimerOnTick;
            Timer.Start();
        }
示例#12
0
 private async Task <bool> EgiAssault()
 {
     if (PetExists &&
         (!CurrentForm.Equals(SummonerForm.Bahamut) || !CurrentForm.Equals(SummonerForm.FirebirdTrance)) &&
         ActionManager.CanCast(MySpells.EgiAssault.Name, Core.Player) &&
         (ActionManager.LastSpell.Name == "Ruin II" || ActionManager.LastSpell.Name == "Ruin IV"))
     {
         return(await MySpells.EgiAssault.Cast());
     }
     return(false);
 }
示例#13
0
 private void MAINBASE_FormClosed(object sender, FormClosedEventArgs e)
 {
     foreach (Form CurrentForm in this.MdiChildren)
     {
         if (CurrentForm.Name != this.Name)
         {
             CurrentForm.Close();
         }
     }
     //GeneralCommon.Gp_LogData(GeneralCommon.sUserID + "," + GeneralCommon.sUsername + "在" + DateTime.Now.ToString() + "于" + GeneralCommon.Gf_GetIP() + ",登出" + this.Name);
 }
示例#14
0
 public override bool DevHasGraphics()
 {
     if (CurrentForm.IsValid())
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#15
0
 void SaveAs()
 {
     if (CurrentForm != null)
     {
         string s = CurrentForm.SaveAs();
         if (s != string.Empty)
         {
             AddToMostRecentFiles(s, arMRUList);
         }
         UpdateText();
     }
 }
示例#16
0
 public void SetNextForm(Type form)
 {
     if (!registeredForms.Contains(form))
     {
         throw new InvalidOperationException("Form is not registered. Maybe a subform?");
     }
     if (CurrentForm != null && (form == CurrentForm.GetType()))
     {
         return;
     }
     toOpenForm = form;
     ResumeThread();
 }
示例#17
0
        private async void list_Orders_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count == 0)
            {
                return;
            }
            CurrentForm = e.AddedItems[0] as OrderForm;
            (PageNav as AllOrdersPageNav).OrderForm = CurrentForm;
            await CurrentForm.RetrieveAllOrderItems();

            list_OrderItems.ItemsSource = CurrentForm.OrderItems;
            (PageNav as AllOrdersPageNav).NotifyOrderFormChanged();
        }
示例#18
0
        private void CheckCurrentFormState()
        {
            Helpers.Debug("Form:  " + CurrentForm.ToString());
            if (!PreviousTrance.Equals(SummonerForm.FirebirdTrance) && Core.Player.HasAura("Everlasting Flight"))
            {
                PreviousTrance = SummonerForm.FirebirdTrance;
            }

            if (!CurrentForm.Equals(SummonerForm.Normal) && IsCurrentFormExpired())
            {
                Helpers.Debug("Set form to Normal");
                CurrentForm = SummonerForm.Normal;
            }
        }
        // Overriden to convert relative file paths to absolute file paths,
        // due to a redirection issue on UP phones.

        /// <include file='doc\UpWmlMobileTextWriter.uex' path='docs/doc[@for="UpWmlMobileTextWriter.CalculateFormPostBackUrl"]/*' />
        protected override String CalculateFormPostBackUrl(bool externalSubmit, ref bool encode)
        {
            String url = CurrentForm.Action;

            if (externalSubmit && url.Length > 0)
            {
                // Not only do we need to resolve the URL, but we need to make it absolute.
                url    = Page.MakePathAbsolute(CurrentForm.ResolveUrl(url));
                encode = false;
            }
            else
            {
                url    = Page.AbsoluteFilePath;
                encode = true;
            }
            return(url);
        }
        public override void Update(GameTime gameTime)
        {
            if (FormChildren != null)
            {
                Vector2 MStick = MyPlayer.MyController.MenuStick(UseLTrig, UseRTrig, true, false, false);

                if (MStick.Length() > 0.1f)
                {
                    if (CurrentForm == null || CurrentForm.MarkerMove(MStick))
                    {
                        if (Math.Abs(MStick.Y) < Math.Abs(MStick.X))
                        {
                            if (MStick.X < 0)
                            {
                                MoveMark((float)Math.PI * 1.5f);
                            }
                            else
                            {
                                MoveMark((float)Math.PI * 0.5f);
                            }
                        }
                        else
                        {
                            if (MStick.Y > 0)
                            {
                                MoveMark(0);
                            }
                            else
                            {
                                MoveMark((float)Math.PI);
                            }
                        }
                    }
                }

                if (MyPlayer.MyController.AButton() && !MyPlayer.MyController.AButtonPrevious())
                {
                    TriggerCurrent();
                }
            }

            base.Update(gameTime);
        }
示例#21
0
        //-- Methods -----------------------------------------------------

        private void CreateNewFormItem()
        {
            if (CurrentForm == null)
            {
                return;
            }

            var act         = CurrentForm.GetAllowedChildTypes();
            var allowedType = act.FirstOrDefault(ct => ct.IsInstaceOfOrDerivedFrom("FormItem"));
            var typeName    = allowedType == null ? "FormItem" : allowedType.Name;

            _cFormItem = SNC.Content.CreateNew(typeName, CurrentForm, null);

            try
            {
                if (string.IsNullOrEmpty(ContentViewPath))
                {
                    _cvFormItem = ContentView.Create(_cFormItem, this.Page, ViewMode.New);
                }
                else
                {
                    _cvFormItem = ContentView.Create(_cFormItem, this.Page, ViewMode.New, ContentViewPath);
                }

                _cvFormItem.ID          = "cvNewFormItem";
                _cvFormItem.Init       += new EventHandler(_cvFormItem_Init);
                _cvFormItem.UserAction += new EventHandler <UserActionEventArgs>(_cvFormItem_UserAction);

                this.Controls.Add(_cvFormItem);
            }
            catch (Exception ex)         //logged
            {
                Logger.WriteException(ex);
                this.Controls.Clear();
                this.Controls.Add(new LiteralControl("ContentView error: " + ex.Message));
            }
        }
示例#22
0
 public virtual void MoveToNext()
 {
     CurrentForm.Hide();
     CurrentFormIndex++;
     CurrentForm.ShowDialog();
 }
示例#23
0
        /// <summary>
        /// 处理工具栏中相关项的点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void PanelEvent(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (sender is Label)
                {
                    try
                    {
                        string key      = ((Label)sender).Text; //获得数据字典中的key 即功能项目的名称
                        string formText = "  " + key;
                        formName = Dictionary[key].ToString();  //获得数据字典中的 对应窗口的类名


                        if (!ShowChildrenForm(formText))
                        {
                            //以下是通过反射 获得该窗体的实例

                            Type t = Type.GetType(Global.namespceName + "." + formName);

                            CurrentForm = (Form)Activator.CreateInstance(t);



                            CurrentForm.MdiParent = this;
                            //设置窗体的标题
                            CurrentForm.Text = formText;
                            if (!CurrentForm.IsDisposed)
                            {
                                CurrentForm.WindowState = FormWindowState.Maximized;
                                CurrentForm.Show();
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("该功能出现错误:" + ex.Message);
                    }
                }
                else
                {
                    PanelIcon pic = (PanelIcon)sender;
                    List <Outlook_Table_Jb_User> list    = (List <Outlook_Table_Jb_User>)table[pic.iconPanel];
                    Outlook_Table_Jb_User        jb_user = list[pic.Index];
                    try
                    {
                        string key      = jb_user.Itemname;    //获得数据字典中的key 即功能项目的名称
                        string formText = "  " + key;
                        formName = Dictionary[key].ToString(); //获得数据字典中的 对应窗口的类名

                        if (!ShowChildrenForm(formText))
                        {
                            //以下是通过反射 获得该窗体的实例
                            Type t = Type.GetType(Global.namespceName + "." + formName);
                            CurrentForm = (Form)Activator.CreateInstance(t);

                            CurrentForm.MdiParent = this;
                            //设置窗体的标题
                            CurrentForm.Text = "  " + key;
                            if (!CurrentForm.IsDisposed)
                            {
                                CurrentForm.WindowState = FormWindowState.Maximized;
                                CurrentForm.Show();
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("该功能出现错误:" + ex.Message);
                    }
                }
            }
        }
示例#24
0
        private void WorkActualizacionSecuencial()
        {
            try
            {
                _huboError          = false;
                _secuenciaDesfasada = false;

                CurrentForm.Invoke(new ActualizarMensajeDelegate(ActualizarMensaje), "Actualizando base de datos principal...");
                var secuencias           = _sincronizacionService.ObtenerSecuencias(AppSettings.MaxiKioscoIdentifier.ToString());
                var exportacionesLocales = SincronizacionHelper.ObtenerDatosSinExportar(AppSettings.MaxiKioscoIdentifier,
                                                                                        UsuarioActual.UsuarioId,
                                                                                        secuencias.UltimaSecuenciaAcusada);

                var count       = 1;
                var orderedList = exportacionesLocales.OrderBy(x => x.Secuencia).ToList();
                foreach (var exportacion in orderedList)
                {
                    CurrentForm.Invoke(new ActualizarMensajeDelegate(ActualizarMensaje),
                                       String.Format("Actualizando Servidor ({0} de {1} archivos)", count, orderedList.Count));
                    var actualizarDatosRequest = new ActualizarDatosRequest
                    {
                        Exportacion = new ExportacionData
                        {
                            Archivo   = exportacion.ExportacionArchivo.Archivo,
                            Secuencia = exportacion.Secuencia
                        },
                        MaxiKioscoIdentifier = AppSettings.MaxiKioscoIdentifier
                    };
                    var actualizarResponse = _sincronizacionService.ActualizarDatos(actualizarDatosRequest);

                    if (!actualizarResponse.Exito)
                    {
                        AppSettings.RefreshSettings();
                        _huboError = true;
                        if (actualizarResponse.MensageError == "SECUENCIA DESFASADA")
                        {
                            _secuenciaDesfasada = true;
                        }
                        else
                        {
                            MessageBox.Show(actualizarResponse.MensageError);
                        }
                        break;
                    }
                    count++;
                }

                if (!_huboError)
                {
                    int ultimaSecuencia = 0;

                    CurrentForm.Invoke(new ActualizarMensajeDelegate(ActualizarMensaje), "Obteniendo datos de servidor...");
                    var request = new ObtenerDatosRequest
                    {
                        MaxiKioscoIdentifier       = AppSettings.MaxiKioscoIdentifier,
                        UsuarioIdentifier          = UsuarioActual.Usuario.Identifier,
                        UltimaSecuenciaExportacion = secuencias.UltimaSecuenciaExportacion
                    };

                    //Esperar respuesta del server.
                    CurrentForm.Invoke(new ActualizarMensajeDelegate(ActualizarMensaje), "Actualizando datos de kiosco...");


                    var faltan = 10; //no importa este valor (tiene que ser mayor a cero nomas)

                    _sincronizacionService.ForzarArmadoDeArchivoExportacion(UsuarioActual.Usuario.Identifier);
                    var vinoAlgoDeWeb = false;
                    while (faltan > 0)
                    {
                        var response = _sincronizacionService.ObtenerDatosSecuencial(request);
                        faltan = response.ArchivosRestantes;

                        if (response.Exportacion != null)
                        {
                            vinoAlgoDeWeb = true;

                            ultimaSecuencia = response.Exportacion.Secuencia;

                            CurrentForm.Invoke(new ActualizarMensajeDelegate(ActualizarMensaje),
                                               String.Format("Actualizando datos de kiosco  [Archivos restantes: {0}]", response.ArchivosRestantes));
                            var result = Uow.Exportaciones.ActualizarKiosco(response.Exportacion.Archivo, AppSettings.MaxiKioscoIdentifier, response.Exportacion.Secuencia);
                            request.UltimaSecuenciaExportacion++;
                            if (!result)
                            {
                                _huboError = true;
                                AppSettings.RefreshSettings();
                                return;
                            }
                        }
                    }

                    if (vinoAlgoDeWeb)
                    {
                        CurrentForm.Invoke(new ActualizarMensajeDelegate(ActualizarMensaje), "Informando al servidor...");
                        var acuseRequest = new AcusarExportacionRequest()
                        {
                            MaxiKioscoIdentifier       = AppSettings.MaxiKioscoIdentifier,
                            UltimaSecuenciaExportacion = ultimaSecuencia,
                            HoraLocalISO = DateHelper.DateAndTimeToISO(DateTime.Now)
                        };
                        _sincronizacionService.AcusarExportacion(acuseRequest);
                    }

                    CurrentForm.Invoke(new ActualizarMensajeDelegate(ActualizarMensaje), "Actualizando stock...");
                    Uow.Stocks.Actualizar();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Maxikioscos.Comun.Helpers.ExceptionHelper.GetInnerException(ex).Message);
                _huboError = true;
                AppSettings.RefreshSettings();
            }
        }
示例#25
0
 private void TimerOnTick(object sender, EventArgs eventArgs)
 {
     Timer.Stop();
     CurrentForm.Invoke(new ActualizarMensajeDelegate(ActualizarMensaje), "");
 }
示例#26
0
 public virtual void MoveToPrevious()
 {
     CurrentForm.Hide();
     CurrentFormIndex--;
     CurrentForm.Show();
 }