public async Task <ActionResult> EditAsync(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BTechChecklist item = await DocumentDBRepository.GetItemAsync <BTechChecklist>(id); var j = await DocumentDBRepository.GetItemAsync <Job>(JobInstanceId); ViewBag.Job = j; string bm = (string)Session["BridgeModule"]; ViewBag.LMainProdType = await DocumentDBRepository.GetItemsAsync <BList>(d => d.Tag == "BList" && d.BridgeModule == bm && d.ListType == "MainProdType"); ViewBag.LSubProdType = await DocumentDBRepository.GetItemsAsync <BList>(d => d.Tag == "BList" && d.BridgeModule == bm && d.ListType == "SubProdType"); if (item == null) { return(HttpNotFound()); } return(View(item)); }
public async Task <ActionResult> EditAsync([Bind(Include = "Tag,Id,BridgeModule,BookMarkName,Description,Formula,Condition,ItemNo," + "TemplateName,MainProdType,SubProdType,Uk,Subject,RuleRef,MEDItemNo,GudianceNote,Chapter")] BTechChecklist item) { if (ModelState.IsValid) { await DocumentDBRepository.UpdateItemAsync <BTechChecklist>(item.Id, item); return(RedirectToAction("Index")); } return(View(item)); }
public async Task <string> SaveBTCItem(string itemId, string Subject, string SubProdType, string GudianceNote, string RuleRef, string Condition) { BTechChecklist btc = await DocumentDBRepository.GetItemAsync <BTechChecklist>(itemId); btc.Subject = Subject; btc.SubProdType = SubProdType; btc.GudianceNote = GudianceNote; btc.RuleRef = RuleRef; btc.Condition = Condition; await DocumentDBRepository.UpdateItemAsync <BTechChecklist>(btc.Id, btc); return("Saved"); }
public async Task <ActionResult> CreateAsync() { string bm = (string)Session["BridgeModule"]; ViewBag.LMainProdType = await DocumentDBRepository.GetItemsAsync <BList>(d => d.Tag == "BList" && d.BridgeModule == bm && d.ListType == "MainProdType"); ViewBag.LSubProdType = await DocumentDBRepository.GetItemsAsync <BList>(d => d.Tag == "BList" && d.BridgeModule == bm && d.ListType == "SubProdType"); ViewBag.Job = await DocumentDBRepository.GetItemAsync <Job>(JobInstanceId); var S = new BTechChecklist(); S.BridgeModule = bm; S.MainProdType = "Life-Saving appliances"; return(View(S)); }