public ActionResult EditAssign(TPR_PROJECT_INSTITUTE project_ins) { decimal?USER_NO = Session["sess_USER_NO"] as decimal?; decimal?LOGON_NO = Session["sess_LOGON_NO"] as decimal?; TPR_PROJECT project = db.TPR_PROJECT.Single(p => p.PROJECT_NO == project_ins.PROJECT_NO); foreach (var subject in project_ins.Subjects) { if (subject.TARGET_DATE == null) { subject.TARGET_DATE = project.DEADLINE_DATE; } decimal is_active = subject.IS_ACTIVE ? 1 : 0; db.SET_CLASS_SUB_ASSIGN_UPDATE(project_ins.PROJECT_INS_NO, subject.SUBJECT_NO, is_active, subject.TARGET_DATE, USER_NO, LOGON_NO); } ViewBag.Subjects = db.SET_CLASS_SUBJECT_ASSIGN_GET(project_ins.PROJECT_INS_NO, project.CLASS_NO).ToList(); ViewBag.PROJECT = project; ViewBag.ZONAL_INFO = Session["TPR_ZONAL_INFO"] as USER_INFO_VIEWMODEL; ViewBag.INSTITUTE_INFO = Session["TPR_INS_INFO"] as INSTITUTE_INFO_VIEWMODEL; ViewBag.PROJECT_INSTITITE = project_ins; return(View()); }