Exemplo n.º 1
0
 private static void BuildModel(UserExpertViewModel model, UserExpert expert) {
     expert.Name = model.Name;
     expert.SubTitle = model.SubTitle;
     expert.Expertise = model.Expertise;
     expert.Description = model.Description;
     expert.Honor = model.Honor;
     expert.Sort = model.Sort;
     expert.Status = model.Status;
 }
Exemplo n.º 2
0
        public ActionResult EditorPost(UserExpertViewModel model, Int32 mid, Int32 flag) {
            UserExpert expert;
            if (model.Id > 0) {
                expert = _userExpertService.Get(model.Id);
                BuildModel(model, expert);
                expert.UpdateAt = DateTime.UtcNow;
            } else {
                expert = new UserExpert();
                BuildModel(model, expert);
                expert.CreateAt = DateTime.UtcNow;
                _userExpertService.Create(expert);
            }

            return RedirectToAction("Index", new {
                mid,
                flag
            });
        }