Exemple #1
0
 private void ribbon_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
 {
     if (e.AddedItems[0] == tab_users)
     {
         if (iAddDeleteUser == null)
         {
             UsersControl userControl = new UsersControl();
             iAddDeleteUser = userControl;
             grid_content.Children.Clear();
             grid_content.Children.Add(userControl);
         }
         else
         {
             grid_content.Children.Clear();
             grid_content.Children.Add((UsersControl)iAddDeleteUser);
         }
     }
     if (e.AddedItems[0] == tab_organization)
     {
         if (iTree == null)
         {
             TreeControl treeControl = new TreeControl();
             iTree = treeControl;
             grid_content.Children.Clear();
             grid_content.Children.Add(treeControl);
         }
         else
         {
             grid_content.Children.Clear();
             grid_content.Children.Add((TreeControl)iTree);
         }
     }
 }
Exemple #2
0
        private void menu_users_Click(object sender, RoutedEventArgs e)
        {
            UsersControl userControl = new UsersControl();

            iAddDeleteUser = userControl;
            grid_content.Children.Add(userControl);
        }
Exemple #3
0
        public void UpsertControl(UsersControl model)
        {
            var roleIds = new List <Guid?>();
            var userIds = new List <Guid?>();

            if (model.Items.IsNotNullOrEmpty())
            {
                foreach (var item in model.Items)
                {
                    roleIds.Add(item.Role?.Id);
                    userIds.Add(item.User?.Id);
                }
            }

            using (var command = Context.Connection.GenerateCommand(
                       "ais.upsert_xobjactivity",
                       new
            {
                objectid = model.ItemId,
                objecttypeid = model.ItemType,
                roleId = roleIds,
                userId = userIds
            }))
            {
                command.ExecuteNonQuerySafety();
            }
        }
Exemple #4
0
        private void FoldersControl_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            var item = (FileSystemObjectInfo)e.NewValue;

            if (item != null)
            {
                Cursor = Cursors.Wait;

                var context = (MainViewModel)DataContext;

                // binding manually
                var info = item.FileSystemInfo;
                //context.SelectedFileSystemInfo = info;

                _preSelectPath = info.FullName; //TODO Save

                try
                {
                    StatusLastWrite.Text = info.LastWriteTime.ToString("dd.MM.yy HH:mm");
                    StatusPath.Text      = info.FullName;
                    StatusOwner.Text     = context.GetOwner(info);
                    context.SetPathSelected(info);
                }
                catch { } // Network disconnected

                RulesControl.UpdateLayout();
                UsersControl.UpdateLayout();
                GroupsControl.UpdateLayout();

                Cursor = Cursors.Arrow;
            }
        }
Exemple #5
0
 public ModalConfig(UsersControl user_control)
 {
     InitializeComponent();
     this.user_control = user_control;
     this.dlgcertificadoArquivoCaminho        = new OpenFileDialog();
     this.dlgcertificadoArquivoCaminho.Title  = "Selecione o certificado digital em formato arquivo.";
     this.dlgcertificadoArquivoCaminho.Filter = "Certificados|*.pfx; *.p12" +
                                                "|Todos|*.*";
 }
        public async Task RegisterUser_UserAddedToDatabase_ReturnTrue()
        {
            var register = await UsersControl.RegisterUser(NewUser);

            var usersCount = databaseContext.Users.Count();

            // 2 - because there is added one by default
            Assert.AreEqual(2, usersCount);
        }
        private void usersMenuButton_Click(object sender, EventArgs e)
        {
            mainPanel.Controls.Clear();
            UsersControl usersControl = new UsersControl {
                Dock = DockStyle.Fill
            };

            mainPanel.Controls.Add(usersControl);
            UnderlineMenuButton(usersMenuButton);
        }
        public UserRegisterView()
        {
            InitializeComponent();

            DataContext = new UserViewControl();

            userControl         = new UsersControl();
            userProfilesControl = new UserProfilesControl();
            userViewControl     = new UserViewControl();
        }
Exemple #9
0
        private void GroupsControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Cursor = Cursors.Wait;

            var context = (MainViewModel)DataContext;

            context.SetGroupSelected();
            UsersControl.UpdateLayout();

            Cursor = Cursors.Arrow;
        }
 /// <summary>
 /// Validate the requested submitter identifier by checking to see if it alread exists.
 /// </summary>
 /// <param name="source"></param>
 /// <param name="args"></param>
 private void SubmitterIdCustomVal_ServerValidate(object source, System.Web.UI.WebControls.ServerValidateEventArgs args)
 {
     if (SubmitIdTxt.Text.Length > 0)
     {
         args.IsValid = !UsersControl.submitterIdExists(SubmitIdTxt.Text);
     }
     else
     {
         args.IsValid = true;
     }
 }
        private void btnUsers_Click(object sender, RoutedEventArgs e)
        {
            if (!BaseDataBase.CurrentUser.IsAdmin)
            {
                MyMessageBox.Show("ليس لديك صلاحيات للدخول");
                return;
            }
            UsersControl w = new UsersControl();

            w.ShowDialog();
        }
        public override void Execute(object parameter)
        {
            UsersViewModel usersViewModel = new UsersViewModel();

            UsersControl usersControl = new UsersControl();

            usersControl.DataContext = usersViewModel;
            MainWindow mainWindow = (MainWindow)mainViewModel.Window;

            mainWindow.GrdCenter.Children.Clear();
            mainWindow.GrdCenter.Children.Add(usersControl);
        }
 public MaintenanceMenuControl(HomeControl form)
 {
     InitializeComponent();
     this.form          = form;
     equimentType       = new EquipmentTypeControl();
     user               = new UsersControl();
     brand              = new BrandControl();
     model              = new ModelsControl();
     technologies       = new TechnologiesConnectionControl();
     equipo             = new EquimentControl();
     employeesControl   = new EmployeesControl();
     rentReturnsControl = new RentReturnsControl();
 }
Exemple #14
0
 public Main(ProviderControl providerControl, InvoiceControl invoiceControl, RequestControl requestControl, UsersControl usersControl, ReportControl reportsControl, ProductControl productControl, PersonalDataControl personalDataControl)
 {
     _logger = LogManager.GetCurrentClassLogger();
     _logger.Debug("Iniciando Menu Principal");
     InitializeComponent();
     _providerControl     = providerControl;
     _invoiceControl      = invoiceControl;
     _requestControl      = requestControl;
     _productControl      = productControl;
     _usersControl        = usersControl;
     _reportsControl      = reportsControl;
     _personalDataControl = personalDataControl;
 }
        private void inicializaAutomatico()
        {
            try
            {
                try
                {
                    this.user_control = new UsersControl(true);
                    if (this.user_control.User_logado != null)
                    {
                        if (this.user_control.User_logado.Status_certificado == 1)
                        {
                            this.user_control.User_logado.Certificado = new X509Certificate2(this.user_control.User_logado.Caminho_certificado, this.user_control.User_logado.Senha_certificado);
                        }
                        else if (this.user_control.User_logado.Status_certificado == 2)
                        {
                            this.user_control.User_logado.Certificado = CertificadoDigital.getA1CertificadoWindows(this.user_control.User_logado.Serial_certificado);
                        }
                        else if (this.user_control.User_logado.Status_certificado == 3)
                        {
                            this.user_control.User_logado.Certificado = CertificadoDigital.getA3Certificado(this.user_control.User_logado.Serial_certificado, this.user_control.User_logado.Senha_certificado);
                        }

                        if (this.user_control.User_logado.Certificado != null)
                        {
                            try
                            {
                                this.user_control.User_logado.Certificado.VerificaValidade();
                            }
                            catch (Exception e)
                            {
                                MessageBox.Show("Erro no certificado: " + e.Message);
                                this.user_control.User_logado.Certificado = null;
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Erro ao carregar user local: " + ex.Message);
                    this.user_control = new UsersControl();
                }
                this.modal_config = new ModalConfig(this.user_control);
                this.modal_login  = new ModalLogin(this.user_control);
                atualizarInterface();
            } catch (Exception ex)
            {
                MessageBox.Show("Erro ao carregar user local: " + ex.Message);
            }
        }
Exemple #16
0
        /// <summary>
        /// Initialize the request controls.
        /// </summary>
        private void initRequestInfo()
        {
            // Check to see if user entered faculty request.
            FacultyRequestInfo fri = UsersControl.getFacultyRequestInfo(Context.User.Identity.Name);

            // If no submitter request, display instructions
            // (input controls are visible by default).
            // Otherwise display request acknowledgement and date.
            if (fri != null)
            {
                FormPanel.Visible = false;
                ConfirmLbl.Text   = "Your registration for faculty user status was received on "
                                    + fri.Date.ToShortDateString() + ".  You will be notified by email when your "
                                    + "request has been evaluated.";
            }
        }
        /// <summary>
        /// Initialize the request controls.
        /// </summary>
        private void initRequestInfo()
        {
            // Check to see if user entered submitter request.
            SubmitterRequestInfo sri = UsersControl.getSubmitterRequestInfo(Context.User.Identity.Name);

            // If no submitter request, display instructions
            // (input controls are visible by default).
            // Otherwise display request acknowledgement and date.
            if (sri != null)
            {
                FormPanel.Visible = false;
                RequestLbl.Text   = "Your request for permission to submit modules was received on "
                                    + sri.Date.ToShortDateString() + ".  You will be notified by email when your "
                                    + "request has been evaluated.";
            }
        }
Exemple #18
0
        public void Refresh()
        {
            Cursor = Cursors.Wait;

            var context = (MainViewModel)DataContext;

            //_preSelectPath = context.SelectedFileSystemInfo.FullName;
            FoldersControl.Items.Clear();
            InitializeFileSystemObjects();

            context.SetPathSelected();

            RulesControl.UpdateLayout();
            UsersControl.UpdateLayout();
            GroupsControl.UpdateLayout();

            Cursor = Cursors.Arrow;
        }
        /// <summary>
        /// Handle the apply button click event.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ApplyBtn_Click(object sender, System.EventArgs e)
        {
            try {
                if (SubmitterIdCustomVal.IsValid)
                {
                    SubmitterRequestInfo sri = new SubmitterRequestInfo();

                    sri.Date        = DateTime.Now;
                    sri.UserName    = Context.User.Identity.Name;
                    sri.Message     = Globals.parseTextInput(MessageTxt.Text);
                    sri.SubmitterId = SubmitIdTxt.Text;

                    UsersControl.addSubmitterRequest(sri);
                    initRequestInfo();
                }
            } catch (Exception ex) {
                RequestLbl.Text = ex.Message + ex.InnerException.Message;
            }
        }
        private void AdminForm_Load(object sender, EventArgs e)
        {
            labelName.Text = AuthUser.Model.Name + " " + AuthUser.Model.Surname;

            _menuButtons = new[]
            {
                usersMenuButton,
                workingHoursMenuButton,
                emergencyDoctorMenuButton,
                servicesMenuButton,
                pavilionsMenuButton,
                basicReportsMenuButton,
                advancedReportsMenuButton
            };


            UsersControl usersControl = new UsersControl {
                Dock = DockStyle.Fill
            };

            mainPanel.Controls.Add(usersControl);
            UnderlineMenuButton(usersMenuButton);
        }
Exemple #21
0
        /// <summary>
        /// Handle the apply button click event.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ApplyBtn_Click(object sender, System.EventArgs e)
        {
            try
            {
                if (NameValidator.IsValid && AffiliationValidator.IsValid)
                {
                    FacultyRequestInfo fri = new FacultyRequestInfo();

                    fri.Date        = DateTime.Now;
                    fri.UserName    = Context.User.Identity.Name;
                    fri.Proof       = Globals.parseTextInput(ProofTxt.Text);
                    fri.Affiliation = AffiliationTxt.Text;
                    fri.Name        = NameBox.Text;

                    UsersControl.addFacultyRequest(fri);
                    initRequestInfo();
                }
            }
            catch (Exception ex)
            {
                ConfirmLbl.Text = ex.Message + ex.InnerException.Message;
            }
        }
 private void LogoutLink_Click(object sender, System.EventArgs e)
 {
     UsersControl.logoutUser();
     Response.Redirect("default.aspx", true);
 }
        public async Task RegisterUser_CorrectUserData_ReturnSuccesMessage()
        {
            var register = await UsersControl.RegisterUser(NewUser);

            Assert.AreEqual("Success! You can log in now!", register.SuccessMessage);
        }
        public async Task LoginUser_CorrectUserData_LoginSuccesMessage()
        {
            var login = await UsersControl.LoginUser(GoodUser);

            Assert.AreEqual("You are logged in!", login.SuccessMessage);
        }
        public async Task LoginUser_UncorrectUserData_LoginFailedMessage()
        {
            var login = await UsersControl.LoginUser(WrongUser);

            Assert.AreEqual("Wrong login or password!", login.ClientError);
        }
        public async Task LoginUser_UncorrectUserData_LoginStatusFailed()
        {
            var login = await UsersControl.LoginUser(WrongUser);

            Assert.AreEqual(System.Net.HttpStatusCode.BadRequest, login.StatusCode);
        }
        public async Task LoginUser_CorrectUserData_ReturnAToken()
        {
            var login = await UsersControl.LoginUser(GoodUser);

            Assert.IsInstanceOf(typeof(Token), login.Data);
        }
 public ModalLogin(UsersControl user_control)
 {
     InitializeComponent();
     this.user_control = user_control;
     this.modal_lista  = new ModalListaEmpresas();
 }
        public async Task RegisterUser_UncorrectUserData_ReturnStatusBadRequest()
        {
            var register = await UsersControl.RegisterUser(ExistingUser);

            Assert.AreEqual(System.Net.HttpStatusCode.BadRequest, register.StatusCode);
        }
        public async Task RegisterUser_AlreadyUsedUserlogin_ReturnErrorMessage()
        {
            var register = await UsersControl.RegisterUser(ExistingUser);

            Assert.AreEqual("User already exist.", register.ClientError);
        }