private void ExecuteDelete(object parameter) { IMessageBoxService msg = new MessageBoxService(); string title = "Deleting Business Unit"; string confirmtxt = "Do you want to delete the selected item"; if (BUs.Where(x => x.IsChecked).Count() > 1) { title = title + "s"; confirmtxt = confirmtxt + "s"; } if (msg.ShowMessage(confirmtxt + "?", title, GenericMessageBoxButton.OKCancel, GenericMessageBoxIcon.Question).Equals(GenericMessageBoxResult.OK)) { foreach (ModelBaseVM si in BUs) { if (si.IsChecked) { if (si.ID > 0) { DeleteBusinessUnit(si.ID); } deleteditems.Add(si); } } foreach (ModelBaseVM pm in deleteditems) { BUs.Remove(pm); } deleteditems.Clear(); CheckValidation(); } msg = null; }
private void BUs_ItemPropertyChanged(object sender, ItemPropertyChangedEventArgs e) { if (e.PropertyName != "IsChecked") { CheckValidation(); isdirty = true; } IsSelected = BUs.Where(x => x.IsChecked).Count() > 0; }
private void ExecuteAddNew(object obj) { BUs.Add(new ModelBaseVM() { ID = 0, Name = string.Empty }); canexecutesave = false; }
public IQueryable <Ticket> GetTicketsForManager([FromUri] BUs bu) { List <Ticket> tickets = new List <Ticket>(); var ticket = db.Tickets.Join(db.Assets, t => t.AssetID, a => a.AssetID, (t, a) => new { t1 = t, a1 = a }) .Join(db.Buses, a => a.a1.BUID, b => b.BUID, (a, b) => new { a3 = a, b3 = b }); ticket.Where(b => b.b3.BUID == bu.BUID); foreach (var obj in ticket) { tickets.Add(obj.a3.t1); } return(tickets.AsQueryable <Ticket>()); }
private bool BUNameMissing() { int nummissing = BUs.Where(x => string.IsNullOrEmpty(x.Name.Trim())).Count(); return(nummissing > 0); }