public void Update_Returns_Updated_Object() { Director d = new Director(); d.FirstName = "Update"; d.LastName = "Test"; d.Id = manager.Create(d); d.FirstName = "UPDATED"; Director updated = manager.Update(d); Assert.AreEqual("UPDATED", d.FirstName); }
protected void btnUpdate_Click(object sender, EventArgs e) { try { //get the selected object that i want to use item = items[ddlExisting.SelectedIndex]; //update Description item.FirstName = txtFirst.Text; item.LastName = txtLast.Text; //delete it from the database int results = DirectorManager.Update(item); //update the list with new description items[ddlExisting.SelectedIndex] = item; //rebind Rebind(); Response.Write("Updated " + results + " rows..."); } catch (Exception ex) { Response.Write(ex.Message); } }
protected void btnUpdate_Click(object sender, EventArgs e) { try { // Get the one the user has selected int index = ddlDirectors.SelectedIndex; director = directors[ddlDirectors.SelectedIndex]; // Get the typed description from the screen director.FirstName = txtFirstName.Text; director.LastName = txtLastName.Text; // Add to the database DirectorManager.Update(director); // Update to the list directors[ddlDirectors.SelectedIndex] = director; Rebind(); ddlDirectors.SelectedIndex = index; ddlDirectors_SelectedIndexChanged(sender, e); } catch (Exception ex) { Response.Write("Error: " + ex.Message); } }
//private DDServiceNavigationProvider serviceProvider = new DDServiceNavigationProvider(); public override void Pulse() { if (Constants.SelectedDungeon == null) { return; } if (Constants.InDeepDungeon) { if (Constants.IgnoreEntity == null) { Constants.IgnoreEntity = Constants.SelectedDungeon.GetIgnoreEntity(Constants.BaseIgnoreEntity); } //force a pulse on the director if we are hitting "start" inside of the dungeon if (DirectorManager.ActiveDirector == null) { DirectorManager.Update(); } DDTargetingProvider.Instance.Pulse(); } if (_tasks != null) { _tasks.Tick(); } }
private void UpdateDirector() { director.Id = Int32.Parse(textBox1.Text); director.FirstName = textBox2.Text; director.LastName = textBox3.Text; director.Nationality = textBox4.Text; director.Birth = DateTime.Parse(dateTimePicker1.Text.ToString()); directorManager.Update(director); }
protected void EditButton_Click(object sender, EventArgs e) { DirectorManager manager = new DirectorManager(); Director director = new Director { FirstName = FirstNameTextBox.Text, LastName = LastNameTextBox.Text }; director.Id = Convert.ToInt32(DirectorsDropdownList.SelectedValue); manager.Update(director); DoDataBind(); manager.Dispose(); }
public ActionResult Edit(int id, Director director) { try { // TODO: Add update logic here DirectorManager.Update(director); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, Director director) { try { // TODO: Add update logic here DirectorManager.Update(director); return(RedirectToAction("Index")); } catch (Exception ex) { ViewBag.Message = ex.Message; return(View(director)); } }
//private DDServiceNavigationProvider serviceProvider = new DDServiceNavigationProvider(); public override void Pulse() { if (Constants.InDeepDungeon) { //force a pulse on the director if we are hitting "start" inside of the dungeon if (DirectorManager.ActiveDirector == null) { DirectorManager.Update(); } DDTargetingProvider.Instance.Pulse(); } if (_tasks != null) { _tasks.Tick(); } }
public ActionResult Edit(Director director) { if (ModelState.IsValid) { using (manager = new DirectorManager()) { manager.Update(director); } if (director == null) { return(HttpNotFound()); } else { return(RedirectToAction("Index")); } } else { return(View(director.Id)); } }