Exemple #1
0
 public ActionResult Edit(Organization organi)
 {
     if (ModelState.IsValid)
     {
         var model1 = new CompanyAndSchool().Update(organi);
         if (model1)
         {
             var modle = new Share().listOrgan(3).OrderByDescending(x => x.StartDay).ToList();
             return(RedirectToAction("Index", modle));
         }
         else
         {
             ModelState.AddModelError("", "Cập nhật thất bại");
         }
     }
     return(View("Edit"));
 }
Exemple #2
0
 public ActionResult Create(Organization organization)
 {
     if (ModelState.IsValid)
     {
         CompanyAndSchool organ = new CompanyAndSchool();
         if (organ.Create(organization, 3))
         {
             var modle = new Share().listOrgan(3).OrderByDescending(x => x.StartDay).ToList();
             var comid = modle[0].ID;
             var find  = database.Person.SingleOrDefault(x => x.SchoolID == comid);
             SendMailTK(find.PersonID);
             return(RedirectToAction("Index", modle));
         }
         else
         {
             ModelState.AddModelError("", "Thêm Công ty thất bại");
         }
     }
     return(View("Create"));
 }