public UsersController(
     IUserRepository userRepository,
     ManageUserUseCase userUseCase,
     ResourcePresenter <ReadUserResponse> readUserPresenter,
     ResourcePresenter <CreateUserResponse> createUserPresenter,
     ResourcePresenter <UpdateUserResponse> updateUserPresenter,
     ResourcePresenter <ChangeUsersStatusResponse> changeUsersStatusPresenter,
     IMapper mapper)
 {
     _userRepository             = userRepository;
     _userUseCase                = userUseCase;
     _readUserPresenter          = readUserPresenter;
     _createUserPresenter        = createUserPresenter;
     _changeUsersStatusPresenter = changeUsersStatusPresenter;
     _updateUserPresenter        = updateUserPresenter;
     _mapper = mapper;
 }
Exemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();

            UpdateStatus("Starting server...");

            BroadcastPort = Properties.Settings.Default.broadcastPort;
            DevicePort = Properties.Settings.Default.webcamPort;
            BasePath = Properties.Settings.Default.basePath;

            if (string.IsNullOrEmpty(BasePath))
                BasePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);

            DVPresenter = new DevicePresenter(this);
            _rsPresenter = new ResourcePresenter(this);

            cbxDevice.Items.Add("All webcams");
            cbxDevice.SelectedIndex = 0;
            UpdateStatus("Ready!");
        }
 public RequestController(
     IExportUseCase exportUseCase, ExportPresenter exportPresenter,
     IManageRequestUseCase manageRequestUseCase, ManageRequestPresenter manageRequestPresenter,
     IBulkExportUseCase bulkExportUseCase, BulkExportPresenter bulkExportPresenter,
     IGetEachRequestUseCase getEachRequestUseCase, GetEachRequestPresenter getEachRequestPresenter,
     IAuthService authService,
     ICommentRepository commentRepository,
     IRequestRepository requestRepository,
     ICreateCommentUseCase createCommentUseCase,
     ICreateRequestUseCase createRequestUseCase,
     CreateRequestPresenter createRequestPresenter,
     UpdateRequestPresenter updateRequestPresenter,
     IUpdateRequestUseCase updateRequestUseCase,
     ResourcePresenter <DeleteCommentResponse> deleteCommentPresenter,
     IDeleteCommentUseCase deleteCommentUseCase,
     IGetRequestUseCase getRequestUseCase,
     GetRequestPresenter getRequestPresenter,
     ResourcePresenter <CreateCommentResponse> createCommentPresenter)
 {
     _authService             = authService;
     _commentRepository       = commentRepository;
     _requestRepository       = requestRepository;
     _createCommentUseCase    = createCommentUseCase;
     _createRequestUseCase    = createRequestUseCase;
     _createRequestPresenter  = createRequestPresenter;
     _updateRequestUseCase    = updateRequestUseCase;
     _updateRequestPresenter  = updateRequestPresenter;
     _getRequestUseCase       = getRequestUseCase;
     _getRequestPresenter     = getRequestPresenter;
     _getEachRequestUseCase   = getEachRequestUseCase;
     _getEachRequestPresenter = getEachRequestPresenter;
     _exportUseCase           = exportUseCase;
     _exportPresenter         = exportPresenter;
     _manageRequestUseCase    = manageRequestUseCase;
     _manageRequestPresenter  = manageRequestPresenter;
     _bulkExportUseCase       = bulkExportUseCase;
     _bulkExportPresenter     = bulkExportPresenter;
     _createCommentPresenter  = createCommentPresenter;
     _deleteCommentPresenter  = deleteCommentPresenter;
     _deleteCommentUseCase    = deleteCommentUseCase;
 }
 public AccountsController(
     IUpdateProfileInfoUseCase updateProfileInfoUseCase,
     IChangePasswordUseCase changePasswordUseCase,
     IResetPasswordUseCase resetPasswordUseCase,
     IAuthService authService,
     IMapper mapper,
     ResourcePresenter <UpdateProfileInfoResponse> updateProfileInfoPresenter,
     ResourcePresenter <ChangePasswordResponse> changePasswordPresenter,
     ResourcePresenter <ResetPasswordResponse> resetPasswordPresenter,
     INotificationRepository notiRepo
     )
 {
     _authService = authService;
     _mapper      = mapper;
     _updateProfileInfoUseCase   = updateProfileInfoUseCase;
     _resetPasswordUseCase       = resetPasswordUseCase;
     _updateProfileInfoPresenter = updateProfileInfoPresenter;
     _changePasswordUseCase      = changePasswordUseCase;
     _changePasswordPresenter    = changePasswordPresenter;
     _resetPasswordPresenter     = resetPasswordPresenter;
     _notiRepo = notiRepo;
 }
Exemplo n.º 5
0
        private void RadMenuItemClicked(object sender, EventArgs e)
        {
            var name = ((Telerik.WinControls.RadItem)(sender)).AccessibleDescription;

            if (name == "DeleteApp")
            {
                if (ISE.Framework.Client.Win.Viewer.MessageViewer.ShowAlert("آیا از حذف دامنه مطمئن هستی؟") != DialogResult.OK)
                {
                    return;
                }
                var node = this.radTreeViewResource.SelectedNode;
                ApplicationDomainDto app = (ApplicationDomainDto)node.Value;
                if (node.Nodes.Count == 0)
                {
                    if (view.RemoveAppDomain(app))
                    {
                        this.radTreeViewResource.Nodes.Remove(node);
                    }
                }
                else
                {
                    ISE.Framework.Client.Win.Viewer.MessageViewer.ShowException("غیر قابل حذف می باشد!");
                }
            }
            else if (name == "EditApp")
            {
                var node = this.radTreeViewResource.SelectedNode;
                ApplicationDomainDto app   = (ApplicationDomainDto)node.Value;
                UCAppDomainEntry     entry = new UCAppDomainEntry(TransMode.EditRecord, app, view);
                ISE.UILibrary.Utils.UIUtils.SetFrmTrans(entry, "دامنه", FormBorderStyle.FixedDialog);
                if (entry.DialogResult != DialogResult.OK)
                {
                    return;
                }
                if (view.UpdateAppDomain(app))
                {
                    node.Text = app.Title;
                }
            }
            else if (name == "AddAppDomain")
            {
                UCAppDomainEntry entry = new UCAppDomainEntry(view);
                ISE.UILibrary.Utils.UIUtils.SetFrmTrans(entry, "دامنه", FormBorderStyle.FixedDialog);
                if (entry.DialogResult != DialogResult.OK)
                {
                    return;
                }
                if (view.InsertAppDomain(entry.ApplicationDomain))
                {
                    var appNode = CreateApplicationNode(entry.ApplicationDomain);
                    appNode.Value = entry.ApplicationDomain;
                    addContextMenu(appNode, MenuType.AppDomain);
                    this.radTreeViewResource.Nodes.Add(appNode);
                }
            }
            else if (name == "CreateSubmenu")
            {
                var            node  = this.radTreeViewResource.SelectedNode;
                UCSubMenuEntry entry = new UCSubMenuEntry();
                ISE.UILibrary.Utils.UIUtils.SetFrmTrans(entry, "زیر منو", FormBorderStyle.FixedDialog);
                if (entry.DialogResult != DialogResult.OK)
                {
                    return;
                }
                if (node.Value is ApplicationDomainDto)
                {
                    var val = (ApplicationDomainDto)node.Value;
                    entry.SecurityResource.AppDomainId = val.ApplicationDomainId;
                }
                else if (node.Value is SecurityResourceDto)
                {
                    var val = (SecurityResourceDto)node.Value;
                    entry.SecurityResource.AppDomainId = val.AppDomainId;
                    entry.SecurityResource.ParentId    = val.SecurityResourceId;
                }
                if (view.Insert(entry.SecurityResource))
                {
                    var resources   = view.LoadResources(0);
                    var submenuNode = CreateSubmenuTree(entry.SecurityResource, resources);
                    addContextMenu(submenuNode, (MenuType)entry.SecurityResource.ResourceTypeId);
                    if (submenuNode != null)
                    {
                        submenuNode.Value = entry.SecurityResource;

                        node.Nodes.Add(submenuNode);
                        node.Expand();
                    }
                }
            }
            else if (name == "EditSubmenu")
            {
                var node = this.radTreeViewResource.SelectedNode;
                SecurityResourceDto subMenu = (SecurityResourceDto)node.Value;
                UCSubMenuEntry      entry   = new UCSubMenuEntry(TransMode.EditRecord, subMenu);
                ISE.UILibrary.Utils.UIUtils.SetFrmTrans(entry, "زیر منو", FormBorderStyle.FixedDialog);
                if (entry.DialogResult != DialogResult.OK)
                {
                    return;
                }
                if (view.Update(subMenu))
                {
                    node.Text = subMenu.DisplayName;
                }
            }
            else if (name == "DeleteSubmenu")
            {
                if (ISE.Framework.Client.Win.Viewer.MessageViewer.ShowAlert("آیا از حذف زیر منو مطمئن هستید؟") != DialogResult.OK)
                {
                    return;
                }
                var node   = this.radTreeViewResource.SelectedNode;
                var parent = node.Parent;
                SecurityResourceDto subMenu = (SecurityResourceDto)node.Value;
                if (node.Nodes.Count == 0)
                {
                    if (view.Remove(subMenu))
                    {
                        parent.Nodes.Remove(node);
                    }
                }
                else
                {
                    ISE.Framework.Client.Win.Viewer.MessageViewer.ShowException("غیر قابل حذف می باشد!");
                }
            }
            else if (name == "CreateResource")
            {
                UCResourceEntry entry = new UCResourceEntry();
                ISE.UILibrary.Utils.UIUtils.SetFrmTrans(entry, "زیر منو", FormBorderStyle.FixedDialog);
                if (entry.DialogResult != DialogResult.OK)
                {
                    return;
                }
                var node = this.radTreeViewResource.SelectedNode;

                SecurityResourceDto subMenu = (SecurityResourceDto)node.Value;
                entry.SecurityResource.AppDomainId = subMenu.AppDomainId;
                entry.SecurityResource.ParentId    = subMenu.SecurityResourceId;
                if (view.Insert(entry.SecurityResource))
                {
                    var resources = view.LoadResources(0);
                    var newNode   = CreateSubmenuTree(entry.SecurityResource, resources);
                    node.Nodes.Add(newNode);
                }
            }
            else if (name == "EditResource")
            {
                var node = this.radTreeViewResource.SelectedNode;
                SecurityResourceDto subMenu = (SecurityResourceDto)node.Value;
                UCResourceEntry     entry   = new UCResourceEntry(TransMode.EditRecord, subMenu);
                ISE.UILibrary.Utils.UIUtils.SetFrmTrans(entry, "زیر منو", FormBorderStyle.FixedDialog);
                if (entry.DialogResult != DialogResult.OK)
                {
                    return;
                }
                if (view.Update(entry.SecurityResource))
                {
                    node.Text = subMenu.DisplayName;
                }
            }
            else if (name == "DeleteResource")
            {
                if (ISE.Framework.Client.Win.Viewer.MessageViewer.ShowAlert("آیا از حذف منبع مطمئن هستید؟") != DialogResult.OK)
                {
                    return;
                }
                var node   = this.radTreeViewResource.SelectedNode;
                var parent = node.Parent;
                SecurityResourceDto subMenu = (SecurityResourceDto)node.Value;
                if (node.Nodes.Count == 0)
                {
                    if (view.Remove(subMenu))
                    {
                        parent.Nodes.Remove(node);
                    }
                }
                else
                {
                    ISE.Framework.Client.Win.Viewer.MessageViewer.ShowException("غیر قابل حذف می باشد!");
                }
            }
            else if (name == "AddOperation")
            {
                var node = this.radTreeViewResource.SelectedNode;
                SecurityResourceDto subMenu = (SecurityResourceDto)node.Value;
                UCSelectOperation   entry   = new UCSelectOperation();
                ISE.UILibrary.Utils.UIUtils.SetFrmTrans(entry, "افزودن عملیات", FormBorderStyle.FixedDialog);
                if (entry.DialogResult != DialogResult.OK)
                {
                    return;
                }
                ResourcePresenter presenter = new ResourcePresenter();
                var container = presenter.AddOperatins(subMenu, entry.SelectedOperations);
                if (container != null)
                {
                    foreach (var item in container.PermissionDtoList)
                    {
                        var operation = entry.SelectedOperations.FirstOrDefault(it => it.OperationId == item.OperationId);
                        CreateOperationNode(operation, node);
                    }
                }
            }
            else if (name == "deleteOperation")
            {
                if (ISE.Framework.Client.Win.Viewer.MessageViewer.ShowAlert("آیا از حذف عملیات مطمئن هستید؟") != DialogResult.OK)
                {
                    return;
                }
                ResourcePresenter presenter = new ResourcePresenter();
                var node   = this.radTreeViewResource.SelectedNode;
                var parent = node.Parent;
                SecurityResourceDto resource  = (SecurityResourceDto)parent.Value;
                OperationDto        operation = (OperationDto)node.Value;

                if (presenter.RemoveOperatin(resource, operation) != null)
                {
                    parent.Nodes.Remove(node);
                }
                else
                {
                    ISE.Framework.Client.Win.Viewer.MessageViewer.ShowException("غیر قابل حذف می باشد!");
                }
            }
        }