コード例 #1
0
        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);
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
ファイル: DeepDungeon.cs プロジェクト: nt153133/DeepDive
        //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();
            }
        }
コード例 #5
0
 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);
 }
コード例 #6
0
        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();
        }
コード例 #7
0
 public ActionResult Edit(int id, Director director)
 {
     try
     {
         // TODO: Add update logic here
         DirectorManager.Update(director);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
コード例 #8
0
 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));
     }
 }
コード例 #9
0
ファイル: DeepDungeon.cs プロジェクト: supperrien/DeepDive
        //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();
            }
        }
コード例 #10
0
 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));
     }
 }