Example #1
1
 private void CreateAlert(string header, string content)
 {
     this.Alert = new RadDesktopAlert();
     this.Alert.Header = header;
     this.Alert.Content = content;
     this.Alert.ShowDuration = 2500;
 }
        private void ActivateDesktopAlert(Shipment shipment)
        {
            RadDesktopAlert alert = new RadDesktopAlert();

            var closedEventBinding = new EventBinding() { EventName = "Closed", RaiseOnHandledEvents = true};
            BindingOperations.SetBinding( closedEventBinding, EventBinding.CommandProperty, new Binding() { Source = (this.DataContext as ViewModel).AlertClosedCommand });

            var eventBindings = EventToCommandBehavior.GetEventBindings(alert);
            eventBindings.Add(closedEventBinding);

            alert.CanMove = false;

            switch (shipment.DeliveryType)
            {
                case DeliveryType.Truck:
                    alert.Style = this.Resources["TruckStyle"] as Style;
                    break;
                case DeliveryType.Train:
                    alert.Style = this.Resources["TrainStyle"] as Style;
                    break;
                case DeliveryType.Ship:
                    alert.Style = this.Resources["ShipStyle"] as Style;
                    break;
            }

            alert.DataContext = shipment;
            
            this.manager.ShowAlert(alert);
        }
Example #3
1
        private void tspControl2_DropDownClosed(object sender, RoutedEventArgs e)
        {
            TimeSpan? totalTime = tspControl2.Value;

            var alert = new RadDesktopAlert();
            alert.Header = "Triggered Alert!";
            alert.Content = $"Hello, this message will self-destruct in {totalTime.Value.Seconds} seconds.";
            alert.ShowDuration = (int)totalTime.Value.TotalMilliseconds;

            //Add Icon from Theme
            alert.Icon = new Image { Source = Application.Current.FindResource("DesktopAlertIcon") as ImageSource, Width = 48, Height = 48 };
            alert.IconColumnWidth = 75;
            alert.IconMargin = new Thickness(0, 0, 10, 10);

            RadDesktopAlertManager manager = new RadDesktopAlertManager();
            manager.ShowAlert(alert);
        }
Example #4
1
 public static void Init(RadDesktopAlert ctrl)
 {
     _ctrl = ctrl;
 }
 private void ShowMessageMethod(string content, string caption)
 {
     RadDesktopAlert radDesktopAlert;
     radDesktopAlert = new RadDesktopAlert(this.components);
     radDesktopAlert.FixedSize = new System.Drawing.Size(329, 120);
     radDesktopAlert.ContentImage = Properties.Resources.waiter;
     radDesktopAlert.ContentText = content;
     radDesktopAlert.CaptionText = caption ;
     radDesktopAlert.Show();
 }
Example #6
1
 private void CheckApplicationUpdate()
 {
     if ((bool)Configuration.Updates["checkProgramUpdate"])
     {
         WriteLog("Checking for update...");
         try {
             var dver = new WebClient
             {
                 Headers = new WebHeaderCollection { { "user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)" } }
             }.DownloadString(new Uri("http://goo.gl/SIDgFx"));
             if (dver == ProductVersion)
                 WriteLog("No update found.");
             else if (dver != ProductVersion)
             {
                 WriteLog("Update avaible: " + dver);
                 var mi2 = new MethodInvoker(() =>
                 {
                     var alert = new RadDesktopAlert
                     {
                         CaptionText = @"Найдено обновление",
                         ContentText = "<html>Найдено обновление лаунчера: <b>" + dver + "</b>\nТекущая версия: <b>" +
                             ProductVersion +
                             "</b>\n Хотите ли вы пройти на страницу загрузки данного обновления?\n\nP.S. В противном случае, это уведомление будет появляться при каждом запуске лаунчера >:3",
                         ShowCloseButton = false,
                         ShowOptionsButton = false,
                         ShowPinButton = false,
                         AutoClose = false,
                         CanMove = false,
                         AutoCloseDelay = 5,
                         FixedSize = new Size(329, 235),
                         ThemeName = "VisualStudio2012Dark"
                     };
                     var openUrlButton = new RadButtonElement("Получить обновление");
                     openUrlButton.Click += delegate
                     {
                         Process.Start(@"http://goo.gl/YWCrAl");
                         alert.Hide();
                         Application.Exit();
                     };
                     var ignoreButton = new RadButtonElement("Игнорировать");
                     ignoreButton.Click += delegate { alert.Hide(); };
                     alert.ButtonItems.Add(openUrlButton);
                     alert.ButtonItems.Add(ignoreButton);
                     alert.Show();
                 });
                 Invoke(mi2);
             }
             CheckVersions();
         }
         catch (Exception ex)
         {
             WriteLog("Во время проверки обновлений возникла ошибка:\n" + ex.Message + "\nPlease, head to http://vk.com/sesmc for actual news");
             CheckVersions();
         }
     }
     else
     {
         WriteLog("Проверка наличия обновлений отлючена пользователем");
         CheckVersions();
     }
 }
        public void btnClickMe(object sender, RoutedEventArgs e)
        {
            var alert = new RadDesktopAlert();
            alert.Header = "NEW EMAIL";
            alert.Content = "Hello, Here are the resources to the Q2 DevTools Webinar.";
            alert.ShowDuration = 5000;

            //Add Icon from Theme
            alert.Icon = new Image { Source = Application.Current.FindResource("DesktopAlertIcon") as ImageSource, Width = 48, Height = 48 };
            alert.IconColumnWidth = 75;
            alert.IconMargin = new Thickness(0, 0, 10, 10);

            RadDesktopAlertManager manager = new RadDesktopAlertManager();
            manager.ShowAlert(alert);
        }
        private void ProductBrandDataForm_DeletedItem(object sender, Telerik.Windows.Controls.Data.DataForm.ItemDeletedEventArgs e)
        {
            var r = _viewModel.DeleteProductBrand((ProductBrand)e.DeletedItem);

            if (r > 0)
            {
                var manager = new RadDesktopAlertManager(AlertScreenPosition.TopCenter, new Point(0, 0), 100);

                var alert = new RadDesktopAlert
                {
                    FlowDirection = FlowDirection.RightToLeft,
                    Header        = "اطلاعات",
                    Content       = ".حذف با موفقیت انجام شد",
                    ShowDuration  = 5000,
                };
                manager.ShowAlert(alert);
            }
        }
Example #9
0
        public static Boolean initdatabase()
        {
            RadDesktopAlertManager alertmanager = new RadDesktopAlertManager();
            var r = loaddatabseconnectionfile();

            if (!r)
            {
                var alert = new RadDesktopAlert();
                alert.Header       = "Database Configuration File Error";
                alert.Content      = "Please update " + System.AppDomain.CurrentDomain.BaseDirectory + "/data/databaseconnection.json";
                alert.ShowDuration = 10000;
                System.Media.SystemSounds.Hand.Play();
                alertmanager.ShowAlert(alert);
                return(false);
            }

            var r1 = checkdatabaseserverconnection();

            if (!r1)
            {
                var alert = new RadDesktopAlert();
                alert.Header       = "Database server not running";
                alert.Content      = "Please update " + System.AppDomain.CurrentDomain.BaseDirectory + "/data/databaseconnection.json";
                alert.ShowDuration = 10000;
                System.Media.SystemSounds.Hand.Play();
                alertmanager.ShowAlert(alert);
                return(false);
            }

            var r2 = checkdatabase();

            if (!r2)
            {
                var alert = new RadDesktopAlert();
                alert.Header       = "Database " + databaseconnection.database + " does not exists.";
                alert.Content      = "Trying to create database. Please restart software";
                alert.ShowDuration = 10000;
                System.Media.SystemSounds.Hand.Play();
                alertmanager.ShowAlert(alert);
                createdatabase();
                return(false);
            }
            return(true);
        }
Example #10
0
        /// <summary>
        /// ShowAlert
        /// </summary>
        public void ShowAlert(String content, String header = "",
                              Int32 showDuration            = 3000, Boolean canMove = false, Boolean canAutoClose = true,
                              Boolean showMenuButton        = false, Boolean showInTaskSwitcher = false
                              )
        {
            var alert = new RadDesktopAlert()
            {
                Header  = header,
                Content = content,

                CanMove        = canMove,
                CanAutoClose   = canAutoClose,
                ShowDuration   = showDuration,
                ShowMenuButton = showMenuButton,
                //ShowInTaskSwitcher = showInTaskSwitcher,
            };

            _manager.ShowAlert(alert);
            adjustAlertNum();
        }
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            if (ValidateProductModel())
            {
                RaiseCanExecuteChanged();
                NavStateTrue();
                CommitAndBeginEdit();

                var manager = new RadDesktopAlertManager(AlertScreenPosition.TopCenter);

                var alert = new RadDesktopAlert
                {
                    FlowDirection = FlowDirection.RightToLeft,
                    Header        = "اطلاعات",
                    Content       = "اطلاعات با موفقیت ثبت شد",
                    ShowDuration  = 2000,
                };
                manager.ShowAlert(alert);
            }// _viewModel.SaveCommand
        }
        private void PermanentButton_Click(object sender, RoutedEventArgs e)
        {
            if (ValidateDocumetHeader())
            {
                //  StcDocumentHeader.Status = StatusEnum.Permanent;
                CommitAndBeginEdit();
                RaiseCanExecuteChanged();

                var manager = new RadDesktopAlertManager(AlertScreenPosition.TopCenter);

                var alert = new RadDesktopAlert
                {
                    FlowDirection = FlowDirection.RightToLeft,
                    Header        = "اطلاعات",
                    Content       = ".صند قطعی شد",
                    ShowDuration  = 2000,
                };
                manager.ShowAlert(alert);
            }
        }
        private void BackFromEndButton_Click(object sender, RoutedEventArgs e)
        {
            if (ValidateDocumetHeader())
            {
                //  StcDocumentHeader.Status = StatusEnum.Temporary;
                CommitAndBeginEdit();
                isModified = true;
                RaiseCanExecuteChanged();

                var manager = new RadDesktopAlertManager(AlertScreenPosition.TopCenter);

                var alert = new RadDesktopAlert
                {
                    FlowDirection = FlowDirection.RightToLeft,
                    Header        = "اطلاعات",
                    Content       = ". برگشت از خاتمه انجام شد",
                    ShowDuration  = 2000,
                };
                manager.ShowAlert(alert);
            }
        }
Example #14
0
        private void DeleteButton_Click(object sender, RoutedEventArgs e)
        {
            if (_accessUtility.HasAccess(66))
            {
                ObservableCollection <object> tLDocHeaders = RadGridView1.SelectedItems;
                if (tLDocHeaders.Count > 0)
                {
                    Deleting();
                    if (_dialogResult == true)
                    {
                        var list = RadGridView1.SelectedItems;
                        _viewModel.DeleteTLDocumentHeader((tLDocHeaders));
                        _viewModel.LoadTLDocumentHeaders();
                        var manager = new RadDesktopAlertManager(AlertScreenPosition.TopCenter);

                        var alert = new RadDesktopAlert
                        {
                            FlowDirection = FlowDirection.RightToLeft,
                            Header        = "اطلاعات",
                            Content       = ".حذف با موفقیت انجام شد",
                            ShowDuration  = 1200,
                        };
                        manager.ShowAlert(alert);
                    }
                    else
                    {
                        var manager = new RadDesktopAlertManager(AlertScreenPosition.TopCenter);

                        var alert = new RadDesktopAlert
                        {
                            FlowDirection = FlowDirection.RightToLeft,
                            Header        = "اطلاعات",
                            Content       = "سند برای حذف وجود ندارد.",
                            ShowDuration  = 1200,
                        };
                        manager.ShowAlert(alert);
                    }
                }
            }
        }
Example #15
0
        internal void ShowAlertError(string content, string detail)
        {
            var sp = new StackPanel();

            sp.Children.Add(new TextBlock()
            {
                Text = content
            });
            sp.Children.Add(new TextBlock()
            {
                Text = detail
            });
            var radDesktopAlert = new RadDesktopAlert
            {
                Header       = "Error",
                Content      = sp,
                Width        = 400,
                ShowDuration = 3000
            };

            radDesktopAlertManager.ShowAlert(radDesktopAlert);
        }
        public static async void changeaccount(dynamic obj)
        {
            try
            {
                softwaresettingrepo ssr = new softwaresettingrepo();
                var ravicosoftuser      = ssr.getbyname(commonsettingfields.ravicosoftuserid);
                if (ravicosoftuser == null)
                {
                    return;
                }
                var apiendpoint = apiendpointdefault;
                if (userutils.apiendpoint != null)
                {
                    apiendpoint = userutils.apiendpoint.stringvalue;
                }
                RestClient client  = new RestClient(apiendpoint);
                var        request = new RestRequest("changeaccount");
                obj.userid = ravicosoftuser.stringvalue;
                request.AddJsonBody(obj);
                var response = await client.PostAsync <apiresponsetype>(request);

                if (response.status == "success")
                {
                    var user = Newtonsoft.Json.JsonConvert.DeserializeObject <apiresponseuserclass>(response.data);
                    userutils.updateusersetting(user);
                    RadDesktopAlertManager manager = new RadDesktopAlertManager();
                    var alert = new RadDesktopAlert();
                    alert.Header       = "Information";
                    alert.Content      = "User account changed. Please restart software to apply update";
                    alert.ShowDuration = 5000;
                    System.Media.SystemSounds.Hand.Play();
                    manager.ShowAlert(alert);
                }
            }
            catch (Exception ex)
            {
            }
        }
        private Boolean checksystemdate()
        {
            RadDesktopAlertManager manager = new RadDesktopAlertManager();
            var currentdate   = DateTime.Now;
            var lastsaveddate = Settings.Default.lastsavedate;

            if (currentdate < lastsaveddate)
            {
                var alert = new RadDesktopAlert();
                alert.Header       = "Business Book Alert";
                alert.Content      = "Please correct your system date first";
                alert.ShowDuration = 30000;
                System.Media.SystemSounds.Hand.Play();
                manager.ShowAlert(alert);
                return(false);
            }
            else
            {
                Settings.Default.lastsavedate = DateTime.Now;
                Settings.Default.Save();
                return(true);
            }
        }
Example #18
0
        /// <summary>
        /// 右下角顯示警告提示
        /// </summary>
        /// <param name="Title">標題</param>
        /// <param name="Content">內容</param>
        /// <param name="CloseDelayTime">自動消失秒數(預設6秒)</param>
        /// <param name="ScreenDisplayPosition">提示顯示位置(Enum AlertScreenPosition)</param>
        /// <param name="PopupLocation">提示位置手動設定(new Point())</param>
        private void ShowDesktopAlert(string Title, string Content, int CloseDelayTime = 6, AlertScreenPosition ScreenDisplayPosition = AlertScreenPosition.BottomRight, Point PopupLocation = new Point())
        {
            try
            {
                Font LabelFont = new Font("微軟正黑體", 12f, FontStyle.Regular);
                Font DesktopAlertTextBtnFont = new Font("微軟正黑體", 16f, FontStyle.Bold);

                RadDesktopAlert radDesktopAlert = new RadDesktopAlert();
                radDesktopAlert.ScreenPosition = ScreenDisplayPosition;
                if (ScreenDisplayPosition == AlertScreenPosition.Manual)
                {
                    DesktopAlertPopup alertpopup = radDesktopAlert.Popup as DesktopAlertPopup;
                    if (alertpopup != null)
                    {
                        alertpopup.Location = PopupLocation;
                    }
                }
                radDesktopAlert.AutoClose      = true;
                radDesktopAlert.AutoCloseDelay = CloseDelayTime;
                radDesktopAlert.CaptionText    = Title;
                radDesktopAlert.ContentText    = Content;
                //radDesktopAlert.ThemeName = "FluentDatk";
                radDesktopAlert.AutoSize = true;
                //radDesktopAlert.ScreenPosition = AlertScreenPosition.BottomRight;
                radDesktopAlert.ShowCloseButton   = true;
                radDesktopAlert.ShowOptionsButton = false;
                radDesktopAlert.ShowPinButton     = false;
                radDesktopAlert.Popup.AlertElement.ContentElement.Font = LabelFont;
                radDesktopAlert.Popup.AlertElement.CaptionElement.TextAndButtonsElement.Font = DesktopAlertTextBtnFont;
                radDesktopAlert.Show();
            }
            catch
            {
                throw;
            }
        }
Example #19
0
        private void RadButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Datos     datos       = new DAL.Datos();
                DataTable dt          = datos.ObtenerAñosPOM(Convert.ToDecimal(lblPOM.Content)).Tables[0];
                decimal   FechaInicio = 0;
                decimal   FechaFin    = 0;
                string    sNombre     = "";

                foreach (DataRow row in dt.Rows)
                {
                    sNombre     = row["Nombre"].ToString();
                    FechaInicio = Convert.ToDecimal(row["Fecha_Inicio"]);
                    FechaFin    = Convert.ToDecimal(row["Fecha_Fin"]);
                }


                IList lista = lstScripts.SelectedItems;



                //INSERTA SI NO EXISTE EJECUTOR CALENDARIZADO
                DataTable dtEjecutor = datos.VerificaEjecutorCalendarizado(Convert.ToDecimal(lblTitulo.Content), sNombre).Tables[0];
                if (dtEjecutor.Rows.Count != 0)
                {
                    //ACTUALIZA EJECUTOR
                    foreach (ListBoxItem item in lstScripts.SelectedItems)
                    {
                        var valor = item.Content.ToString();

                        if (valor == "Script 1")
                        {
                            datos.CalendarizarEjecutor1(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 2")
                        {
                            datos.CalendarizarEjecutor2(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 3")
                        {
                            datos.CalendarizarEjecutor3(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 4")
                        {
                            datos.CalendarizarEjecutor4(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 5")
                        {
                            datos.CalendarizarEjecutor5(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 6")
                        {
                            datos.CalendarizarEjecutor6(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 7")
                        {
                            datos.CalendarizarEjecutor7(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 8")
                        {
                            datos.CalendarizarEjecutor8(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 9")
                        {
                            datos.CalendarizarEjecutor9(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 10")
                        {
                            datos.CalendarizarEjecutor10(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 11")
                        {
                            datos.CalendarizarEjecutor11(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 12")
                        {
                            datos.CalendarizarEjecutor12(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 13")
                        {
                            datos.CalendarizarEjecutor13(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 14")
                        {
                            datos.CalendarizarEjecutor14(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 15")
                        {
                            datos.CalendarizarEjecutor15(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 16")
                        {
                            datos.CalendarizarEjecutor16(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 17")
                        {
                            datos.CalendarizarEjecutor17(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }

                        if (valor == "Politicas de pago")
                        {
                            //Politicas de Pago
                            datos.CalendarizarPolitica180(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                            datos.CalendarizarPolitica120(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                            datos.CalendarizarPolitica90(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                            datos.CalendarizarPolitica60(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                            datos.CalendarizarPolitica45(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                            datos.CalendarizarPolitica2030(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }

                        if (valor == "Script 18")
                        {
                            datos.CalendarizarEjecutor18(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 19")
                        {
                            datos.CalendarizarEjecutor19(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 20")
                        {
                            datos.CalendarizarEjecutor20(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 21")
                        {
                            datos.CalendarizarEjecutor21(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 22")
                        {
                            datos.CalendarizarEjecutor22(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 23")
                        {
                            datos.CalendarizarEjecutor23(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 24")
                        {
                            datos.CalendarizarEjecutor24(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 25")
                        {
                            datos.CalendarizarEjecutor25(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 26")
                        {
                            datos.CalendarizarEjecutor26(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                    }
                }
                else
                {
                    //INSERTA EJECUTOR
                    datos.CalendarizarEjecutor(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);

                    foreach (ListBoxItem item in lstScripts.SelectedItems)
                    {
                        var valor = item.Content.ToString();

                        if (valor == "Script 1")
                        {
                            datos.CalendarizarEjecutor1(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 2")
                        {
                            datos.CalendarizarEjecutor2(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 3")
                        {
                            datos.CalendarizarEjecutor3(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 4")
                        {
                            datos.CalendarizarEjecutor4(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 5")
                        {
                            datos.CalendarizarEjecutor5(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 6")
                        {
                            datos.CalendarizarEjecutor6(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 7")
                        {
                            datos.CalendarizarEjecutor7(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 8")
                        {
                            datos.CalendarizarEjecutor8(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 9")
                        {
                            datos.CalendarizarEjecutor9(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 10")
                        {
                            datos.CalendarizarEjecutor10(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 11")
                        {
                            datos.CalendarizarEjecutor11(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 12")
                        {
                            datos.CalendarizarEjecutor12(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 13")
                        {
                            datos.CalendarizarEjecutor13(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 14")
                        {
                            datos.CalendarizarEjecutor14(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 15")
                        {
                            datos.CalendarizarEjecutor15(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 16")
                        {
                            datos.CalendarizarEjecutor16(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 17")
                        {
                            datos.CalendarizarEjecutor17(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }

                        if (valor == "Politicas de pago")
                        {
                            //Politicas de Pago
                            datos.CalendarizarPolitica180(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                            datos.CalendarizarPolitica120(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                            datos.CalendarizarPolitica90(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                            datos.CalendarizarPolitica60(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                            datos.CalendarizarPolitica45(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                            datos.CalendarizarPolitica2030(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }

                        if (valor == "Script 18")
                        {
                            datos.CalendarizarEjecutor18(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 19")
                        {
                            datos.CalendarizarEjecutor19(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 20")
                        {
                            datos.CalendarizarEjecutor20(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 21")
                        {
                            datos.CalendarizarEjecutor21(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 22")
                        {
                            datos.CalendarizarEjecutor22(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 23")
                        {
                            datos.CalendarizarEjecutor23(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 24")
                        {
                            datos.CalendarizarEjecutor24(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 25")
                        {
                            datos.CalendarizarEjecutor25(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                        if (valor == "Script 26")
                        {
                            datos.CalendarizarEjecutor26(Convert.ToDecimal(lblTitulo.Content), Convert.ToDecimal(lblPOM.Content), FechaInicio, FechaFin, sNombre);
                        }
                    }
                }


                this.Close();
                var alert = new RadDesktopAlert();
                alert.Header  = "NOTIFICACIÓN";
                alert.Content = "El Ejecutor se calendarizó.";
                RadDesktopAlertManager manager = new RadDesktopAlertManager();
                manager.ShowAlert(alert);
            }
            catch (Exception ex)
            {
                var alert = new RadDesktopAlert();
                alert.Header  = "NOTIFICACIÓN";
                alert.Content = ex.Message;
                RadDesktopAlertManager manager = new RadDesktopAlertManager();
                manager.ShowAlert(alert);
            }
        }
        private void btnSendEmail_Click(object sender, EventArgs e)
        {
            try
            {
                btnSendEmail.Enabled = false;
                string error = string.Empty;

                string msg = txtMessage.Text.Trim();


                if (string.IsNullOrEmpty(txtTo.Text.Trim()))
                {
                    error += "Required : To" + Environment.NewLine;
                }

                if (string.IsNullOrEmpty(msg))
                {
                    error += "Cannot send empty message..";
                }


                if (!string.IsNullOrEmpty(error))
                {
                    ENUtils.ShowMessage(error);
                    return;
                }

                EuroSMS sms = new EuroSMS();


                string[] toNumbers = txtTo.Text.Split(',').Where(c => c != string.Empty).Distinct().ToArray <string>();



                Thread smsThread = new Thread(delegate()
                {
                    SendSMS(sms, toNumbers, msg);


                    if (SMSBunchMessages == true)
                    {
                        SendSMSBunch();
                        SMSBunchMessages = false;
                        //txtMessage.ReadOnly = false;
                    }
                });

                smsThread.Start();



                General.SaveSentSMS(msg, txtTo.Text.ToStr());


                if (AppVars.objPolicyConfiguration.DisablePopupNotifications.ToBool() == false)
                {
                    RadDesktopAlert alert = new RadDesktopAlert();
                    alert.CaptionText = "message sent successfully";

                    alert.ContentText  = msg;
                    alert.ContentImage = Resources.Resource1.email;
                    alert.Show();
                }

                this.Close();
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
            finally
            {
                btnSendEmail.Enabled = true;
            }
        }
        private void EmailInvoices(long TransId)
        {
            bool IsSuccess = false;

            try
            {
                string subject = txtSubject.Text.Trim();

                if (string.IsNullOrEmpty(subject))
                {
                    ENUtils.ShowMessage("Required : Email Subject");
                    return;
                }


                if (txtBody.Text.Trim().Length > 0)
                {
                    subject += "||" + txtBody.Text;
                }

                List <GridViewRowInfo> rows = null;


                if (TransId == 0)
                {
                    rows = grdLister.Rows.Where(c => c.Cells["Check"].Value.ToBool() == true).ToList();
                }
                else
                {
                    rows = grdLister.Rows.Where(c => c.Cells["RentId"].Value.ToLong() == TransId).ToList();
                }



                //List<long> invoiceIds = rows.Select(c => c.Cells["RentId"].Value.ToLong()).ToList<long>();


                List <long> invoiceIds = new List <long>();

                if (TransId == 0)
                {
                    invoiceIds = rows.Select(c => c.Cells["RentId"].Value.ToLong()).ToList <long>();
                }
                else
                {
                    invoiceIds = new List <long>();
                    invoiceIds.Add(TransId);
                }


                if (invoiceIds.Count > 0)
                {
                    frmDriverRentTransactionExpensesReport3 frm = new frmDriverRentTransactionExpensesReport3(1);
                    frm.reportViewer1.Tag = "invoice";
                    var list  = General.GetQueryable <vu_DriverRentExpense>(a => invoiceIds.Contains(a.Id)).ToList();
                    var list2 = General.GetQueryable <vu_FleetDriverRentExpense>(a => invoiceIds.Contains(a.Id)).ToList();

                    List <Fleet_Driver> driversList = General.GetQueryable <Fleet_Driver>(c => c.DriverTypeId == 1).ToList();

                    frmEmail frmEmail = new frmEmail(null, "", "");

                    Fleet_Driver objDriver = null;
                    foreach (var item in rows.Where(c => c.Cells["Check"].Value.ToBool()))
                    {
                        if (optFullDetail.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
                        {
                            frm.optFullDetail.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On;
                        }
                        else if (optAccountJobs.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
                        {
                            frm.optAccountJobs.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On;
                        }
                        else if (optSummaryDetails.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
                        {
                            frm.optSummaryDetails.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On;
                        }
                        frm.DataSource  = list.Where(c => c.Id == item.Cells["RentId"].Value.ToLong()).OrderBy(c => c.PickupDate).ToList();
                        frm.DataSource2 = list2.Where(c => c.RentId == item.Cells["RentId"].Value.ToLong()).OrderBy(c => c.Date).ToList();
                        //    frm.objSubcompany = objSubcompany;
                        frm.objSubcompany = driversList.FirstOrDefault(C => C.Id == item.Cells["DriverId"].Value.ToInt()).DefaultIfEmpty().Gen_SubCompany.DefaultIfEmpty();

                        frm.GenerateReport(item.Cells["VAT"].Value.ToDecimal());

                        objDriver = driversList.FirstOrDefault(c => c.Id == item.Cells["DriverId"].Value.ToInt());
                        //string email = driversList.FirstOrDefault(c => c.Id == item.Cells[COLS.Id].Value.ToInt()).DefaultIfEmpty().Email.ToStr().Trim();
                        string email = "";

                        if (objDriver != null)
                        {
                            email = objDriver.Email.ToStr().Trim();
                        }

                        if (!string.IsNullOrEmpty(email))
                        {
                            IsSuccess = frm.SendEmailInternally(frmEmail, subject, objDriver.DriverNo.ToStr().Trim(), email);
                        }
                    }


                    if (frmEmail != null && frmEmail.IsDisposed == false)
                    {
                        frmEmail.Close();
                        GC.Collect();
                    }


                    if (IsSuccess)
                    {
                        RadDesktopAlert alert = new RadDesktopAlert();
                        alert.ContentText = "Email has been sent successfully";
                        alert.Show();
                    }
                    // ENUtils.ShowMessage("Email has been sent successfully");
                }
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
 public static void Init(RadDesktopAlert ctrl)
 {
     _ctrl = ctrl;
 }
Example #23
0
 public void ShowAlert(RadDesktopAlert radDesktopAlert)
 {
     radDesktopAlert.Background = Brushes.Black;
     radDesktopAlert.Foreground = Brushes.White;
     radDesktopAlertManager.ShowAlert(radDesktopAlert);
 }
Example #24
0
 public ExchangeView()
 {
     InitializeComponent();
     this.WhenActivated(disposables =>
     {
         //d(this.OneWayBind(this.ViewModel, vm => vm.RefreshMarketSummariesElapsed, v => v.lblRefreshMarketSummariesElapsed.Content));
         //d(this.OneWayBind(this.ViewModel, vm => vm.RefreshTradesElapsed, v => v.lblRefreshTradesElapsed.Content));
         //d(this.OneWayBind(this.ViewModel, vm => vm.RefreshDepositsElapsed, v => v.lblRefreshDepositsElapsed.Content));
         //d(this.OneWayBind(this.ViewModel, x => x.Markets, x => x.cmbMarkets.ItemsSource));
         //d(this.Bind(this.ViewModel, x => x.CurrentSymbol, x => x.cmbMarkets.SelectedValue));
         //d(this.OneWayBind(this.ViewModel, x => x.MarketsByAsset, x => x.pnlMarkets.ItemsSource));
         //d(this.OneWayBind(this.ViewModel, x => x.MarketsByAsset, x => x.pnlTickers.ItemsSource));
         //d(this.BindCommand(this.ViewModel, x => x.GetRecentTradesCommand, x => x.btnGetTrades));
         //d(this.OneWayBind(this.ViewModel, x => x.RecentTrades, x => x.grdTrades.ItemsSource));
         //d(this.OneWayBind(this.ViewModel, vm => vm.OrderBook, x => x.grdOrderBook.ItemsSource));
         //d(this.OneWayBind(this.ViewModel, x => x.PriceTicker, x => x.grdOrderBook.ItemsSource));
         //d(this.OneWayBind(this.ViewModel, vm => vm.Deposits, v => v.grdDeposits.ItemsSource));
         //d(this.OneWayBind(this.ViewModel, vm => vm.Withdrawals, v => v.grdWithdrawals.ItemsSource));
         //d(this.Bind(this.ViewModel, vm => vm.MarketFilter, v => v.txtMarketFilter.Text));
         //d(this.OneWayBind(this.ViewModel, vm => vm, v => v.brdFunds.DataContext));
         this.OneWayBind(this.ViewModel, x => x, x => x.priceTicker.DataContext).DisposeWith(disposables);
         this.ViewModel
         .CreateTask
         .RegisterHandler(
             interaction =>
         {
             var wnd = new Window
             {
                 Content               = interaction.Input,
                 ContentTemplate       = Application.Current.Resources["rxuiViewModelHostTemplate"] as DataTemplate,
                 Owner                 = Application.Current.MainWindow,
                 ShowInTaskbar         = false,
                 ShowActivated         = true,
                 SizeToContent         = SizeToContent.WidthAndHeight,
                 Title                 = "Новый трейд",
                 WindowStartupLocation = WindowStartupLocation.CenterOwner,
                 WindowStyle           = WindowStyle.ToolWindow
             };
             return(Observable.Start(() =>
             {
                 var result = wnd.ShowDialog();
                 interaction.SetOutput(result.GetValueOrDefault());
             }, RxApp.MainThreadScheduler));
         }).DisposeWith(disposables);
         this.ViewModel
         .Confirm
         .RegisterHandler(
             interaction =>
         {
             var result = MessageBox.Show(Application.Current.MainWindow, interaction.Input, "Подтверждение", MessageBoxButton.YesNo, MessageBoxImage.Question);
             interaction.SetOutput(result == MessageBoxResult.Yes);
         }).DisposeWith(disposables);
         this.ViewModel
         .ShowException
         .RegisterHandler(
             interaction =>
         {
             MessageBox.Show(Application.Current.MainWindow, interaction.Input.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
             interaction.SetOutput(Unit.Default);
         }).DisposeWith(disposables);
         this.ViewModel
         .Alert
         .RegisterHandler(
             interaction =>
         {
             var alert = new RadDesktopAlert()
             {
                 CanAutoClose = false,
                 Content      = interaction.Input,
                 Header       = "Trading Bot Alert"
             };
             //Dispatcher.Invoke(() => alertManager.ShowAlert(alert));
             MessageBox.Show(Application.Current.MainWindow, interaction.Input, ViewModel.ExchangeName, MessageBoxButton.OK, MessageBoxImage.Exclamation);
             interaction.SetOutput(Unit.Default);
         }).DisposeWith(disposables);
     });
 }
Example #25
0
        public void importa()
        {
            try
            {
                OpenFileDialog openfile = new OpenFileDialog();
                openfile.DefaultExt = ".xlsx";
                openfile.Filter     = "(.xlsx)|*.xlsx";
                //openfile.ShowDialog();

                var browsefile = openfile.ShowDialog();

                if (browsefile == true)
                {
                    txtFilePath.Text = openfile.FileName;

                    Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
                    //Static File From Base Path...........
                    //Microsoft.Office.Interop.Excel.Workbook excelBook = excelApp.Workbooks.Open(AppDomain.CurrentDomain.BaseDirectory + "TestExcel.xlsx", 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
                    //Dynamic File Using Uploader...........
                    Microsoft.Office.Interop.Excel.Workbook  excelBook  = excelApp.Workbooks.Open(txtFilePath.Text.ToString(), 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
                    Microsoft.Office.Interop.Excel.Worksheet excelSheet = (Microsoft.Office.Interop.Excel.Worksheet)excelBook.Worksheets.get_Item(1);;
                    Microsoft.Office.Interop.Excel.Range     excelRange = excelSheet.UsedRange;

                    //string strCellData = "";
                    //double douCellData;
                    int rowCnt = 0;
                    int colCnt = 0;
                    Thread.CurrentThread.CurrentCulture = new CultureInfo("es-MX");
                    DataTable dt = new DataTable();
                    for (colCnt = 1; colCnt <= excelRange.Columns.Count; colCnt++)
                    {
                        string strColumn = "";
                        strColumn = (string)(excelRange.Cells[1, colCnt] as Microsoft.Office.Interop.Excel.Range).Value2;
                        dt.Columns.Add(strColumn, typeof(string));
                    }

                    int columns_count = excelRange.Columns.Count;
                    int rows_count    = excelRange.Rows.Count;

                    for (rowCnt = 2; rowCnt <= rows_count; rowCnt++)
                    {
                        object[] strData = new object[columns_count];

                        for (int clm = 0; clm < columns_count; clm++)
                        {
                            strData[clm] = ((Microsoft.Office.Interop.Excel.Range)excelSheet.Cells[rowCnt, clm + 1]).Value2;
                        }


                        dt.Rows.Add(strData);
                        //dt.Rows.Add(
                        //                ((Microsoft.Office.Interop.Excel.Range)excelSheet.Cells[rowCnt, 1]).Value2,
                        //                ((Microsoft.Office.Interop.Excel.Range)excelSheet.Cells[rowCnt, 2]).Value2,
                        //                ((Microsoft.Office.Interop.Excel.Range)excelSheet.Cells[rowCnt, 3]).Value2,
                        //                ((Microsoft.Office.Interop.Excel.Range)excelSheet.Cells[rowCnt, 4]).Value2,
                        //                ((Microsoft.Office.Interop.Excel.Range)excelSheet.Cells[rowCnt, 5]).Value2,
                        //                ((Microsoft.Office.Interop.Excel.Range)excelSheet.Cells[rowCnt, 6]).Value2,
                        //                ((Microsoft.Office.Interop.Excel.Range)excelSheet.Cells[rowCnt, 7]).Value2,
                        //                ((Microsoft.Office.Interop.Excel.Range)excelSheet.Cells[rowCnt, 8]).Value2,
                        //                ((Microsoft.Office.Interop.Excel.Range)excelSheet.Cells[rowCnt, 9]).Value2

                        //);
                    }

                    gvData.ItemsSource = dt.DefaultView;

                    excelBook.Close(true, null, null);
                    excelApp.Quit();

                    var alert = new RadDesktopAlert();
                    alert.Header       = "NOTIFICACIÓN";
                    alert.Content      = "El archivo se cargó exitosamente.";
                    alert.ShowDuration = 3000;
                    RadDesktopAlertManager manager = new RadDesktopAlertManager();
                    manager.ShowAlert(alert);
                }
                else
                {
                    btGuardar.Visibility  = Visibility.Hidden;
                    btCancelar.Visibility = Visibility.Hidden;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
            }
        }
        public void DespatchJob()
        {
            List <string> listofErrors = new List <string>();

            bool IsDespatched = OnDespatching(ref listofErrors);

            if (IsDespatched)
            {
                try
                {
                    (new TaxiDataContext()).stp_DespatchedJob(this.JobId, ObjDriver.Id, false, false, false, false, AppVars.LoginObj.LoginName.ToStr(), Enums.BOOKINGSTATUS.DISPATCHED);

                    if (chkCompleteJob.Checked == false)
                    {
                        bool autoDespatch = objBooking.AutoDespatch.ToBool();
                        if ((!this.IsAutoDespatchActivity || !autoDespatch))
                        {
                            int?driverId = ObjDriver.Id.ToIntorNull();

                            Fleet_DriverQueueList driverCurrent = General.GetQueryable <Fleet_DriverQueueList>(c => c.Status == true && c.DriverId == driverId)
                                                                  .OrderByDescending(c => c.Id).FirstOrDefault();

                            if (driverCurrent != null)
                            {
                                General.OnDespatchUpdateDriverQueue(driverCurrent.Id, objBooking.Id, General.GetPostCodeMatch(objBooking.ToAddress.ToStr().Trim()));
                                RefreshBookingList();
                            }



                            SuccessDespatched = true;



                            RadDesktopAlert alert = new RadDesktopAlert();
                            alert.AutoCloseDelay    = 5;
                            alert.FadeAnimationType = FadeAnimationType.None;

                            alert.CaptionText = "Job No : " + objBooking.BookingNo.ToStr() + " Despatch Successfully";
                            alert.ContentText = "Driver : " + ObjDriver.DriverName;

                            alert.ContentText += Environment.NewLine + "Pickup Date-Time : "
                                                 + string.Format("{0:dd/MM/yyyy hh:mm tt}", objBooking.PickupDateTime);

                            alert.Show();
                        }
                    }


                    if (!this.IsAutoDespatchActivity)
                    {
                        new BroadcasterData().BroadCastToAll(RefreshTypes.REFRESH_ONLY_DASHBOARD);
                    }

                    this.Close();
                }
                catch (Exception ex)
                {
                    ENUtils.ShowMessage(ex.Message);
                }
            }
            else
            {
                lblNocMessage.Text      = "Job Despatch Failed..";
                lblNocMessage.ForeColor = Color.Red;
                lblNocMessage.Visible   = true;

                int cnt = listofErrors.Count;
                if (cnt == 1)
                {
                    lblSmsError1.Visible = true;
                    lblSmsError1.Text    = listofErrors[0].ToStr();
                }

                if (cnt == 2)
                {
                    lblSmsError1.Visible = true;
                    lblSmsError1.Text    = listofErrors[0].ToStr();

                    lblSMSError2.Visible = true;
                    lblSMSError2.Text    = listofErrors[1].ToStr();
                }
            }
        }
Example #27
0
 /// <summary>
 /// ShowAlert
 /// </summary>
 public void ShowAlert(RadDesktopAlert alert)
 {
     _manager.ShowAlert(alert);
     adjustAlertNum();
 }
Example #28
0
        private void bLogar_Click(object sender, EventArgs e)
        {
            ValidaLogin();

            if (!string.IsNullOrEmpty(tbUsuario.Text) && !string.IsNullOrEmpty(tbSenha.Text))
            {
                using (var db = new DataBaseDataContext())
                {
                    var usuarios = db.Usuarios.Where(u => u.NM_LOGIN == tbUsuario.Text.Trim() && u.NM_SENHA == senha.Trim() && u.FL_HABILITA == 1);

                    if (usuarios.Count() == 0)
                    {
                        var alert = new RadDesktopAlert();
                        alert.ContentText = "\"Usuário\" e/ou \"Senha\" inválido(s)";
                        alert.Show();
                    }
                    else
                    {
                        var usuario = usuarios.Single(u => u.ID_USUARIO == usuarios.First().ID_USUARIO);

                        if (usuario.ID_PERFIL != 3)
                        {
                            usuario.DT_ULTIMO_ACESSO  = DateTime.Now;
                            usuario.NR_ULTIMO_ACESSO += 1;

                            db.SubmitChanges();

                            var usuarioLogado = db.UsuarioLogados.FirstOrDefault();

                            if (usuarioLogado == null)
                            {
                                var uL = new UsuarioLogado();

                                uL.ID_USUARIO = usuario.ID_USUARIO;

                                db.UsuarioLogados.InsertOnSubmit(uL);
                            }
                            else
                            {
                                usuarioLogado.ID_USUARIO = usuario.ID_USUARIO;
                            }

                            db.SubmitChanges();

                            tbUsuario.Text = string.Empty;
                            tbSenha.Text   = string.Empty;

                            var alert = new RadDesktopAlert();
                            alert.ContentText = $"Bem-vindo {usuario.NM_LOGIN}!";
                            alert.Show();

                            Default telaInicial = new Default();
                            telaInicial.Show();

                            this.Visible = false;
                        }
                        else
                        {
                            var alert = new RadDesktopAlert();
                            alert.ContentText = "Perfil \"Cliente\" por favor, acesse o sistema via web";
                            alert.Show();
                        }
                    }
                }
            }
        }
        void btnExportExcel_Click(object sender, EventArgs e)
        {
            if (grdLister.Rows.Count == 0)
            {
                return;
            }

            try
            {
                saveFileDialog1.Filter = "Excel File (*.xls)|*.xls|AdvExcel File (*.xlsx)|*.xlsx";

                saveFileDialog1.Title    = "Save File";
                saveFileDialog1.FileName = "Drivers Weekly Rent Sheet";


                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    grdLister.Columns["IsPaid"].IsVisible    = false;
                    grdLister.Columns["Paid"].IsVisible      = true;
                    grdLister.Columns["btnUpdate"].IsVisible = false;

                    grdLister.Columns["Active"].Width      = 35;
                    grdLister.Columns["Active"].HeaderText = "Active";

                    grdLister.Columns["DriverNo"].Width      = 38;
                    grdLister.Columns["DriverNo"].HeaderText = "Driver";

                    grdLister.Columns["AccountBookings"].Width      = 70;
                    grdLister.Columns["AccountBookings"].HeaderText = "A/C Bookings";

                    grdLister.Columns["TotalRentCommission"].Width = 60;

                    grdLister.Columns["OfficeToPay"].Width     = 70;
                    grdLister.Columns["PreviousBalance"].Width = 65;

                    //   grdLister.Columns["Total"].Width = 80;
                    grdLister.Columns["DriverToPay"].Width = 70;
                    grdLister.Columns["Paid"].Width        = 30;


                    var row = grdLister.Rows.OrderByDescending(c => c.Cells["ToDate"].Value.ToDate()).FirstOrDefault();

                    DateTime?dtCurrent = row.Cells["FromDate"].Value.ToDate();
                    DateTime dtEnd     = row.Cells["ToDate"].Value.ToDate();


                    Microsoft.Reporting.WinForms.ReportParameter[] param = new Microsoft.Reporting.WinForms.ReportParameter[1];
                    string heading = string.Empty;
                    heading = "Drivers Weekly Rent Sheet - " + string.Format("from {0:dd/MM/yyyy}", dtCurrent) + " until " + string.Format("{0:dd/MM/yyyy}", dtEnd);

                    ClsExportGridView obj = new ClsExportGridView(grdLister, saveFileDialog1.FileName);
                    obj.ApplyCellFormatting         = true;
                    obj.ConditionalFormattingObject = new StyleDataRowConditionalFormattingObject();
                    obj.ConditionalFormattingObject.ConditionFormattingColumnName = "Paid";
                    obj.ConditionalFormattingObject.RowBackColor = Color.LightGreen;
                    obj.ConditionalFormattingObject.RowForeColor = Color.Black;
                    obj.ConditionalFormattingObject.TValue       = "Paid";



                    obj.Heading = heading;
                    if (obj.ExportExcel())
                    {
                        RadDesktopAlert alert = new RadDesktopAlert();
                        alert.CaptionText = "Export";
                        alert.ContentText = "<html> <b><span style=font-size:medium><color=Blue>Export Successfully</span></b></html>";
                        alert.Show();
                    }


                    SetDefaultColumnSettings();
                }
            }
            catch (Exception ex)
            {
                SetDefaultColumnSettings();
                ENUtils.ShowMessage(ex.Message);
            }
        }
Example #30
0
        private void radButton1_Click(object sender, EventArgs e)
        {
            int affected = 0, rowsAffected = -1;

            if (radCheckBox1.Checked)
            {
                bool validNumber = true;
                foreach (char c in radTextBox1.Text)
                {
                    validNumber = (c >= '0' && c <= '9');
                    if (!validNumber)
                    {
                        break;
                    }
                }
                if (validNumber)
                {
                    affected = HANO.SqlNonQueryExec("DELETE FROM passenger WHERE passengerID = " + radTextBox1.Text);
                    if (affected > 0)
                    {
                        MessageBox.Show("Deleted passenger from " + affected + " places successfully.");
                    }
                    if (affected == 0)
                    {
                        MessageBox.Show("Passenger not found");
                    }
                }
                else
                {
                    MessageBox.Show("This is not a number...", "Error!");
                }
            }
            else if (radCheckBox2.Checked)
            {
                DataTable dt = HANO.SqlQueryExec("SELECT personID FROM person WHERE First_Name='" + radTextBox2.Text + "' and Last_Name='" + radTextBox3.Text + "'");
                rowsAffected = dt.Rows.Count;
                switch (rowsAffected)
                {
                case 0:
                    MessageBox.Show("No matching passengers found!");
                    break;

                case 1:
                    HANO.SqlNonQueryExec("DELETE FROM passenger WHERE passenger.personID '" + dt.Rows[0][0].ToString() + "'");
                    MessageBox.Show("Removed the passenger successfully.", "Success");
                    break;

                default:
                    RadDesktopAlert ra = new RadDesktopAlert();
                    ra.CaptionText = "Error Executing!";
                    ra.ContentText = "More than one passenger were found with the given first and last names!";
                    ra.Show();
                    break;
                }
            }
            else
            {
                RadDesktopAlert ra = new RadDesktopAlert();
                ra.CaptionText = "Select at least one method!";
                ra.ContentText = "You must select between the ID method or the First/Last Name method.";
                ra.Show();
            }
        }
Example #31
0
 public NotificationService(RadDesktopAlert rda)
 {
     this.rda = rda;
 }
        private void EmailInvoices(long TransId)
        {
            bool IsSuccess = false;

            try
            {
                string subject = txtSubject.Text.Trim();

                if (string.IsNullOrEmpty(subject))
                {
                    ENUtils.ShowMessage("Required : Email Subject");
                    return;
                }

                List <GridViewRowInfo> rows = null;


                if (TransId == 0)
                {
                    rows = grdDriverCommission.Rows.Where(c => c.Cells["Check"].Value.ToBool() == true).ToList();
                }
                else
                {
                    rows = grdDriverCommission.Rows.Where(c => c.Cells["CommissionId"].Value.ToLong() == TransId).ToList();
                }



                //List<long> invoiceIds = rows.Select(c => c.Cells["CommissionId"].Value.ToLong()).ToList<long>();


                List <long> invoiceIds = new List <long>();

                if (TransId == 0)
                {
                    invoiceIds = rows.Select(c => c.Cells["CommissionId"].Value.ToLong()).ToList <long>();
                }
                else
                {
                    invoiceIds = new List <long>();
                    invoiceIds.Add(TransId);
                }


                if (invoiceIds.Count > 0)
                {
                    frmDriverCommisionTransactionExpensesReport3 frm = new frmDriverCommisionTransactionExpensesReport3(1);

                    var list  = General.GetQueryable <vu_DriverCommisionExpenses2>(a => invoiceIds.Contains(a.Id)).ToList();
                    var list2 = General.GetQueryable <vu_FleetDriverCommissionExpense>(a => invoiceIds.Contains(a.Id)).ToList();

                    List <Fleet_Driver> driversList = General.GetQueryable <Fleet_Driver>(c => c.DriverTypeId == 2).ToList();

                    frmEmail frmEmail = new frmEmail(null, "", "");

                    Fleet_Driver objDriver = null;
                    foreach (var item in rows.Where(c => c.Cells["Check"].Value.ToBool()))
                    {
                        frm.DataSource  = list.Where(c => c.Id == item.Cells["CommissionId"].Value.ToLong()).OrderBy(c => c.PickupDate).ToList();
                        frm.DataSource2 = list2.Where(c => c.CommissionId == item.Cells["CommissionId"].Value.ToLong()).OrderBy(c => c.Date).ToList();

                        frm.GenerateReport();

                        objDriver = driversList.FirstOrDefault(c => c.Id == item.Cells["DriverId"].Value.ToInt());
                        //string email = driversList.FirstOrDefault(c => c.Id == item.Cells[COLS.Id].Value.ToInt()).DefaultIfEmpty().Email.ToStr().Trim();
                        string email = objDriver.Email.ToStr().Trim();

                        if (!string.IsNullOrEmpty(email))
                        {
                            IsSuccess = frm.SendEmailInternally(frmEmail, subject, objDriver.DriverNo.ToStr().Trim(), email);
                        }
                    }


                    if (frmEmail != null && frmEmail.IsDisposed == false)
                    {
                        frmEmail.Close();
                        GC.Collect();
                    }


                    if (IsSuccess)
                    {
                        RadDesktopAlert alert = new RadDesktopAlert();
                        alert.ContentText = "Email has been sent successfully";
                        alert.Show();
                    }
                    // ENUtils.ShowMessage("Email has been sent successfully");
                }
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
Example #33
0
 public NotificationService(RadDesktopAlert rda)
 {
     this.rda = rda;
 }
Example #34
0
        private void ContextMenuClick(object sender, RoutedEventArgs e)
        {
            //GL gl = ClickedTreeViewItem.DataContext as GL;
            //TL tl = ClickedTreeViewItem.DataContext as TL;
            var SystemAccountingSettingModel = _systemAccountingSettingsService.GetSystemAccountingSettingModel();

            int.TryParse(SystemAccountingSettingModel.GLLength, out int SystemAccountingSettingModelGLLength);

            // var SystemAccountingSettingModelGLLength = int.Parse(SystemAccountingSettingModel.GLLength);
            long   lastGLCode   = _gLsService.GetLastGLCode() + 1;
            var    lastGLLenght = (lastGLCode.ToString()).Length;
            string tag          = (e.OriginalSource as RadMenuItem).Tag as string;

            if (ClickedTreeViewItem == null)
            {
                if (lastGLLenght == SystemAccountingSettingModelGLLength)
                {
                    AddGLTreeItemWindow addGLTreeItemWindow0 = SmObjectFactory.Container.GetInstance <AddGLTreeItemWindow>();
                    var treeGL = addGLTreeItemWindow0.DataContext as AddGLTreeItemWindowViewModel;
                    //   treeGL.GL = gl;
                    treeGL.SaveClicked += (g) =>
                    {
                        //addTLTreeItemWindow0.DataItem.GL = gl;
                        g.ImageUrl = "../../Resources/cian.png";
                        _vm.AddGL(g);
                        g.GLId = _vm.GetGLId(g.GLCode);
                        _vm.Items.Add(g);
                        //_vm.Save();
                        addGLTreeItemWindow0.Close();
                        // gl.TLs.Add(addTLTreeItemWindow0.DataItem);
                        //     gl.IsExpanded = true; // Ensure that the new child is visible
                        //using (var uow = new SainaDbContext())
                        //{
                        //    uow.GLs.Add(g);
                        //    uow.SaveChanges();
                        //    addGLTreeItemWindow0.Close();
                        //}
                    };
                    addGLTreeItemWindow0.Width    = 1000;
                    addGLTreeItemWindow0.Height   = 500;
                    addGLTreeItemWindow0.CanClose = true;
                    addGLTreeItemWindow0.Owner    = Window.GetWindow(this);
                    addGLTreeItemWindow0.Show();
                }
                else
                {
                    DialogParameters parameters = new DialogParameters();
                    parameters.OkButtonContent = "بستن";
                    parameters.Header          = "اخطار";
                    parameters.Content         = " شماره گذاری این حساب  به پایان رسیده است";
                    RadWindow.Alert(parameters);
                }
            }
            else if (ClickedTreeViewItem.DataContext is GL gl)
            {
                if (tag == "newGL")
                {
                    if (_accessUtility.HasAccess(70))
                    {
                        if (lastGLLenght == SystemAccountingSettingModelGLLength)
                        {
                            AddGLTreeItemWindow addGLTreeItemWindow0 = SmObjectFactory.Container.GetInstance <AddGLTreeItemWindow>();
                            var treeGL = addGLTreeItemWindow0.DataContext as AddGLTreeItemWindowViewModel;
                            //   treeGL.GL = gl;
                            treeGL.SaveClicked += (g) =>
                            {
                                //addTLTreeItemWindow0.DataItem.GL = gl;
                                g.ImageUrl = "../../Resources/cian.png";
                                _vm.AddGL(g);
                                g.GLId = _vm.GetGLId(g.GLCode);
                                _vm.Items.Add(g);
                                //_vm.Save();
                                addGLTreeItemWindow0.Close();
                                // gl.TLs.Add(addTLTreeItemWindow0.DataItem);
                                gl.IsExpanded = true; // Ensure that the new child is visible
                                                      //using (var uow = new SainaDbContext())
                                                      //{
                                                      //    uow.GLs.Add(g);
                                                      //    uow.SaveChanges();
                                                      //    addGLTreeItemWindow0.Close();
                                                      //}
                            };
                            addGLTreeItemWindow0.Width    = 1000;
                            addGLTreeItemWindow0.Height   = 500;
                            addGLTreeItemWindow0.CanClose = true;
                            addGLTreeItemWindow0.Owner    = Window.GetWindow(this);
                            addGLTreeItemWindow0.Show();
                        }

                        else
                        {
                            DialogParameters parameters = new DialogParameters();
                            parameters.OkButtonContent = "بستن";
                            parameters.Header          = "اخطار";
                            parameters.Content         = " شماره گذاری این حساب  به پایان رسیده است";
                            RadWindow.Alert(parameters);
                        }
                    }
                    // break;
                }
                else if (tag == "newTL")
                {
                    if (_accessUtility.HasAccess(70))
                    {
                        AddTLTreeItemWindow addTLTreeItemWindow0 = SmObjectFactory.Container.GetInstance <AddTLTreeItemWindow>();
                        var treeTL = addTLTreeItemWindow0.DataContext as AddTLTreeItemWindowViewModel;

                        treeTL.TL           = new TL();
                        treeTL.TL.GLId      = gl.GLId;
                        treeTL.TL.GL        = gl;
                        treeTL.SaveClicked += (t) =>
                        {
                            //addTLTreeItemWindow0.DataItem.GL = gl;
                            //t.GLId = gl.GLId;
                            t.ImageUrl = "../../Resources/cian.png";
                            _vm.AddTL(t);
                            t.GLId = _vm.GetTLId(t.TLCode);
                            gl.TLs.Add(t);
                            //_vm.Save();
                            addTLTreeItemWindow0.Close();
                            gl.IsExpanded = true; // Ensure that the new child is visible
                                                  //using (var uow = new SainaDbContext())
                                                  //{
                                                  //    uow.TLs.Add(t);
                                                  //    //uow.Entry(gl).State = EntityState.Modified;
                                                  //    var vv = uow.SaveChanges();
                                                  //    addTLTreeItemWindow0.Close();
                                                  //}
                        };
                        addTLTreeItemWindow0.Width    = 1000;
                        addTLTreeItemWindow0.Height   = 500;
                        addTLTreeItemWindow0.CanClose = true;
                        addTLTreeItemWindow0.Owner    = Window.GetWindow(this);
                        addTLTreeItemWindow0.Show();
                    }
                }
                else if (tag == "edit")
                {
                    if (_accessUtility.HasAccess(71))
                    {
                        AddGLTreeItemWindow addGLTreeItemWindow0 = SmObjectFactory.Container.GetInstance <AddGLTreeItemWindow>();
                        var treeGL = addGLTreeItemWindow0.DataContext as AddGLTreeItemWindowViewModel;
                        treeGL.GL = gl;
                        using (var uow = new SainaDbContext())
                        {
                            var hasGL = uow.GLs.FirstOrDefault(x => x.GLId == gl.GLId)?.TLs?.Any() == true;
                            if (hasGL == true)
                            {
                                addGLTreeItemWindow0.gLCodeTextbox.IsEnabled = false;
                            }
                            treeGL.SaveClicked += (g) =>
                            {
                                //addTLTreeItemWindow0.DataItem.GL = gl;
                                g.GLId     = gl.GLId;
                                g.ImageUrl = "../../Resources/cian.png";
                                // gl.TLs.Add(addTLTreeItemWindow0.DataItem);
                                gl.IsExpanded = true; // Ensure that the new child is visible
                                                      // _vm.Save();

                                uow.GLs.Attach(g);
                                uow.Entry <GL>(g).State = EntityState.Modified;
                                //  uow.GLs(g);
                                var x = uow.SaveChanges();
                                addGLTreeItemWindow0.Close();
                            };
                        }
                        addGLTreeItemWindow0.Width    = 1000;
                        addGLTreeItemWindow0.Height   = 500;
                        addGLTreeItemWindow0.CanClose = true;
                        addGLTreeItemWindow0.Owner    = Window.GetWindow(this);
                        addGLTreeItemWindow0.Show();
                    }
                    // break;
                }
                else if (tag == "delete")
                {
                    if (_accessUtility.HasAccess(72))
                    {
                        using (var uow = new SainaDbContext())
                        {
                            var hasGL = uow.GLs.FirstOrDefault(x => x.GLId == gl.GLId)?.TLs?.Any() == true;

                            if (hasGL == false)
                            {
                                DialogParameters parameters = new DialogParameters();
                                parameters.OkButtonContent     = "بله، مطمئنم";
                                parameters.CancelButtonContent = "خیر";
                                parameters.Header  = "اخطار";
                                parameters.Content = "آیا برای حذف  مطمئن هستید؟";
                                parameters.Closed  = OnClosed;
                                RadWindow.Confirm(parameters);
                                _dialogResult = _dialogResult == true;
                                // _dialogResult == true;
                            }
                            else
                            {
                                DialogParameters parameters = new DialogParameters();
                                parameters.OkButtonContent = "بستن";
                                parameters.Header          = "اخطار";
                                parameters.Content         = ".امکان حذف وجود ندارد";
                                // parameters.Closed = OnClosed;
                                RadWindow.Alert(parameters);
                                _dialogResult = false;
                            }
                            if (_dialogResult == true)
                            {
                                //  uow.GLs.Attach(gl);
                                var test = uow.GLs.ToList().Select(x => x.GLId);
                                _vm.Items.Remove(gl);
                                uow.Database.ExecuteSqlCommand($"Delete Info.GLs where  GLId={gl.GLId} ");
                                // uow.RejectChanges();
                                // uow.GLs.Attach(new GL { GLId = gl.GLId });
                                //uow.Entry<GL>(gl).State = EntityState.Deleted;
                                //// uow.GLs.Remove(new GL { GLId=gl.GLId});
                                uow.SaveChanges();
                                var manager = new RadDesktopAlertManager(AlertScreenPosition.TopCenter, new Point(0, 0), 100);

                                var alert = new RadDesktopAlert
                                {
                                    FlowDirection = FlowDirection.RightToLeft,
                                    Header        = "اطلاعات",
                                    Content       = ".حذف با موفقیت انجام شد",
                                    ShowDuration  = 5000,
                                };
                                manager.ShowAlert(alert);
                            }
                        }
                    }
                }
            }
            else if (ClickedTreeViewItem.DataContext is TL tl)
            {
                if (tag == "newTL")
                {
                    if (_accessUtility.HasAccess(70))
                    {
                        AddTLTreeItemWindow addTLTreeItemWindow0 = SmObjectFactory.Container.GetInstance <AddTLTreeItemWindow>();
                        gl = tl.GL;
                        var treeTL = addTLTreeItemWindow0.DataContext as AddTLTreeItemWindowViewModel;
                        treeTL.TL      = new TL();
                        treeTL.TL.GLId = gl.GLId;
                        treeTL.TL.GL   = gl;
                        //treeTL.SelectedGL = gl;
                        //treeTL.TL = new TL { GL = gl, GLId = gl.GLId };
                        treeTL.SaveClicked += (t) =>
                        {
                            //   t.GLId = gl.GLId;
                            t.ImageUrl = "../../Resources/cian.png";
                            _vm.AddTL(t);
                            t.GLId = _vm.GetTLId(t.TLCode);
                            gl.TLs.Add(t);
                            addTLTreeItemWindow0.Close();

                            gl.IsExpanded = true; // Ensure that the new child is visible
                                                  //using (var uow = new SainaDbContext())
                                                  //{
                                                  //    uow.TLs.Add(t);
                                                  //   // uow.Entry(gl).State = EntityState.Modified;

                            //    uow.SaveChanges();
                            //    addTLTreeItemWindow0.Close();
                            //}
                        };
                        addTLTreeItemWindow0.Width    = 1000;
                        addTLTreeItemWindow0.Height   = 500;
                        addTLTreeItemWindow0.CanClose = true;
                        addTLTreeItemWindow0.Owner    = Window.GetWindow(this);
                        addTLTreeItemWindow0.Show();
                    }
                }
                else if (tag == "newSL")
                {
                    if (_accessUtility.HasAccess(70))
                    {
                        AddSLTreeItemWindow addSLTreeItemWindow0 = SmObjectFactory.Container.GetInstance <AddSLTreeItemWindow>();
                        var treeSL = addSLTreeItemWindow0.DataContext as AddSLTreeItemWindowViewModel;
                        treeSL.SL      = new SL();
                        treeSL.SL.TLId = tl.TLId;
                        treeSL.SL.TL   = tl;
                        //treeSL.SelectedTL = tl;
                        //treeSL.SL = new SL { TL = tl, TLId = tl.TLId };
                        treeSL.SaveClicked += (s) =>
                        {
                            //addTLTreeItemWindow0.DataItem.GL = gl;
                            // s.TLId = tl.TLId;
                            s.ImageUrl = "../../Resources/cian.png";
                            _vm.AddSL(s);
                            s.TLId = _vm.GetSLId(s.SLCode);

                            tl.SLs.Add(s);
                            // _vm.Save();
                            addSLTreeItemWindow0.Close();
                            tl.IsExpanded = true; // Ensure that the new child is visible
                                                  //using (var uow = new SainaDbContext())
                                                  //{
                                                  //    uow.SLs.Add(s);
                                                  //    uow.Entry(tl).State = EntityState.Modified;

                            //    uow.SaveChanges();
                            //    addSLTreeItemWindow0.Close();
                            //}
                        };
                        addSLTreeItemWindow0.Width    = 1000;
                        addSLTreeItemWindow0.Height   = 500;
                        addSLTreeItemWindow0.CanClose = true;
                        addSLTreeItemWindow0.Owner    = Window.GetWindow(this);
                        addSLTreeItemWindow0.Show();
                    }
                }
                else if (tag == "edit")
                {
                    if (_accessUtility.HasAccess(71))
                    {
                        AddTLTreeItemWindow addTLTreeItemWindow0 = SmObjectFactory.Container.GetInstance <AddTLTreeItemWindow>();
                        var treeTL = addTLTreeItemWindow0.DataContext as AddTLTreeItemWindowViewModel;
                        treeTL.TL = tl;
                        using (var uow = new SainaDbContext())
                        {
                            var hasTL = uow.TLs.FirstOrDefault(x => x.TLId == tl.TLId)?.SLs?.Any() == true;
                            if (hasTL == true)
                            {
                                addTLTreeItemWindow0.tLCodeTextbox.IsEnabled = false;
                            }
                            treeTL.SaveClicked += (t) =>
                            {
                                //addTLTreeItemWindow0.DataItem.GL = gl;
                                t.TLId     = tl.TLId;
                                t.ImageUrl = "../../Resources/cian.png";
                                // gl.TLs.Add(addTLTreeItemWindow0.DataItem);
                                tl.IsExpanded = true; // Ensure that the new child is visible

                                uow.TLs.Attach(t);
                                uow.Entry <TL>(t).State = EntityState.Modified;
                                //  uow.GLs(g);
                                //  uow.GLs(g);
                                uow.SaveChanges();
                                addTLTreeItemWindow0.Close();
                            };
                        }
                        addTLTreeItemWindow0.Width    = 1000;
                        addTLTreeItemWindow0.Height   = 500;
                        addTLTreeItemWindow0.CanClose = true;
                        addTLTreeItemWindow0.Owner    = Window.GetWindow(this);
                        addTLTreeItemWindow0.Show();
                    }
                }
                else if (tag == "delete")
                {
                    if (_accessUtility.HasAccess(72))
                    {
                        using (var uow = new SainaDbContext())
                        {
                            var hasTL = uow.TLs.FirstOrDefault(x => x.TLId == tl.TLId)?.SLs?.Any() == true;

                            if (hasTL == false)
                            {
                                DialogParameters parameters = new DialogParameters();
                                parameters.OkButtonContent     = "بله، مطمئنم";
                                parameters.CancelButtonContent = "خیر";
                                parameters.Header  = "اخطار";
                                parameters.Content = "آیا برای حذف  مطمئن هستید؟";
                                parameters.Closed  = OnClosed;
                                RadWindow.Confirm(parameters);
                                _dialogResult = _dialogResult == true;
                                // _dialogResult == true;
                            }
                            else
                            {
                                DialogParameters parameters = new DialogParameters();
                                parameters.OkButtonContent = "بستن";
                                parameters.Header          = "اخطار";
                                parameters.Content         = ".امکان حذف وجود ندارد";
                                // parameters.Closed = OnClosed;
                                RadWindow.Alert(parameters);
                                _dialogResult = false;
                            }
                            if (_dialogResult == true)
                            {
                                //  uow.GLs.Attach(gl);
                                //   var test = uow.TLs.ToList().Select(x => x.TLId);
                                foreach (var item in _vm.Items)
                                {
                                    item.TLs.Remove(tl);
                                }
                                uow.Database.ExecuteSqlCommand($"Delete Info.TLs where  TLId={tl.TLId} ");
                                // uow.RejectChanges();
                                // uow.GLs.Attach(new GL { GLId = gl.GLId });
                                //uow.Entry<GL>(gl).State = EntityState.Deleted;
                                //// uow.GLs.Remove(new GL { GLId=gl.GLId});
                                uow.SaveChanges();
                                var manager = new RadDesktopAlertManager(AlertScreenPosition.TopCenter, new Point(0, 0), 100);

                                var alert = new RadDesktopAlert
                                {
                                    FlowDirection = FlowDirection.RightToLeft,
                                    Header        = "اطلاعات",
                                    Content       = ".حذف با موفقیت انجام شد",
                                    ShowDuration  = 5000,
                                };
                                manager.ShowAlert(alert);
                            }
                        }
                    }
                }
            }
            else if (ClickedTreeViewItem.DataContext is SL)
            {
                SL sl = ClickedTreeViewItem.DataContext as SL;

                if (tag == "newSL")
                {
                    if (_accessUtility.HasAccess(70))
                    {
                        AddSLTreeItemWindow addSLTreeItemWindow0 = SmObjectFactory.Container.GetInstance <AddSLTreeItemWindow>();

                        tl = sl.TL;
                        var treeSL = addSLTreeItemWindow0.DataContext as AddSLTreeItemWindowViewModel;
                        treeSL.SL           = new SL();
                        treeSL.SL.TLId      = tl.TLId;
                        treeSL.SL.TL        = tl;
                        treeSL.SaveClicked += (s) =>
                        {
                            s.TLId     = tl.TLId;
                            s.ImageUrl = "../../Resources/cian.png";
                            tl.SLs.Add(s);
                            _vm.AddSL(s);
                            // _vm.Save();
                            addSLTreeItemWindow0.Close();

                            tl.IsExpanded = true;     // Ensure that the new child is visible
                                                      //using (var uow = new SainaDbContext())
                                                      //{
                                                      //    uow.SLs.Add(s);
                            ////    uow.Entry(tl).State = EntityState.Modified;

                            //    uow.SaveChanges();
                            //    addSLTreeItemWindow0.Close();
                            //}
                        };


                        addSLTreeItemWindow0.Width    = 1000;
                        addSLTreeItemWindow0.Height   = 500;
                        addSLTreeItemWindow0.CanClose = true;
                        addSLTreeItemWindow0.Owner    = Window.GetWindow(this);
                        addSLTreeItemWindow0.Show();
                    }
                }
                else if (tag == "edit")
                {
                    if (_accessUtility.HasAccess(71))
                    {
                        AddSLTreeItemWindow addSLTreeItemWindow0 = SmObjectFactory.Container.GetInstance <AddSLTreeItemWindow>();
                        var treeSL = addSLTreeItemWindow0.DataContext as AddSLTreeItemWindowViewModel;
                        treeSL.SL = sl;
                        using (var uow = new SainaDbContext())
                        {
                            var hasItem = uow.AccDocumentItems.Any(x => x.SLId == sl.SLId);
                            if (hasItem == true)
                            {
                                addSLTreeItemWindow0.sLCodeTextbox.IsEnabled = false;
                                addSLTreeItemWindow0.DL1.IsEnabled           = false;
                                addSLTreeItemWindow0.DL2.IsEnabled           = false;
                            }
                            treeSL.SaveClicked += (s) =>
                            {
                                //addTLTreeItemWindow0.DataItem.GL = gl;
                                s.SLId     = sl.SLId;
                                s.ImageUrl = "../../Resources/cian.png";
                                // gl.TLs.Add(addTLTreeItemWindow0.DataItem);
                                sl.IsExpanded = true; // Ensure that the new child is visible

                                uow.SLs.Attach(s);
                                uow.Entry <SL>(s).State = EntityState.Modified;
                                //  uow.GLs(g);
                                uow.SaveChanges();
                                addSLTreeItemWindow0.Close();
                            };
                        }
                        addSLTreeItemWindow0.Width    = 1000;
                        addSLTreeItemWindow0.Height   = 500;
                        addSLTreeItemWindow0.CanClose = true;
                        addSLTreeItemWindow0.Owner    = Window.GetWindow(this);
                        addSLTreeItemWindow0.Show();
                    }
                }
                else if (tag == "delete")
                {
                    if (_accessUtility.HasAccess(72))
                    {
                        using (var uow = new SainaDbContext())
                        {
                            var hasItem = uow.AccDocumentItems.Any(x => x.SLId == sl.SLId);


                            if (hasItem == false)
                            {
                                DialogParameters parameters = new DialogParameters();
                                parameters.OkButtonContent     = "بله، مطمئنم";
                                parameters.CancelButtonContent = "خیر";
                                parameters.Header  = "اخطار";
                                parameters.Content = "آیا برای حذف  مطمئن هستید؟";
                                parameters.Closed  = OnClosed;
                                RadWindow.Confirm(parameters);
                                _dialogResult = _dialogResult == true;
                                // _dialogResult == true;
                            }
                            else
                            {
                                DialogParameters parameters = new DialogParameters();
                                parameters.OkButtonContent = "بستن";
                                parameters.Header          = "اخطار";
                                parameters.Content         = ".امکان حذف وجود ندارد";
                                // parameters.Closed = OnClosed;
                                RadWindow.Alert(parameters);
                                _dialogResult = false;
                            }
                            if (_dialogResult == true)
                            {
                                //  uow.GLs.Attach(gl);
                                //   var test = uow.TLs.ToList().Select(x => x.TLId);
                                foreach (var item in _vm.Items)
                                {
                                    foreach (var x in item.TLs)
                                    {
                                        if (x.SLs.Remove(sl))
                                        {
                                            break;
                                        }
                                    }
                                }
                                uow.Database.ExecuteSqlCommand($"Delete Info.SLs where  SLId={sl.SLId} ");
                                // uow.RejectChanges();
                                // uow.GLs.Attach(new GL { GLId = gl.GLId });
                                //uow.Entry<GL>(gl).State = EntityState.Deleted;
                                //// uow.GLs.Remove(new GL { GLId=gl.GLId});
                                uow.SaveChanges();
                                var manager = new RadDesktopAlertManager(AlertScreenPosition.TopCenter, new Point(0, 0), 100);

                                var alert = new RadDesktopAlert
                                {
                                    FlowDirection = FlowDirection.RightToLeft,
                                    Header        = "اطلاعات",
                                    Content       = ".حذف با موفقیت انجام شد",
                                    ShowDuration  = 5000,
                                };
                                manager.ShowAlert(alert);
                            }
                        }
                    }
                }
            }
        }
        void btnExportExcel_Click(object sender, EventArgs e)
        {
            if (grdLister.Rows.Count == 0)
            {
                return;
            }

            try
            {
                saveFileDialog1.Filter = "Excel File (*.xls)|*.xls|AdvExcel File (*.xlsx)|*.xlsx";

                saveFileDialog1.Title    = "Save File";
                saveFileDialog1.FileName = "Driver Collection History";


                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    grdLister.Columns["IsPaid"].IsVisible = false;
                    grdLister.Columns["Paid"].IsVisible   = true;
                    //grdLister.Columns["btnUpdate"].IsVisible = false;

                    grdLister.Columns[COLS.Active].HeaderText     = "Active";
                    grdLister.Columns[COLS.Active].Width          = 30;
                    grdLister.Columns[COLS.Rent].Width            = 60;
                    grdLister.Columns[COLS.DriverNo].Width        = 35;
                    grdLister.Columns[COLS.PreviousBalance].Width = 85;
                    grdLister.Columns[COLS.Adjustment].Width      = 60;
                    grdLister.Columns[COLS.Collection].Width      = 50;
                    grdLister.Columns[COLS.OldCollection].Width   = 70;

                    grdLister.Columns[COLS.AgentCommission].Width = 60;
                    grdLister.Columns[COLS.OldAgentBalance].Width = 90;

                    grdLister.Columns[COLS.Total].Width = 45;
                    grdLister.Columns[COLS.Paid].Width  = 35;



                    var row = grdLister.Rows.OrderByDescending(c => c.Cells["ToDate"].Value.ToDate()).FirstOrDefault();

                    DateTime?dtCurrent = row.Cells["FromDate"].Value.ToDate();
                    DateTime dtEnd     = row.Cells["ToDate"].Value.ToDate();



                    Microsoft.Reporting.WinForms.ReportParameter[] param = new Microsoft.Reporting.WinForms.ReportParameter[1];
                    string heading = string.Empty;
                    heading = "Driver Collection History - " + string.Format("from {0:dd/MM/yyyy}", dtCurrent) + " until " + string.Format("{0:dd/MM/yyyy}", dtEnd);

                    ClsExportGridView obj = new ClsExportGridView(grdLister, saveFileDialog1.FileName);
                    obj.ApplyCellFormatting         = true;
                    obj.ConditionalFormattingObject = new StyleDataRowConditionalFormattingObject();
                    obj.ConditionalFormattingObject.ConditionFormattingColumnName = "Paid";
                    obj.ConditionalFormattingObject.RowBackColor = Color.LightGreen;
                    obj.ConditionalFormattingObject.RowForeColor = Color.Black;
                    obj.ConditionalFormattingObject.TValue       = "Paid";


                    obj.Heading = heading;
                    if (obj.ExportExcel())
                    {
                        RadDesktopAlert alert = new RadDesktopAlert();
                        alert.CaptionText = "Export";
                        alert.ContentText = "<html> <b><span style=font-size:medium><color=Blue>Export Successfully</span></b></html>";
                        alert.Show();
                    }

                    //grdLister.Columns["IsPaid"].IsVisible = true;
                    //grdLister.Columns["Paid"].IsVisible = false;
                    grdLister.Columns["IsPaid"].IsVisible = false;
                    grdLister.Columns["Paid"].IsVisible   = true;
                }
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
            finally
            {
                SetDefaultColumnSettings();
            }


            //rptfrmDriverPaymentCollection frm = new rptfrmDriverPaymentCollection();
            //frm.LoadReport();
            //frm.ExportReportToExcel("excel");
        }
        public void importa()
        {
            try
            {
                OpenFileDialog openfile = new OpenFileDialog();
                openfile.DefaultExt = ".xlsx";
                openfile.Filter     = "(.xlsx)|*.xlsx";
                //openfile.ShowDialog();

                var browsefile = openfile.ShowDialog();

                if (browsefile == true)
                {
                    txtFilePath.Text = openfile.FileName;

                    Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
                    //Static File From Base Path...........
                    //Microsoft.Office.Interop.Excel.Workbook excelBook = excelApp.Workbooks.Open(AppDomain.CurrentDomain.BaseDirectory + "TestExcel.xlsx", 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
                    //Dynamic File Using Uploader...........
                    Microsoft.Office.Interop.Excel.Workbook  excelBook  = excelApp.Workbooks.Open(txtFilePath.Text.ToString(), 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
                    Microsoft.Office.Interop.Excel.Worksheet excelSheet = (Microsoft.Office.Interop.Excel.Worksheet)excelBook.Worksheets.get_Item(1);;
                    Microsoft.Office.Interop.Excel.Range     excelRange = excelSheet.UsedRange;

                    string strCellData = "";
                    double douCellData;
                    int    rowCnt = 0;
                    int    colCnt = 0;

                    DataTable dt = new DataTable();
                    for (colCnt = 1; colCnt <= excelRange.Columns.Count; colCnt++)
                    {
                        string strColumn = "";
                        strColumn = (string)(excelRange.Cells[1, colCnt] as Microsoft.Office.Interop.Excel.Range).Value2;
                        dt.Columns.Add(strColumn, typeof(string));
                    }

                    for (rowCnt = 2; rowCnt <= excelRange.Rows.Count; rowCnt++)
                    {
                        string strData = "";
                        for (colCnt = 1; colCnt <= excelRange.Columns.Count; colCnt++)
                        {
                            try
                            {
                                strCellData = (string)(excelRange.Cells[rowCnt, colCnt] as Microsoft.Office.Interop.Excel.Range).Value2;
                                strData    += strCellData + "|";
                            }
                            catch (Exception ex)
                            {
                                douCellData = (excelRange.Cells[rowCnt, colCnt] as Microsoft.Office.Interop.Excel.Range).Value2;
                                strData    += douCellData.ToString() + "|";
                            }
                        }
                        strData = strData.Remove(strData.Length - 1, 1);
                        dt.Rows.Add(strData.Split('|'));
                    }

                    gvData.ItemsSource = dt;

                    excelBook.Close(true, null, null);
                    excelApp.Quit();

                    var alert = new RadDesktopAlert();
                    alert.Header       = "NOTIFICACIÓN";
                    alert.Content      = "El archivo se cargó exitosamente.";
                    alert.ShowDuration = 3000;
                    RadDesktopAlertManager manager = new RadDesktopAlertManager();
                    manager.ShowAlert(alert);
                }
                else
                {
                    btGuardar.Visibility  = Visibility.Hidden;
                    btCancelar.Visibility = Visibility.Hidden;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
            }
        }
Example #37
0
        /// <summary>
        /// 客製化顯示Alert
        /// </summary>
        /// <param name="alertType">Alert類別</param>
        /// <param name="Content">內容</param>
        /// <param name="Title">標題</param>
        /// <param name="AlertSecond">顯示秒數(-1為使用預設)</param>
        /// <param name="CustomScreenPosition">傳入AlertScreenPosition Type則指定位置,否則使用預設</param>
        /// <param name="ScreenPositionLocation">如果CustomScreenPosition = AlertScreenPosition.Manual,則使用傳入座標</param>
        /// <param name="ShowMessageOnScreenCenter">是否顯示在螢幕中間(目前已知多個訊息會導致訊息重疊)(預設False,會覆寫顯示位置設定)</param>
        public void ShowAlert_Custom(Alert alertType, string Content, string Title, int AlertSecond = -1, object CustomScreenPosition = null, Point ScreenPositionLocation = new Point(), bool ShowMessageOnScreenCenter = false)
        {
            // TODO 下次是不是要補一下圖示
            Font              ContentFont     = new Font("微軟正黑體", 12f, FontStyle.Regular);
            Font              CaptionFont     = new Font("微軟正黑體", 16f, FontStyle.Bold);
            RadDesktopAlert   radDesktopAlert = new RadDesktopAlert();
            DesktopAlertPopup alertpopup      = radDesktopAlert.Popup;

            // 取得呼叫的應用程式位置
            var apps = Application.OpenForms;
            var app  = apps.Count > 0 ? apps[apps.Count - 1] : null;

            // app.InvokeRequired 為True時,代表跨執行緒執行
            // 應用程式所在作用的螢幕
            var ActiveScreen = (app == null || app.InvokeRequired) ? Screen.PrimaryScreen : Screen.FromControl(app);
            var screenWidth  = ActiveScreen.Bounds.Width;
            var screenHeight = ActiveScreen.Bounds.Height;

            // 多螢幕下,將執行設定為視窗的那個螢幕
            DesktopAlertManager.Instance.SetActiveScreen(ActiveScreen);

            #region 通用排版樣式
            // 提示框上的三點是否要繪制
            radDesktopAlert.Popup.AlertElement.CaptionElement.CaptionGrip.ShouldPaint = false;
            // 是否自動關閉
            radDesktopAlert.AutoClose = alertType != Alert.Error; // Error 不自動關閉
            // 自動關閉的秒數
            radDesktopAlert.AutoCloseDelay = AlertSecond != -1 ? AlertSecond : alertType.ToNumberValue();
            radDesktopAlert.Popup.AlertElement.BorderDashStyle = DashStyle.Dot;
            radDesktopAlert.Popup.AlertElement.BorderBoxStyle  = BorderBoxStyle.SingleBorder;//.OuterInnerBorders;
            // 底色是否要漸層
            radDesktopAlert.Popup.AlertElement.GradientStyle = GradientStyles.Solid;
            // 標題文字
            radDesktopAlert.CaptionText = Title;
            // 內文
            radDesktopAlert.ContentText = Content;
            // 風格樣式
            //radDesktopAlert.ThemeName = "FluentDatk";

            // 自動尺吋
            radDesktopAlert.AutoSize = true;
            // 關閉鈕
            radDesktopAlert.ShowCloseButton = alertType != Alert.Success;  // Success會一閃而過,就不需要關閉鈕了
            // 選項鈕
            radDesktopAlert.ShowOptionsButton = false;
            // 釘選鈕
            radDesktopAlert.ShowPinButton = false;
            // 內文字型
            radDesktopAlert.Popup.AlertElement.ContentElement.Font = ContentFont;
            // 標題字型
            radDesktopAlert.Popup.AlertElement.CaptionElement.TextAndButtonsElement.Font = CaptionFont;

            // 跳出提示的位置
            //radDesktopAlert.ScreenPosition = AlertScreenPosition.Manual;
            // 跳出提示下方的一排按鈕排版空間
            //radDesktopAlert.Popup.AlertElement.ButtonsPanel
            // 內文相關設定
            //radDesktopAlert.Popup.AlertElement.ContentElement
            // 標題相關設定
            //radDesktopAlert.Popup.AlertElement.CaptionElement
            #endregion 通用排版樣式

            switch (alertType)
            {
            case Alert.Error:
                // 跳出提示的位置
                radDesktopAlert.ScreenPosition = AlertScreenPosition.BottomRight;
                // 提示框的底色
                radDesktopAlert.Popup.AlertElement.BackColor = ErrorColor;
                //radDesktopAlert.Popup.AlertElement.ContentImage = RadMessageIcon.Info;
                // Properties.Resources.envelope
                break;

            case Alert.Success:
                // 跳出提示的位置
                radDesktopAlert.ScreenPosition = AlertScreenPosition.Manual;
                if (alertpopup != null)
                {
                    // TODO 想找找是不是能放畫面正中間,多個訊息好像會重疊
                    // 目前先暫時這樣子,不會太明顯的歪…
                    // 公式:多螢幕的偏移 + 所在螢幕的一半 - 訊息框的大概尺吋(暫時抓不到會多少,先以大概的數字來取)
                    alertpopup.Location = new Point(ActiveScreen.Bounds.X + ((int)(screenWidth / 2)) - 160, ActiveScreen.Bounds.Y + ((int)(screenHeight / 2)) - 80);
                }
                // 提示框的底色
                radDesktopAlert.Popup.AlertElement.BackColor = SuccessColor;
                break;

            case Alert.Warning:
                // 跳出提示的位置
                radDesktopAlert.ScreenPosition = AlertScreenPosition.BottomRight;
                // 提示框的底色
                radDesktopAlert.Popup.AlertElement.BackColor = WarningColor;
                break;
            }

            #region 使用者自訂項目
            // 當有指定底色時,使用指定的底色
            if (BackGroupColor != Color.Transparent)
            {
                radDesktopAlert.Popup.AlertElement.BackColor = BackGroupColor;
            }

            // 當有指定出現位置時,使用指定位置
            if (CustomScreenPosition != null && CustomScreenPosition is AlertScreenPosition)
            {
                if ((AlertScreenPosition)CustomScreenPosition == AlertScreenPosition.Manual)
                {
                    if (ScreenPositionLocation != null)
                    {
                        alertpopup.Location = ScreenPositionLocation;
                    }
                }
                radDesktopAlert.ScreenPosition = (AlertScreenPosition)CustomScreenPosition;
            }
            //訊息是否顯示在螢幕中間
            if (ShowMessageOnScreenCenter)
            {
                radDesktopAlert.ScreenPosition = AlertScreenPosition.Manual;
                // 公式:多螢幕的偏移 + 所在螢幕的一半 - 訊息框的大概尺吋(暫時抓不到會多少,先以大概的數字來取)
                alertpopup.Location = new Point(ActiveScreen.Bounds.X + ((int)(screenWidth / 2)) - 160, ActiveScreen.Bounds.Y + ((int)(screenHeight / 2)) - 80);
            }

            #endregion 使用者自訂項目

            radDesktopAlert.Show();
        }