Ejemplo n.º 1
0
        private void Login()
        {
            Hashtable PropertyBag = new Hashtable();
            User      user        = new User();

            user.Username             = txtUserName.Text;
            user.Password             = txtPassword.Password;
            PropertyBag["user"]       = user;
            PropertyBag["connection"] = GetConnectionName();
            this.RaiseNotification(res.ResourceManager.GetString("LoginCheckingCredentials"));
            IDictionary newBag = NavigatorFactory.Navigator.Get("Login", "Authentificate", PropertyBag);

            if (newBag.Contains("flash"))
            {
                Flash      flash = (Flash)newBag["flash"];
                RoAlertBox msg   = new RoAlertBox(flash.Error);
                msg.Topmost = true;
                msg.ShowDialog();
                //                ShowVRAlertBox(flash.Error);
            }
            else
            {
                this.RaiseNotification(res.ResourceManager.GetString("LoginLoadingApplication"));
                NavigatorFactory.Navigator.Navigate("Main", "List", PropertyBag);
            }
        }
Ejemplo n.º 2
0
        void btnSendSms_Click(object sender, RoutedEventArgs e)
        {
            if (grdClients.SelectedItems.Count == 0)
            {
                RoAlertBox msg = new RoAlertBox(res.ResourceManager.GetString("PleaseSelectFromList"));
                msg.ShowDialog();
            }
            else
            {
                if (string.IsNullOrEmpty(txtMessage.Text))
                {
                    RoAlertBox msg = new RoAlertBox(res.ResourceManager.GetString("PleaseEnterMessage"));
                    msg.ShowDialog();
                    return;
                }
                IList <int> cls = new List <int>();
                foreach (var item in grdClients.SelectedItems)
                {
                    cls.Add(((Client)item).Id);
                }
                PropertyBag["clients"] = cls.ToArray();
                PropertyBag["message"] = txtMessage.Text;
                NavigatorFactory.Navigator.Navigate("Main/SendSMS.xaml", PropertyBag, true);

                //deselect all selection
                grdClients.UnselectAll();
            }
        }
Ejemplo n.º 3
0
        private void btnLoginAdmin_Click(object sender, RoutedEventArgs e)
        {
            Hashtable PropertyBag = new Hashtable();

            PropertyBag["connection"] = GetConnectionName();
            this.RaiseNotification(res.ResourceManager.GetString("LoginCheckingCredentials"));
            //NavigatorFactory.Navigator.Get("Login", "AuthentificateAdmin", PropertyBag);
            //this.RaiseNotification(res.ResourceManager.GetString("LoginLoadingApplication"));
            //NavigatorFactory.Navigator.Navigate("Range", "List", PropertyBag);
            IDictionary newBag = NavigatorFactory.Navigator.Get("Login", "AuthentificateAdmin", PropertyBag);

            if (newBag.Contains("flash"))
            {
                Flash      flash = (Flash)newBag["flash"];
                RoAlertBox msg   = new RoAlertBox(flash.Error);
                msg.Topmost = true;
                msg.ShowDialog();
                //                ShowVRAlertBox(flash.Error);
            }
            else
            {
                this.RaiseNotification(res.ResourceManager.GetString("LoginLoadingApplication"));

                NavigatorFactory.Navigator.Navigate("Main", "List", PropertyBag);
//                NavigatorFactory.Navigator.Navigate("Config", "Index", PropertyBag);
            }
        }
Ejemplo n.º 4
0
        private void btnLoginAdmin_Click(object sender, RoutedEventArgs e)
        {
            Hashtable PropertyBag = new Hashtable();
            PropertyBag["connection"] = GetConnectionName();
            this.RaiseNotification(res.ResourceManager.GetString("LoginCheckingCredentials"));
            //NavigatorFactory.Navigator.Get("Login", "AuthentificateAdmin", PropertyBag);
            //this.RaiseNotification(res.ResourceManager.GetString("LoginLoadingApplication"));
            //NavigatorFactory.Navigator.Navigate("Range", "List", PropertyBag);
            IDictionary newBag = NavigatorFactory.Navigator.Get("Login", "AuthentificateAdmin", PropertyBag);
            if (newBag.Contains("flash"))
            {
                Flash flash = (Flash)newBag["flash"];
                RoAlertBox msg = new RoAlertBox(flash.Error);
                msg.Topmost = true;
                msg.ShowDialog();
                //                ShowVRAlertBox(flash.Error);
            }
            else
            {

                this.RaiseNotification(res.ResourceManager.GetString("LoginLoadingApplication"));

                NavigatorFactory.Navigator.Navigate("Main", "List", PropertyBag);
//                NavigatorFactory.Navigator.Navigate("Config", "Index", PropertyBag);
            }
        }
Ejemplo n.º 5
0
 void btnEdit_Click(object sender, RoutedEventArgs e)
 {
     if (grdClients.SelectedItems.Count != 1)
     {
         RoAlertBox alertBox = new RoAlertBox(res.ResourceManager.GetString("PleaseSelectOnlyOne"));
         alertBox.ShowDialog();
         return;
     }
     PropertyBag["client"] = (Client)grdClients.SelectedItems[0];
     NavigatorFactory.Navigator.Navigate("Main/Edit.xaml", PropertyBag, true);
 }
Ejemplo n.º 6
0
        /// <summary>
        /// display a message
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        public void ShowVRAlertBox(string message)
        {
            if (IsTestMode)
            {
                return;
            }
            RoAlertBox msg = new RoAlertBox(message);

            msg.Topmost = true;
            msg.ShowDialog();
        }
Ejemplo n.º 7
0
        void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            if (grdClients.SelectedItems.Count == 0)
            {
                RoAlertBox alertBox = new RoAlertBox(res.ResourceManager.GetString("PleaseSelectFromList"));
                alertBox.ShowDialog();
                return;
            }
            RoConfirmationBox msg = new RoConfirmationBox(res.ResourceManager.GetString("AreYouSure"));
            var r = msg.ShowDialog();

            if (msg.DialogResult == false)
            {
                return;
            }

            IList <int> cls = new List <int>();

            foreach (var item in grdClients.SelectedItems)
            {
                cls.Add(((Client)item).Id);
            }
            PropertyBag["clients"] = cls.ToArray();
            IDictionary prop = NavigatorFactory.Navigator.Get("Main", "Delete", PropertyBag);

            if (prop.Contains("flash"))
            {
                Flash flash = (Flash)prop["flash"];
                ShowVRAlertBox(flash.Error);
            }
            clients.Clear();
            var cl = (IQueryable <Client>)prop["clients"];

            foreach (var client in cl)
            {
                clients.Add(client);
            }
            source.Source = null;
            source.Source = clients;
        }
Ejemplo n.º 8
0
 private void Login()
 {
     Hashtable PropertyBag = new Hashtable();
     User user = new User();
     user.Username = txtUserName.Text;
     user.Password = txtPassword.Password;
     PropertyBag["user"] = user;
     PropertyBag["connection"] = GetConnectionName();
     this.RaiseNotification(res.ResourceManager.GetString("LoginCheckingCredentials"));
     IDictionary newBag = NavigatorFactory.Navigator.Get("Login", "Authentificate", PropertyBag);
     if (newBag.Contains("flash"))
     {
         Flash flash = (Flash)newBag["flash"];
         RoAlertBox msg = new RoAlertBox(flash.Error);
         msg.Topmost = true;
         msg.ShowDialog();
         //                ShowVRAlertBox(flash.Error);
     }
     else
     {
         this.RaiseNotification(res.ResourceManager.GetString("LoginLoadingApplication"));
         NavigatorFactory.Navigator.Navigate("Main", "List", PropertyBag);
     }
 }