public ActionResult Edit(TodoModels todoModels) { if (ModelState.IsValid) { _todoService.Update(todoModels.ToEntity()); return(RedirectToAction("Index")); } return(View(todoModels)); }
private void AddBut_Click(object sender, RoutedEventArgs e) { TodoModels model = new TodoModels(); if (TextBox.Text != "") { model.Text = TextBox.Text; model.Priorety = Convert.ToInt32(Getbutton().Content); model.Pereodicaly = ComboBoxAdd.Text; MainWindow.AddElement(model); } }
public static void AddElement(TodoModels model) { _todoData.Add(model); }