Exemplo n.º 1
0
        public ActionResult AccountList()
        {
            var model = new AccountListModel();

            model.Accounts = _adminService.GetAccountList(null, null);
            return(View(model));
        }
Exemplo n.º 2
0
        public AccountListViewModel(AccountListModel model, INavigator navigator)
        {
            _model = model;
            _model.PropertyChanged += (sender, e) => RaisePropertyChanged(e.PropertyName);

            AccountClickCommand = new DelegateCommand <object>(parameter =>
            {
                navigator.UpdateCurrentViewModelCommand.Execute(new UpdateCurrentViewModelCommandParameter
                {
                    ViewType  = ViewType.Account,
                    Parameter = parameter,
                });
            });

            CreateContractCommand = new DelegateCommand <object>(parameter =>
            {
                navigator.UpdateCurrentViewModelCommand.Execute(new UpdateCurrentViewModelCommandParameter
                {
                    ViewType  = ViewType.Contract,
                    Parameter = 0,
                });
            });

            CurrentDateChangedCommand = new DelegateCommand <object>(parameter =>
            {
                if (parameter is DateTime currentDate)
                {
                    _model.ShiftTimeToCurrentDate(currentDate);
                }
            });
        }
        public ActionResult ChangeRole([Bind(Include = "Id, Role")]AccountListModel model)
        {
            var account = accountLogic.Get(model.Id);
            account.Role = model.Role;
            accountLogic.Create(account);

            return RedirectToAction("ChangeRole");
        }
 public ActionResult Details([Bind(Include = "SelectedId")]AccountRoleAddingModel model)
 {
     var account = accountLogic.Get(model.SelectedId);
     var returnedModel = new AccountListModel(account.Login)
     {
         Id = account.Id,
         Role = account.Role,
     };
     return PartialView("_DetailsAccountPartial", returnedModel);
 }
Exemplo n.º 5
0
        public ActionResult Accounts()
        {
            var accounts           = AuthProviderHost.PrimaryAuthProvider.GetAccounts(GetUserToken());
            AccountListModel model = new AccountListModel()
            {
                Accounts = accounts
            };

            return(View(model));
        }
Exemplo n.º 6
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <AccountListModel> FillJournalList(DataTable dt)
        {
            decimal inAmount = 0, outAmount = 0;
            List <AccountListModel> modelList = new List <AccountListModel>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                AccountListModel model;
                for (int n = 0; n < rowsCount; n++)
                {
                    inAmount = 0; outAmount = 0;
                    model    = new AccountListModel();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = dt.Rows[n]["ID"].ToString();
                    }
                    if (dt.Rows[n]["InAmount"] != null && dt.Rows[n]["InAmount"].ToString() != "")
                    {
                        inAmount = decimal.Parse(dt.Rows[n]["InAmount"].ToString());
                    }
                    if (dt.Rows[n]["OutAmount"] != null && dt.Rows[n]["OutAmount"].ToString() != "")
                    {
                        outAmount = decimal.Parse(dt.Rows[n]["OutAmount"].ToString());
                    }
                    model.Amount = inAmount > 0 ? inAmount.ToString() : (0 - outAmount).ToString();

                    if (dt.Rows[n]["Remark"] != null && dt.Rows[n]["Remark"].ToString() != "")
                    {
                        model.Remark = dt.Rows[n]["Remark"].ToString();
                    }

                    if (dt.Rows[n]["JournalDate"] != null && dt.Rows[n]["JournalDate"].ToString() != "")
                    {
                        model.RecordDate = DateTime.Parse(dt.Rows[n]["JournalDate"].ToString());
                    }

                    modelList.Add(model);
                }
            }
            return(modelList);
        }
        public async Task <AccountListModel> GetAccountsList()
        {
            CancellationToken ct   = new CancellationToken();
            AccountListModel  list = new AccountListModel();

            list.Accounts = new List <AccountLookupModel>();
            list.Accounts.Add(new AccountLookupModel()
            {
                Id = 1
            });
            try
            {
                CreateAccountCommand createAccountCommand = new CreateAccountCommand();
                createAccountCommand.MemeberId  = 1;
                createAccountCommand.MemberInfo = "Azrie";
                //int id = await mediator.Send(createAccountCommand, ct);
                list = await mediator.Send(new GetAccountsListQuery(), ct);
            }
            catch (Exception ex)
            {
                logger.LogWorning(ex.Message);
            }
            return(list);
        }
Exemplo n.º 8
0
 public ActionResult Index(AccountListModel model)
 {
     model.Accounts = listAccounts(model.SearchText, true, model.Page, model.SortColumn, model.SortDirection);
     return(View(model));
 }
Exemplo n.º 9
0
 public ActionResult AccountList(AccountListModel vm)
 {
     vm.Accounts = _adminService.GetAccountList(vm.StartDate, vm.EndDate);
     return(View(vm));
 }