Exemplo n.º 1
0
        public ActionResult Index(string codingLanguage = null, string noteType = null)
        {
            List <CodingLanguage> codingLanguages = cContext.Collections().OrderBy(o => o.Name).ToList();
            List <NoteType>       noteTypes       = typeContext.Collections().OrderBy(o => o.Name).ToList();
            List <Note>           notes;

            if (codingLanguage == null && noteType == null)
            {
                notes = noteContext.Collections().OrderBy(o => o.dateModified).ToList();
            }
            else if (noteType == null)
            {
                notes = noteContext.Collections().Where(n => n.CodingLanguage == codingLanguage).OrderBy(o => o.dateModified).ToList();
            }
            else if (codingLanguage == null)
            {
                notes = noteContext.Collections().Where(n => n.NoteType == noteType).OrderBy(o => o.dateModified).ToList();
            }
            else
            {
                notes = noteContext.Collections().Where(n => n.NoteType == noteType).Where(n => n.CodingLanguage == codingLanguage).OrderBy(o => o.dateModified).ToList();
            }
            NoteListViewModel viewModel = new NoteListViewModel();

            viewModel.notes           = notes;
            viewModel.codingLanguages = codingLanguages;
            viewModel.noteTypes       = noteTypes;
            return(View(viewModel));
        }
Exemplo n.º 2
0
        public MainPage()
        {
            InitializeComponent();

            DataContext = new NoteListViewModel();
            LoadNotes();
        }
Exemplo n.º 3
0
        public MainPage()
        {
            InitializeComponent();

            ViewModel = new NoteListViewModel();

            BindingContext = ViewModel;
        }
Exemplo n.º 4
0
 public NoteListPage()
 {
     InitializeComponent();
     BindingContext = new NoteListViewModel()
     {
         Navigation = this.Navigation
     };
 }
Exemplo n.º 5
0
        public MainViewModel(IApi api, UIHost uiHost, FolderListViewModel folderList, NoteListViewModel noteList)
        {
            Api        = api;
            UIHost     = uiHost;
            FolderList = folderList;
            NoteList   = noteList;

            ShowSettingsCommand = new RelayCommand(ShowSettings);
        }
Exemplo n.º 6
0
        public ActionResult Index(FetchOptions options)
        {
            var user  = userRepository.GetCurrentUser(User);
            var notes = noteRepository.GetAllByUser(user, options);
            var model = new NoteListViewModel
            {
                Notes = notes
            };

            return(View(model));
        }
Exemplo n.º 7
0
        ViewModelBase createModel(int productId)
        {
            var model = new NoteListViewModel();

            var product = ProductService.FindProductModel(productId, 0, CurrentCompany);

            PrepareViewModel(model, EvolutionResources.bnrCompliance + (productId == 0 ? "" : " - " + product.ItemName),
                             productId, MakeMenuOptionFlags(0, 0, 0, 0, productId));
            model.ParentId = productId;

            return(model);
        }
Exemplo n.º 8
0
        ViewModelBase createModel(int saleId)       // Id of temp table POH
        {
            var model = new NoteListViewModel();
            var soht  = SalesService.FindSalesOrderHeaderTempModel(saleId, CurrentCompany);

            PrepareViewModel(model,
                             EvolutionResources.bnrSaleNotes + (soht == null ? "" : " - Order Number: " + soht.OrderNumber),
                             saleId,
                             MakeMenuOptionFlags(0, 0, 0, soht.OriginalRowId));
            model.ParentId = saleId;

            return(model);
        }
        ViewModelBase createModel(int purchaseId)       // Id of temp table POH
        {
            var model = new NoteListViewModel();
            var poht  = PurchasingService.FindPurchaseOrderHeaderTempModel(purchaseId, CurrentCompany);

            PrepareViewModel(model,
                             EvolutionResources.bnrPurchaseNotes + (poht == null ? "" : " - Order Number: " + poht.OrderNumber),
                             purchaseId,
                             MakeMenuOptionFlags(0, poht.OriginalRowId));
            model.ParentId = purchaseId;

            return(model);
        }
        ViewModelBase createModel(int customerId)
        {
            var model    = new NoteListViewModel();
            var customer = CustomerService.FindCustomerModel(customerId, CurrentCompany);

            PrepareViewModel(model,
                             EvolutionResources.bnrCustomerNotes + (customer == null ? "" : " - " + customer.Name),
                             customerId,
                             MakeMenuOptionFlags(customerId, 0));
            model.ParentId = customerId;

            return(model);
        }
Exemplo n.º 11
0
        public ActionResult GetNoteListByOrderId(int id, string orderType, long orderid)
        {
            var pager = new Pager {
                PageSize = Configinfo.NotePagerCount
            };

            pager = MyService.GetFloorNoteByOrderId(pager, id, orderid, orderType);
            var noteListViewModel = new NoteListViewModel
            {
                NotePagerInfo = pager
            };

            return(PartialView("_NoteList", noteListViewModel));
        }
Exemplo n.º 12
0
        public ActionResult NoteList(int id, string orderType, int?p)
        {
            var pageNo = (p ?? 1) > 0 ? (p ?? 1) : 1;
            var pager  = new Pager {
                PageNo = pageNo, PageSize = Configinfo.NotePagerCount
            };

            pager = MyService.GetFloorNotePaging(pager, id, orderType);
            var noteListViewModel = new NoteListViewModel
            {
                NotePagerInfo = pager
            };

            return(PartialView("_NoteList", noteListViewModel));
        }
Exemplo n.º 13
0
        public IActionResult GetAllByUser(int page = 1)
        {
            int pageSize = 30;
            var user     = _userService.GetUserByUserName(User.Identity.Name).Data;
            var list     = _noteService.GetByUserId(user.Id).Data;

            NoteListViewModel model = new NoteListViewModel
            {
                Notes       = PagingListSelectBySearch.SelectList(list, null, page, pageSize),
                PageCount   = PagingListSelectBySearch.GetPageCount(list, null, pageSize),
                PageSize    = pageSize,
                CurrentPage = page
            };

            return(View("GetAll", model));
        }
Exemplo n.º 14
0
        public ActionResult UserNoteList(int p, int size = 20)
        {
            var pager = new Pager {
                PageNo = p, PageSize = size
            };

            pager = MyService.GetArticlePaging(pager, 6, 0, user: UserInfo.userid);
            var noteListViewModel = new NoteListViewModel
            {
                NotePagerInfo = pager
            };

            if (pager.Amount > 0)
            {
                var varticle = (pager.Entity as IQueryable <blog_varticle>).First();
                var category = MyService.GetCategoryById(varticle.cateid);
                ViewBag.NoteUrl = WebUtils.GetCateUrl(category);
            }
            return(PartialView("_UserNote", noteListViewModel));
        }
Exemplo n.º 15
0
        public MainViewModel(string filePath = null)
        {
            if (!string.IsNullOrEmpty(filePath))
            {
                OpenPath(filePath);
            }
            else
            {
                Notes = new ObservableCollection <BaseNoteViewModel>();
                Notes.CollectionChanged += NotesOnCollectionChanged;
            }

            NoteListViewModel = new NoteListViewModel(this);

            OpenCommand              = new RelayCommand(Open);
            SaveCommand              = new RelayCommand(Save);
            SaveAsCommand            = new RelayCommand(SaveAs);
            AddNoteCommand           = new RelayCommand(AddNote);
            DeleteCurrentNoteCommand = new RelayCommand(DeleteCurrentNote);
            PreviousNoteCommand      = new RelayCommand(PreviousNote);
            NextNoteCommand          = new RelayCommand(NextNote);
        }
Exemplo n.º 16
0
        public IActionResult GetAll(int page = 1)
        {
            int pageSize = 30;
            var list     = _noteService.GetAll().Data;

            List <UserDto> users = new List <UserDto>();

            foreach (var note in list)
            {
                users.Add(_userService.GetByUserId(note.UserId).Data);
            }

            NoteListViewModel model = new NoteListViewModel
            {
                Notes       = PagingListSelectBySearch.SelectList(list, null, page, pageSize),
                Users       = users,
                PageCount   = PagingListSelectBySearch.GetPageCount(list, null, pageSize),
                PageSize    = pageSize,
                CurrentPage = page
            };

            return(View(model));
        }
Exemplo n.º 17
0
 public NoteList()
 {
     BindingContext = new NoteListViewModel(new PageService());
     InitializeComponent();
 }
Exemplo n.º 18
0
 public MainPage()
 {
     this.InitializeComponent();
     VM = DataContext as NoteListViewModel;
 }
Exemplo n.º 19
0
        public NoteListPage(Course course)
        {
            InitializeComponent();

            BindingContext = _viewModel = new NoteListViewModel(course);
        }
Exemplo n.º 20
0
 public NoteListPage()
 {
     InitializeComponent();
     BindingContext = _viewModel = App.Current.Services.GetService <NoteListViewModel>();
 }