private void OnGUI() { // Check for null views if (PropertyView == null || WorkView == null) { CreateViews(); } // Get and process the current event Event e = Event.current; ProcessEvents(e); // Update WorkView.UpdateView(position, new Rect(0f, 0f, ViewPercentage, 1f), e, CurrentGraph); PropertyView.UpdateView(new Rect(position.width, position.y, position.width, position.height), new Rect(ViewPercentage, 0f, 1f - ViewPercentage, 1f), e, CurrentGraph); Repaint(); }
void CreateCell(WorkView view) { var name = new Label(); var work = new Label(); var workS = new Switch(); var time = new Label(); var delete = new Button(); StackLayout lay = new StackLayout(); StackLayout cellWraper = new StackLayout(); name.SetBinding(Label.TextProperty, "Name"); work.SetBinding(Label.TextProperty, "State"); workS.SetBinding(Switch.IsToggledProperty, "State"); workS.Toggled += async(s, e) => { var status = (bool)e.Value; if (status == true) { var item = name.Text; var start = DateTime.Now.ToLongDateString(); if (await view.DisplayAlert("出勤します", "キャスト:" + item + " \n出勤時間:" + DateTime.Now.ToShortTimeString(), "OK", "キャンセル")) { var kyast = new Work { Day = start, StartTime = DateTime.Now, UserName = item, State = true }; User user = _user.FindOne(item); user.State = true; _user.SaveUser(user); //_work.SaveWork(kyast); } } else { var item = name.Text; var start = DateTime.Now.ToLongDateString(); if (await view.DisplayAlert("退勤します", "キャスト:" + item + "時間:" + DateTime.Now.ToShortTimeString(), "OK", "キャンセル")) { User user = _user.FindOne(item); user.State = false; _user.SaveUser(user); //_work.SaveWork(kyast); } } }; time.Text = DateTime.Now.ToLongDateString(); time.TextColor = Color.Black; lay.Orientation = StackOrientation.Horizontal; name.HorizontalOptions = LayoutOptions.StartAndExpand; work.HorizontalOptions = LayoutOptions.CenterAndExpand; workS.HorizontalOptions = LayoutOptions.CenterAndExpand; time.HorizontalOptions = LayoutOptions.EndAndExpand; lay.Children.Add(name); lay.Children.Add(work); lay.Children.Add(workS); lay.Children.Add(time); cellWraper.Children.Add(lay); View = cellWraper; }
public WorkTodayCell(WorkView view) { InitializeComponent(); CreateCell(view); }
public static async Task ShowDialog(GetWorkResult work) { var view = new WorkView(); view.ShowDialog(); }
public async Task <IActionResult> WorkCreate(WorkView work) { await workManipulation.Add(work); return(RedirectToAction("WorkView")); }