public IActionResult SaveClient(ClientCreationViewModel model, int?id) { Dal dal = new Dal(); if (ModelState.IsValid) { model.Clientnew = dal.GetClient((int)id); model.Clientnew.Adresse = model.Adress; model.Clientnew.Compagnie = model.Company; model.Clientnew.Nom = model.ReferentName; model.Clientnew.Telephone = model.ReferentPhone; model.Clientnew.Mail = model.ReferentMail; bool result; result = dal.ModifyClient(model.Clientnew); if (result) { Collaborateurs c = dal.GetCollaborateurs(HttpContext.User.Identity.Name); var returnModel = new ClientListViewModel { clients = dal.GetClients(c) }; return(View("ClientList", returnModel)); } } return(View("ClientModification", model)); }
public ClientsListVmTests() { Clients client1 = new(); Clients client2 = new(); Clients client3 = new(); client1.Id = 1; client1.Name = "Bartlomiej"; client1.Surname = "Wlodarski"; client1.Age = 20; client2.Id = 2; client2.Name = "Maciej"; client2.Surname = "Wlodarczyk"; client2.Age = 21; client3.Id = 3; client3.Name = "Jan"; client3.Surname = "Kowalski"; client3.Age = 40; model = new ClientListViewModel { Clients = new ObservableCollection <Clients> { client1, client2, client3 } }; }
public async Task <IActionResult> Index(int page = 1, int pageSize = DEFAULT_PAGE_SIZE) { ClientPagingResult clientsPage = await this._clientService.GetPageAsync(page, pageSize); ClientListViewModel clientListViewModel = new ClientListViewModel(clientsPage, page, pageSize); int clientsFoundForPage = clientListViewModel.Clients.ToList().Count; // retrieve the stored item count (if it exists) int itemCount = 0; string itemCountAsString = this.Request.Cookies[CLIENT_COUNT_COOKIE_KEY]; // create the ClientListViewModel with appropriate total item account if (itemCountAsString != null && int.TryParse(itemCountAsString, out itemCount) && itemCount > clientListViewModel.TotalItemCount && clientsFoundForPage > 0 && clientsPage.HasMore) { // use the saved total item counts clientListViewModel = new ClientListViewModel(clientsPage, page, pageSize, itemCount); } if (itemCount != clientListViewModel.TotalItemCount && clientsFoundForPage > 0) { this.Response.Cookies.Append(CLIENT_COUNT_COOKIE_KEY, clientListViewModel.TotalItemCount.ToString()); } return(View("Index", clientListViewModel)); }
public async override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); viewModel = await ClientListViewModel.Init(WorkspaceId); SetDialogContent(); }
private MainViewModel PrepareMainViewModel(ClientStorage clientStorage, ProjectStorage projectStorage) { var clientListViewModel = new ClientListViewModel(clientStorage); var projectListViewModel = new ProjectListViewModel(projectStorage); var mainViewModel = new MainViewModel(clientListViewModel, projectListViewModel); return mainViewModel; }
public async Task <IActionResult> InputFormFounder(Founder founder) { if (ModelState.IsValid) { ViewBag.Title = "Форма добавления учредителя"; var client = await _allClients.GetObjectClient(Int16.Parse(founder.ClientId)); founder.Client = client; _clientFounders.AddFounder(founder); return(RedirectToAction("ListClients")); } else { var obj = new ClientListViewModel(); obj.AllClient = await _allClients.Clients(); var AllClientNoEntrepreneur = new List <Client>(); foreach (var item in obj.AllClient) { if (!item.IsEntrepreneur || item.Founders.Count < 1) { AllClientNoEntrepreneur.Add(item); } } ViewBag.Clients = new SelectList(AllClientNoEntrepreneur, "Id", "Name"); return(View()); } }
public async override void ViewDidLoad() { base.ViewDidLoad(); View.Apply(Style.Screen); EdgesForExtendedLayout = UIRectEdge.None; viewModel = await ClientListViewModel.Init(workspaceId); // Set ObservableTableViewController settings // ObservableTableViewController is a helper class // from Mvvm light package. TableView.RowHeight = 60f; TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; CreateCellDelegate = CreateClientCell; BindCellDelegate = BindCell; DataSource = viewModel.ClientDataCollection; // TODO: Keep previous version calling // a handler. Later it can be changed. PropertyChanged += (sender, e) => { if (e.PropertyName == SelectedItemPropertyName) { handler.OnClientSelected(SelectedItem); } }; NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Add, OnAddBtnPressed); }
public IActionResult SaveNewClient(ClientCreationViewModel model) { Dal dal = new Dal(); if (ModelState.IsValid) { var newClient = new Leaf.DAL.ScaffoldedModels.Client { Compagnie = model.Company, Adresse = model.Adress, Nom = model.ReferentName, Telephone = model.ReferentPhone, Mail = model.ReferentMail, Projet = new List <Projet>() }; bool result; result = dal.SaveNewClient(newClient); if (result) { Collaborateurs c = dal.GetCollaborateurs(HttpContext.User.Identity.Name); var returnModel = new ClientListViewModel { clients = dal.GetClients(c) }; return(View("ClientList", returnModel)); } } return(View(model)); }
/// <summary> /// This ActionResult will list all the clients in the Engineer's district /// </summary> /// <returns></returns> public ActionResult Index() { var listModel = new ClientListViewModel { Clients = _clientRepo.GetClientsOfDistrict(GetCurrentDistrictId()) }; return(View(listModel)); }
public async Task <IActionResult> ListClients() { ViewBag.Title = "Страница с клиентами"; var obj = new ClientListViewModel(); obj.AllClient = await _allClients.Clients(); return(View(obj)); }
public ClientListView() { InitializeComponent(); ClientListViewModel _vm = (ClientListViewModel)DataContext; _vm.MessageBoxShowDelegate = text => MessageBox.Show( text, "Error", MessageBoxButton.OK, MessageBoxImage.Information); }
public ActionResult List() { var vm = new ClientListViewModel(); List <ClientListViewModel> vmList = vm.ListClients(); ViewData["Count"] = vmList.Count(); return(View(vmList)); }
public void RemoveClientFromStorageWhenClickRemoveButton() { var clientForRemove = new Client {Name = "Name 1", ContactName = "Contact 1"}; clientStorage.AddClient(clientForRemove); clientListViewModel = Open(); clientListViewModel.Client.Single().Remove.Execute(null); Assert.IsFalse(IsClientStorageContainClient(clientForRemove)); }
public void AddClientToStorageWhenClickAddButton() { var clientForAdd = new Client {Name = "Name 1", ContactName = "Contact 1"}; clientListViewModel = Open(); InsertNewClientData(clientForAdd); clientListViewModel.NewClient.Add.Execute(null); Assert.IsTrue(IsClientStorageContainClient(clientForAdd)); }
public async Task <IActionResult> Index() { var clients = await _clientAppService.GetAllClients(); var model = new ClientListViewModel { Clients = clients.Clients }; return(View(model)); }
public IActionResult Client() { IList <ActivityModel> IlistCLientActivity = new List <ActivityModel>(); IList <BlokirModel> IlistCLientBlokir = new List <BlokirModel>(); ClientListViewModel vModel = new ClientListViewModel(); //subRefreshBlokir(2, _intNIK, _strGuid, out IlistCLientBlokir); vModel.ClientActivity = IlistCLientActivity; vModel.ClientBlokir = IlistCLientBlokir; return(View(vModel)); }
public override void OnDestroy() { if (viewModel != null) { viewModel.OnIsLoadingChanged -= OnModelLoaded; viewModel.ClientListDataView.Updated -= OnWorkspaceClientsUpdated; viewModel.Dispose(); viewModel = null; } base.OnDestroy(); }
/// <summary> /// Initializes a new instance of the <see cref="ProducersAndMaterialsTabItemViewModel"/> class. /// </summary> /// <param name="modalDialogProvider">The modal dialog service.</param> /// <param name="serviceFactory">The service factory.</param> public ClientsAndBuildingsTabItemViewModel(IMainViewModel mainViewModel, IModalDialogProvider modalDialogProvider, IServiceFactory serviceFactory) : base(mainViewModel, modalDialogProvider, serviceFactory) { BuildingDetailsViewModel = new BuildingDetailsViewModel(MainViewModel, ModalDialogProvider, ServiceFactory); BuildingListViewModel = new BuildingListViewModel(MainViewModel, BuildingDetailsViewModel, ModalDialogProvider, ServiceFactory); ClientDetailsViewModel = new ClientDetailsViewModel(MainViewModel, BuildingListViewModel, ModalDialogProvider, ServiceFactory); ClientListViewModel = new ClientListViewModel(MainViewModel, ClientDetailsViewModel, ModalDialogProvider, ServiceFactory); ViewModelProvider.RegisterChildViewModel(ClientDetailsViewModel, ViewModelProviderAction.IsReadOnlyChanged); ViewModelProvider.RegisterChildViewModel(BuildingDetailsViewModel, ViewModelProviderAction.IsReadOnlyChanged); }
public IActionResult ClientList() { Dal dal = new Dal(); Collaborateurs c = dal.GetCollaborateurs(HttpContext.User.Identity.Name); var collaborateurs = dal.GetCollaborateurs(c.Id); var model = new ClientListViewModel { clients = dal.GetClients(collaborateurs) }; return(View(model)); }
private async void SelectClientBitClickedHandler(object sender, EventArgs e) { if (await ClientListViewModel.ContainsClients(WorkspaceId)) { ClientListDialogFragment.NewInstance(WorkspaceId) .SetClientSelectListener(this) .Show(FragmentManager, "clients_dialog"); } else { CreateClientDialogFragment.NewInstance(WorkspaceId) .SetOnClientSelectedListener(this) .Show(FragmentManager, "new_client_dialog"); } }
public async override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); if (viewModel == null) { viewModel = new ClientListViewModel(workspaceId, model); } await viewModel.Init(); if (viewModel.Model.Workspace == null || viewModel.Model.Workspace.Id == Guid.Empty) { Dismiss(); } }
public IActionResult ShowList() { var model = new ClientListViewModel(); if (HttpContext.Session.GetString("CLIENT_LIST") != null) { model.Clients = SessionHelper.GetObjectFromJson <List <ClientModel> >(HttpContext.Session, "CLIENT_LIST"); } else { model.Clients = new List <ClientModel>(); } return(View(model)); }
public ActionResult Search(string q) { var vm = new ClientListViewModel(); List <ClientListViewModel> vmList = vm.ListClients(q); ViewData["Count"] = vmList.Count(); if (Request.IsAjaxRequest()) { return(PartialView("_ClientListPartial", vmList)); } return(View("List", vmList)); }
public IActionResult Index(int?doctorId) { var result = new ClientListViewModel(); result.ClientVMList = new List <ClientViewModel>(); List <Client> cltList; //----Determine list of Clients --------------------------------------- if (!doctorId.HasValue) // Admin vraagt lijst op van alle clienten { cltList = _clientManager.SelectAllClientsAdmin(out int nrOfClients); } else // Doctor vraagt lijst op van zijn eigen clienten { result.DoctorId = doctorId.Value; result.DoctorFullName = _clientManager.DoctorFullName(doctorId.Value); cltList = _clientManager.SelectAllClientsPerDoctor((int)doctorId, out int nrOfClients); } // Copy clientList to clientListViewModel. for (int i = 0; i < cltList.Count; i++) { // Map Client naar ClientVM via extension method: var c1 = cltList[i]; var c2 = cltList[i].ToClientVM(); // Vul de basisvelden van c2 // Voeg afgeleide velden toe aan c2 c2.AgeInDays = (int)(DateTime.Today.Subtract(c1.BirthDate)).TotalDays; c2.ClientFullName = c1.FirstName + " " + c1.LastName; c2.NrofPrescriptions = _clientManager.GetNrOfPrescrPerClient(c1.Id); c2.DoctorFullName = _clientManager.DoctorFullName(c1.DoctorId); result.ClientVMList.Add(c2); } ; // sorteer result.ClientVMList op ClientFullName result.ClientVMList = result .ClientVMList .OrderBy(c => c.ClientFullName) .ToList(); return(View(result)); }
public PartialViewResult Details(int ClientId) { Client CObj = repoObj.GetClientById(ClientId); ClientListViewModel viewObj = new ClientListViewModel(); viewObj.ClientId = CObj.ClientId; viewObj.ClientName = CObj.ClientName; viewObj.DateOfBirth = CObj.DateOfBirth; viewObj.Email = CObj.Email; viewObj.Phone = CObj.Phone; viewObj.IsActive = CObj.IsActive; viewObj.ImageName = CObj.ImageName; viewObj.ImageURL = CObj.ImageURL; viewObj.AccountsTypeId = CObj.AccountsTypeId; return(PartialView("_DetailsRecord", viewObj)); }
public PartialViewResult GetClientDetails(int ClientID) { Client obj = _context.Clients.Where(p => p.ClientID == ClientID).SingleOrDefault(); ClientListViewModel vObj = new ClientListViewModel(); vObj.ClientID = obj.ClientID; vObj.Name = obj.Name; vObj.IsActive = obj.IsActive; vObj.DoB = obj.DoB; vObj.Email = obj.Email; vObj.Phone = obj.Phone; vObj.Salary = obj.Salary; vObj.ImageUrl = obj.ImageUrl; //vObj.GradeName = obj.Grade.GradeName; return(PartialView("_ClientDetailsPartial", vObj)); }
public ActionResult Details(int ClientID) { Client clObj = _context.Clients.SingleOrDefault(p => p.ClientID == ClientID); ClientListViewModel viewObj = new ClientListViewModel(); viewObj.ClientID = clObj.ClientID; viewObj.Name = clObj.Name; viewObj.DoB = clObj.DoB; viewObj.IsActive = clObj.IsActive; viewObj.Email = clObj.Email; viewObj.Phone = clObj.Phone; viewObj.Salary = clObj.Salary; viewObj.AccountTypeId = clObj.AccountTypeId; //viewObj.GradeName = playerObj.Grade.GradeName; viewObj.ImageUrl = clObj.ImageUrl; return(PartialView("_DetailsRecord", viewObj)); }
public ActionResult Index() { SetHeaders("Kontrahenci", "Lista wszystkich kontrahentów", "Index", "Client"); var clients = _optimaDbContext.Kontrahenci.AsEnumerable(); var clientsDto = Mapper.Instance.Map <IEnumerable <ClientListDto> >(clients); SetViewParams("Knt_Nazwa1", _defaultPage, _defaultPageSize); var listData = clientsDto.ToPagedList(_defaultPage, _defaultPageSize); var viewModel = new ClientListViewModel() { ListData = listData, }; return(View(viewModel)); }
public async Task <IActionResult> InputFormFounder() { ViewBag.Title = "Форма добавления учредителя"; var obj = new ClientListViewModel(); obj.AllClient = await _allClients.Clients(); var AllClientNoEntrepreneur = new List <Client>(); foreach (var item in obj.AllClient) { if (!item.IsEntrepreneur || item.Founders.Count < 1) { AllClientNoEntrepreneur.Add(item); } } ViewBag.Clients = new SelectList(AllClientNoEntrepreneur, "Id", "Name"); return(View()); }
public ActionResult List_Client(int page = 1) { ClientListViewModel model = new ClientListViewModel { ClientCards = _repository.ClientCard .OrderBy(m => m.ClientId) .AsEnumerable() .Reverse() .Skip((page - 1) * PageSize) .Take(PageSize), PagingView = new ListView { CurrentPage = page, ContextPerPage = PageSize, TotalContext = _repository.ClientCard.Count() } }; return(View(model)); }
public ActionResult List() { try { using (IUnitOfWork uow = unitOfWorkFactory.Create(IsolationLevel.ReadCommitted)) { var model = new ClientListViewModel() { ClientGrid = GetClientGridLocal(new GridState() { PageSize = 25, Sort = "CreationDate=Desc" }) }; return(View(model)); } } catch (Exception ex) { return(Content(ProcessException(ex))); } }
public ClientListViewModel GetClientList(string account, string token) { ClientListViewModel clvm = new ClientListViewModel(); List <ClientModel> list = _cr.FindAll(token); foreach (var item in list) { ClientViewModel cbvm = new ClientViewModel(); cbvm.Id = item.Id; cbvm.ClientName = item.ClientName; cbvm.Address = item.Address; cbvm.Linkman = item.Linkman; cbvm.ClientSn = item.ClientSn; cbvm.Telephone = item.Telephone; cbvm.Mobile = item.Mobile; cbvm.Description = item.Description; cbvm.Token = item.Token; clvm.list.Add(cbvm); } clvm.Success = true; clvm.Message = "获取客户信息成功"; return(clvm); }
public async Task <IActionResult> Index( Guid?siteId, int pageNumber = 1, int pageSize = -1 ) { var selectedSite = await siteManager.GetSiteForDataOperations(siteId); // only server admin site can edit other sites settings if (selectedSite.Id != siteManager.CurrentSite.Id) { ViewData["Title"] = string.Format(CultureInfo.CurrentUICulture, sr["{0} - Client Management"], selectedSite.SiteName); } else { ViewData["Title"] = sr["Client Management"]; } int itemsPerPage = 10; if (pageSize > 0) { itemsPerPage = pageSize; } var model = new ClientListViewModel(); model.SiteId = selectedSite.Id.ToString(); var result = await clientsManager.GetClients(selectedSite.Id.ToString(), pageNumber, itemsPerPage); model.Clients = result.Data; model.Paging.CurrentPage = pageNumber; model.Paging.ItemsPerPage = itemsPerPage; model.Paging.TotalItems = result.TotalItems; return(View(model)); }
public ClientListViewModelTest() { clientListViewModel = new ClientListViewModel() { ClientViewModels = new ObservableCollection <ClientItemViewModel>() { new ClientItemViewModel(new ClientModel() { _id = 1, _firstName = "DummyName", _lastName = "DummySurname" }), new ClientItemViewModel(new ClientModel() { _id = 1, _firstName = "DummyName", _lastName = "DummySurname" }), new ClientItemViewModel(new ClientModel() { _id = 1, _firstName = "DummyName", _lastName = "DummySurname" }), new ClientItemViewModel(new ClientModel() { _id = 1, _firstName = "DummyName", _lastName = "DummySurname" }) } }; }
public MainViewModel(ClientListViewModel clientListViewModel, ProjectListViewModel projectListViewModel) { ClientList = clientListViewModel; ProjectList = projectListViewModel; }
public ClientViewModel(Client client, ClientListViewModel parent) { this.client = client; this.parent = parent; }
public OpvoederEnClientListViewModel(OpvoederListViewModel olvm, ClientListViewModel clvm, LeefgroepListViewModel llvm) { Olmv = olvm; Clvm = clvm; Llvm = llvm; }
public NewClientViewModel(ClientListViewModel parent) { this.parent = parent; client = new Client {Name = "", ContactName = ""}; addNewClientDialogVisible = "Hidden"; }