public ActionResult Edit(Company company)
 {
     using (var cm = new CompanyManager())
     {
         company = cm.Edit(company);
     }
     return(RedirectToAction("List"));
 }
Exemple #2
0
        public ActionResult Edit(EditCompanyVM model)
        {
            if (Session["UserName"] == null)
            {
                return(RedirectToAction("Index", "Account"));
            }
            ViewBag.ReportTitle = "Edit User";

            CompanyManager.Edit(model);
            return(RedirectToAction("Index"));
        }
 protected void editButton_Click(object sender, EventArgs e)
 {
     if (companyId == 0)
     {
         messageLabel.InnerText = "Not Found";
     }
     else
     {
         var company = companyManager.Get(companyId);
         company.Name           = nameTextBox.Text;
         messageLabel.InnerText = companyManager.Edit(company);
     }
 }
        public void EditCompanyTest()
        {
            Company company;

            using (var cm = new CompanyManager())
            {
                company = cm.Single(1);
            }

            var oldTime = company.ModifiedOn;

            company.ModifiedOn = DateTime.Now;

            using (var cm = new CompanyManager())
            {
                company = cm.Edit(company);
            }

            using (var cm = new CompanyManager())
            {
                var company2 = cm.Single(1);
                Assert.IsTrue(company2.ModifiedOn > oldTime);
            }
        }