Пример #1
0
        public ActionResult Update(SchoolModel schoolModel)
        {
            if (ModelState.IsValid)
            {
                schoolModel.Id = Guid.NewGuid().ToString();
                schoolModel.CreatedBy = SiteContext.JxxyUser.LoginName;
                schoolModel.CreatedDate = DateTime.Now;
                schoolModel.Add();
            }

            return RedirectToAction("show");
        }
Пример #2
0
 private static School ToLogicMode(SchoolModel schoolModel)
 {
     Mapper.CreateMap<SchoolModel, School>();
     var school = Mapper.Map<School>(schoolModel);
     return school;
 }
Пример #3
0
 public void Update(SchoolModel schoolModel)
 {
     var school = ToLogicMode(schoolModel);
     _school.Update(school);
 }