public Boolean Edit(ExaminationTaskTemplate model) { try { olsEni.Entry(model).State = EntityState.Modified; olsEni.SaveChanges(); return true; } catch (Exception ex) { StaticHelper.RecordSystemLog(ex); return false; } }
public ActionResult Create(ExaminationTaskTemplate m) { if (ModelState.IsValid) { if (um.Create(m)) { return Redirect("/Contents/html/parent_reload.htm"); } } ViewBag.DepartmentsAndUsers = new UDepartment().GetZTreeJsonWithUsers(); ViewBag.QuestionClassifies = new UQuestionClassify().GetZTreeJson(Status.Available); return View(m); }
public Boolean Create(ExaminationTaskTemplate model) { try { Int32 id; id = GetETTId(); model.ETT_Id = id; olsEni.ExaminationTaskTemplates.Add(model); olsEni.SaveChanges(); return true; } catch (Exception ex) { StaticHelper.RecordSystemLog(ex); return false; } }
public ExaminationTaskTemplate GetNew() { DateTime initDateTime; ExaminationTaskTemplate model; initDateTime = new DateTime(1970, 1, 1); model = new ExaminationTaskTemplate() { ETT_Id = 0, ETT_Name = "", ETT_ParticipatingDepartment = "[]", ETT_Attendee = "[]", ETT_StatisticType = (Byte)StatisticType.Unset, ETT_TotalScore = 100, ETT_TotalNumber = 10, ETT_AutoType = (Byte)AutoType.Manual, ETT_AutoClassifies = "[]", ETT_AutoRatio = "[]", ETT_StartTime = initDateTime, ETT_EndTime = initDateTime, ETT_TimeSpan = 30, ETT_Remark = "", ETT_AddTime = now, ETT_Status = (Byte)Status.Available }; return model; }