private void Ems_Click(object sender, RoutedEventArgs e) { Emergency em = new Emergency(); em.Show(); GlobalUsage.GetRtClient().CallEmergency(new MessagesPack.IntIntRequest()); }
void UpdateView() { var tmpButton = new Button { Height = 60, Width = 100 }; var LastLeftCornerX = 10; var LastLeftCornerY = 10; foreach (var item in depList.DepsDesc) { tmpButton = new Button { Height = 60, Width = 100, Margin = new Thickness(LastLeftCornerX, LastLeftCornerY, 0, 0), Background = new SolidColorBrush(Color.FromArgb(50, (byte)(new Random().Next(55, 160)), (byte)(new Random().Next(55, 160)), (byte)(new Random().Next(55, 160)))), Name = "button_" + item.Name, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top, Content = item.Name + "\n" + GlobalUsage.GetInfClient().GetDepHead(new DepartmentDescription { Index = item.Index, Name = item.Name }).Name }; MainGrid.Children.Add(tmpButton); LastLeftCornerX += new Random().Next(-40, 150); LastLeftCornerY += new Random().Next(65, 80); } }
private void Coffee_Click(object sender, RoutedEventArgs e) { GlobalUsage.GetRtClient().PullCoffeeBrake(new MessagesPack.CoffeBreakRequest() { Name = GlobalUsage.CurrentUser.name }); }
private void MainGrid_Loaded(object sender, RoutedEventArgs e) { _depList = GlobalUsage.GetInfClient().GetDepartments(new BlankMsg() { }); UpdateView(); }
private void Window_loaded(object sender, RoutedEventArgs e) { //get department list and show them in ComboBox var depList = GlobalUsage.GetInfClient().GetDepartments(new MessagesPack.BlankMsg()); foreach (var dep in depList.DepsDesc) { DepartmentSelection.Items.Add(dep.Name); } }
private void Confirm_Click(object sender, RoutedEventArgs e) { GetName(); GetPassword(); var resp = GlobalUsage.GetIntClient().Register(new RegisterRequest { Level = Level, Name = Name, Password = Password, TeamName = TeamName, DepName = DepName }); MessageBox.Show(resp.Msg); }
private void DepartmentSelection_SelectionChanged(object sender, SelectionChangedEventArgs e) { TeamSelection.Items.Clear(); //remember chosen department DepName = (string)(DepartmentSelection.SelectedItem); //get teams for this department and show them in ComboBox var teamList = GlobalUsage.GetInfClient().GetDepartmetTeams(new NameRequest { TeamName = DepName }); foreach (var t in teamList.TeamDesc) { TeamSelection.Items.Add(t.Name); } }
private void Window_loaded(object sender, RoutedEventArgs e) { var listOfWorkers = GlobalUsage.GetInfClient().GetAllWorkers(new BlankMsg()); var itemList = new List <WorkerItem>(); foreach (var w in listOfWorkers.TeamDesc) { itemList.Add(new WorkerItem() { Name = w.Name, Id = w.Index }); } listW.ItemsSource = itemList; }
private void Leaders_Click(object sender, RoutedEventArgs e) { LeadersList.Visibility = Visibility.Visible; Close.Visibility = Visibility.Visible; var ls = GlobalUsage.GetInfClient().GetLeaders(new MessagesPack.BlankMsg()); var lsItems = new List <LeaderListItem>(); lsItems.Add(tmpl); foreach (var l in ls.Leaders) { lsItems.Add(new LeaderListItem { LID = Convert.ToString(l.LeaderId), LName = l.LeaderName, LteamID = Convert.ToString(l.TeamId), LteamName = l.TeamName }); } LeadersList.ItemsSource = lsItems; }
private void NewDep_Click(object sender, RoutedEventArgs e) { var dialog = new NamePrompt("Add new department", ""); dialog.Closing += (_sender, _e) => { var d = _sender as NamePrompt; if (!d.Canceled) { GlobalUsage.GetIntClient().AddDepartment(new AddDepRequest { DepName = d.InputText }); } }; dialog.Show(); }
private void Update() { var tasks = GlobalUsage.GetInfClient().GetTaskList(new MessagesPack.TaskListRequest { TeamName = GlobalUsage.CurrentUser.teamName }); var lsTodo = new List <TaskItem>(); var lsInprogress = new List <TaskItem>(); var lsTesting = new List <TaskItem>(); var lsDone = new List <TaskItem>(); foreach (var i in tasks.Tasks) { if (i.Status == "todo") { lsTodo.Add(new TaskItem { teamName = i.Team, status = i.Status, teamID = i.TeamID, text = i.Text }); } else if (i.Status == "inprogress") { lsInprogress.Add(new TaskItem { teamName = i.Team, status = i.Status, teamID = i.TeamID, text = i.Text }); } else if (i.Status == "testing") { lsTesting.Add(new TaskItem { teamName = i.Team, status = i.Status, teamID = i.TeamID, text = i.Text }); } else if (i.Status == "done") { lsDone.Add(new TaskItem { teamName = i.Team, status = i.Status, teamID = i.TeamID, text = i.Text }); } } ListT.ItemsSource = lsTesting; ListTD.ItemsSource = lsTodo; ListIP.ItemsSource = lsInprogress; ListD.ItemsSource = lsDone; }
public static void CheckEventsStatus(object sender, ElapsedEventArgs e) { var responseEm = GlobalUsage.GetRtClient().PullEmergency(new IntIntRequest { TeamID = GlobalUsage.CurrentUser.teamID, WorkerID = GlobalUsage.CurrentUser.workerID }); var responseCo = GlobalUsage.GetRtClient().PullCoffeeBrake(new CoffeBreakRequest { Name = GlobalUsage.CurrentUser.name }); if (responseCo.State) { var coffee = new CoffeeBreak(); coffee.Show(); } if (responseEm.State) { var emer = new Emergency(); emer.Show(); } }
void UpdateView() { var itemList = new List <DepsListItem>(); foreach (var w in _depList.DepsDesc) { itemList.Add(new DepsListItem(w.Index, w.Name, GlobalUsage.GetInfClient().GetDepartmetTeams(new NameRequest() { TeamName = w.Name }).TeamDesc.Count, GlobalUsage.GetInfClient().GetDepartmentWorkers(new NameRequest() { TeamName = w.Name }).TeamDesc.Count, GlobalUsage.GetInfClient().GetDepHead(new DepartmentDescription() { Index = w.Index, Name = w.Name }).Name)); } DepsList.ItemsSource = itemList; }