예제 #1
0
        public ActionResult Edit(int id, opportunity opportunity)
        {
            opportunity p = op.GetById(id);

            p.description = opportunity.description;
            op.Update(p);
            op.Commit();
            return(RedirectToAction("Index"));
        }
예제 #2
0
        public void TestUpdate()
        {
            ConfigurationHelper.Ensure();

            var service = new OpportunityService();

            var item = service.GetAll().FirstOrDefault();

            if (item == null)
            {
                this.TestAdd();
                item = service.GetAll().FirstOrDefault();
            }

            var    itemId = item.Id;
            string unique = (Guid.NewGuid()).ToString();

            item.Name = unique;
            service.Update(item);

            item = service.GetById(itemId);
            Assert.True(item.Name.Equals(unique, StringComparison.OrdinalIgnoreCase));
        }