Пример #1
0
        public static void ShowAlert(string CharName, string Msg, MSG_Type MSG)
        {
            //info.Image = Properties.Resources.Info;
            //info.Image = Properties.Resources.Exit;
            //info.Image = Properties.Resources.apply_16x16;

            DevExpress.XtraBars.Alerter.AlertInfo info = new DevExpress.XtraBars.Alerter.AlertInfo(CharName, Msg);
            switch (MSG)
            {
                case MSG_Type.Connect:
                    if (!Properties.Settings.Default.Alert_Connect_Disconnect)
                        return;
                    info.Image = Properties.Resources.apply_16x16;
                    break;
                case MSG_Type.Disconnect:
                    if (!Properties.Settings.Default.Alert_Connect_Disconnect)
                        return;
                    info.Image = Properties.Resources.Exit;
                    break;
                case MSG_Type.Died:
                    if (!Properties.Settings.Default.Alert_Died)
                        return;
                    info.Image = Properties.Resources.Info;
                    break;
                case MSG_Type.UnknownBotLogin:
                    info.Image = Properties.Resources.Exit;
                    break;
                default:
                    break;
            }
            if (Application.OpenForms.Count == 0)
                return;
            Application.OpenForms[0].Invoke(new MethodInvoker(() => { Alert.Show(Application.OpenForms[0], info); }));
        }
Пример #2
0
 public static void ShowAlert(string Msg, NestleICSales.Utilities.Types.MessageType msgType, Form CallForm)
 {
     DevExpress.XtraBars.Alerter.AlertInfo info = new DevExpress.XtraBars.Alerter.AlertInfo(Application.ProductName, Msg);
     switch (msgType)
     {
         case NestleICSales.Utilities.Types.MessageType.Success:
             info.Image = NestleICSales.Properties.Resources.done;
             break;
         case NestleICSales.Utilities.Types.MessageType.Error:
             info.Image = NestleICSales.Properties.Resources.error;
             break;
         case NestleICSales.Utilities.Types.MessageType.Info:
             info.Image = NestleICSales.Properties.Resources.info;
             break;
         case NestleICSales.Utilities.Types.MessageType.Debug:
             info.Image = NestleICSales.Properties.Resources.info;
             break;
         case NestleICSales.Utilities.Types.MessageType.Fatal:
             info.Image = NestleICSales.Properties.Resources.error;
             break;
         case NestleICSales.Utilities.Types.MessageType.Warn:
             info.Image = NestleICSales.Properties.Resources.info;
             break;
         default:
             break;
     }
     Alert.Show(CallForm, info);
     //Application.OpenForms[0]
 }
Пример #3
0
 public static void Show(string Msg, bool IsError, Form ThisForm, bool Popup = false)
 {
    //Msg.ToCharArray()
     byte[] byt = Encoding.UTF8.GetBytes(Msg + Environment.NewLine);
     fs.Write(byt, 0, byt.Length);
     fs.Flush();
     
     if (Popup)
     {
         DevExpress.XtraBars.Alerter.AlertInfo info = new DevExpress.XtraBars.Alerter.AlertInfo(Application.ProductName, Msg);
         if (IsError)
             info.Image = Properties.Resources.error;
         else
             info.Image = Properties.Resources.done;
         Alert.Show(ThisForm, info);
     }
 }
Пример #4
0
        private void AggiornaGrigliaMyFE()
        {
            try
            {
                if ((DateTime.Now - grigliaDateTime).TotalMinutes < 10)
                {
                    return;
                }

                grigliaDateTime = DateTime.Now;
                using (Session ses = new Session())
                {
                    var tutte = new XPCollection <Card>(ses, new BinaryOperator("Status", EnumStatoCard.Emessa));

                    var elenco = new List <InfoGrigliaCard>();

                    elenco.Add(new InfoGrigliaCard()
                    {
                        Tipologia = EnumTipologiaCard.Card2Giorni
                    });
                    elenco.Add(new InfoGrigliaCard()
                    {
                        Tipologia = EnumTipologiaCard.Card3Giorni
                    });
                    elenco.Add(new InfoGrigliaCard()
                    {
                        Tipologia = EnumTipologiaCard.Card6Giorni
                    });

                    DateTime dt  = DateTime.Now.Date;
                    DateTime qm1 = new DateTime(dt.Year, dt.Month, 1);
                    DateTime sm1 = new DateTime(dt.Year, dt.Month, 1).AddMonths(-1);

                    DateTime qs1 = dt;
                    while (qs1.DayOfWeek != DayOfWeek.Monday)
                    {
                        qs1 = qs1.AddDays(-1);
                    }
                    DateTime ss1 = qs1.AddDays(-7);

                    foreach (var item in tutte)
                    {
                        foreach (var cti in elenco)
                        {
                            if (cti.Tipologia == item.TipologiaCard)
                            {
                                cti.Totale++;
                                if (item.Stampa != null && item.Stampa.Vendita != null)
                                {
                                    if (item.Stampa.Vendita.DataContabile >= qm1)
                                    {
                                        cti.QuestoMese++;
                                    }
                                    if (item.Stampa.Vendita.DataContabile >= sm1 && item.Stampa.Vendita.DataContabile < qm1)
                                    {
                                        cti.ScorsoMese++;
                                    }
                                    if (item.Stampa.Vendita.DataContabile >= qs1)
                                    {
                                        cti.QuestaSettimana++;
                                    }
                                    if (item.Stampa.Vendita.DataContabile >= ss1 && item.Stampa.Vendita.DataContabile < qs1)
                                    {
                                        cti.ScorsaSettimana++;
                                    }
                                }
                            }
                        }
                    }

                    this.gridControlCardMyFE.DataSource = elenco;

                    //this.Invoke((MethodInvoker)delegate()
                    //{
                    //    this.gridControlCardMyFE.DataSource = elenco;
                    //});
                }
            }
            catch (Exception ex)
            {
                DevExpress.XtraBars.Alerter.AlertInfo info = new DevExpress.XtraBars.Alerter.AlertInfo("ERRORE", String.Format("12: ERRORE: {0}", ex.Message), Properties.Resources.delete);
                this.alertControlInfo.Show(this, info);
            }
        }
Пример #5
0
 public static void ShowMsg(string Msg, bool IsError, Form ThisForm, bool Popup = false)
 {
     try
     {
         MainFrm ParentFrm = (MainFrm)ThisForm.Parent.Parent;
         ParentFrm.mbRetCenterInfo.Caption = Msg;
         if (IsError)
             ParentFrm.mbRetCenterInfo.Appearance.ForeColor = System.Drawing.Color.Red;
         else
             ParentFrm.mbRetCenterInfo.Appearance.ForeColor = System.Drawing.Color.Green;
         //ActionLog += String.Format("[{0}] [{1}] : ({2}){3}", DateTime.Now.ToShortTimeString(), ThisForm.Text, Msg, Environment.NewLine);
     }
     catch
     { }
     if (Popup)
     {
         FXFW.Logger.LogDetails logDetails = new FXFW.Logger.LogDetails() { message = Msg, Owner = ThisForm };
         
         DevExpress.XtraBars.Alerter.AlertInfo info = new DevExpress.XtraBars.Alerter.AlertInfo(Application.ProductName, Msg);
         if (IsError)
             info.Image = Properties.Resources.error;
         else
             info.Image = Properties.Resources.done;
         Alert.Show(ThisForm, info);
     }
 }