// GET: COPR16_WORKFLOW/Edit/5 public async Task <ActionResult> Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } COPR16_WORKFLOW cOPR16_WORKFLOW = await db.COPR16_WORKFLOW.FindAsync(id); WrkFlwModel model = new WrkFlwModel(db); model.cOPR16_WORKFLOW = cOPR16_WORKFLOW; model.cOPR16_WORKFLOW_DT = new COPR16_WORKFLOW_DT(); string SQL = "SELECT * FROM dbo.COPR16_WORKFLOW_DT WHERE WRK_ID = '" + id + "' ORDER BY CAST(WRKD_SEQ AS INT)"; //model.cOPR16_WORKFLOW_DT_List = await db.COPR16_WORKFLOW_DT.Where(l => l.WRK_ID.Equals(id)).OrderBy(l=>l.WRKD_SEQ) .ToListAsync(); model.cOPR16_WORKFLOW_DT_List = await db.COPR16_WORKFLOW_DT.SqlQuery(SQL).ToListAsync(); model.WRK_DESC = "count : " + model.cOPR16_WORKFLOW_DT_List.Count().ToString(); if (cOPR16_WORKFLOW == null) { return(HttpNotFound()); } return(View(model)); }
// GET: COPR16_WORKFLOW/Create public ActionResult Create() { WrkFlwModel model = new WrkFlwModel(db); model.cOPR16_WORKFLOW = new COPR16_WORKFLOW(); model.cOPR16_WORKFLOW_DT = new COPR16_WORKFLOW_DT(); model.cOPR16_WORKFLOW_DT_List = new List <COPR16_WORKFLOW_DT>(); return(View(model)); }