public ActionResult InstDetail(int id) { var inst = FormInstanceManager.GetDbRecord(id); var model = System.Web.Helpers.Json.Decode <Dictionary <string, string> >(inst.Data); return(View(model)); }
public ActionResult ShowByFlowInst(int id, FormCollection collection, bool partial = false, bool showButton = true) { int formInstID = FormManager.GetFormInstanceOfFlowInstance(id); var formInst = FormInstanceManager.GetDbRecord(formInstID); var form = FormManager.GetDbRecord(formInst.FormID); var flowInst = FlowInstanceManager.GetDbRecord(formInst.FlowInstanceID); var layoutID = LayoutManager.GetLayoutOfFlowNode(flowInst.CurrentNodeID); var markup = layoutID == null ? form.Layout : LayoutManager.GetDbRecord(layoutID.Value).Markup; var data = System.Web.Helpers.Json.Decode <Dictionary <string, string> >(formInst.Data); data = data == null ? new Dictionary <string, string>() : data; collection.AllKeys.ForEach(x => data[x] = collection[x]); FormInstanceManager.UpdateDbRecord(formInstID, record => { record.Data = System.Web.Helpers.Json.Encode(data); }); TongJi.Web.Notifications.Notification.EnqueueMessage("表单数据已保存。"); ViewBag.partial = partial; ViewBag.showButton = showButton; ViewBag.Form = form; ViewBag.markup = markup; ViewBag.formInstID = formInstID; return(View("Show", data)); }
public ActionResult Preview(int id) { var inst = FormInstanceManager.GetDbRecord(id); var form = FormManager.GetDbRecord(inst.FormID); var data = System.Web.Helpers.Json.Decode <Dictionary <string, string> >(inst.Data); ViewBag.Form = form; ViewBag.Inst = inst; return(View(data)); }
public ActionResult Fill(Guid id, FormCollection collection) { var data = collection.AllKeys.ToDictionary(x => x, x => collection[x]); FormInstanceManager.New(id, System.Web.Helpers.Json.Encode(data), 0); TongJi.Web.Notifications.Notification.EnqueueMessage("表单数据已保存。"); var form = FormManager.GetDbRecord(id); ViewBag.Form = form; return(View(data)); }
public ActionResult Modify(int id, bool partial = false, bool showButton = true) { var inst = FormInstanceManager.GetDbRecord(id); var form = FormManager.GetDbRecord(inst.FormID); var data = System.Web.Helpers.Json.Decode <Dictionary <string, string> >(inst.Data); ViewBag.partial = partial; ViewBag.showButton = showButton; ViewBag.Form = form; ViewBag.Inst = inst; return(View(data)); }
public ActionResult ShowByID(Guid id, int flowInstID, bool partial = false, bool showButton = true) { int formInstID = FormManager.GetFormInstanceOfFlowInstance(flowInstID); var formInst = FormInstanceManager.GetDbRecord(formInstID); var form = FormManager.GetDbRecord(formInst.FormID); var markup = LayoutManager.GetDbRecord(id).Markup; ViewBag.partial = partial; ViewBag.showButton = showButton; ViewBag.Form = form; ViewBag.markup = markup; ViewBag.formInstID = formInstID; var data = System.Web.Helpers.Json.Decode <Dictionary <string, string> >(formInst.Data); return(View("Show", data)); }
public ActionResult ShowByFlowInst(int id, bool partial = false, bool showButton = true) { int formInstID = FormManager.GetFormInstanceOfFlowInstance(id); var formInst = FormInstanceManager.GetDbRecord(formInstID); var form = FormManager.GetDbRecord(formInst.FormID); var flowInst = FlowInstanceManager.GetDbRecord(formInst.FlowInstanceID); var layoutID = LayoutManager.GetLayoutOfFlowNode(flowInst.CurrentNodeID); var markup = layoutID == null ? form.Layout : LayoutManager.GetDbRecord(layoutID.Value).Markup; ViewBag.partial = partial; ViewBag.showButton = showButton; ViewBag.Form = form; ViewBag.markup = markup; ViewBag.formInstID = formInstID; var data = System.Web.Helpers.Json.Decode <Dictionary <string, string> >(formInst.Data); return(View("Show", data)); }
public ActionResult Modify(int id, FormCollection collection, bool partial = false, bool showButton = true) { var data = collection.AllKeys.ToDictionary(x => x, x => collection[x]); var inst = FormInstanceManager.GetDbRecord(id); var form = FormManager.GetDbRecord(inst.FormID); FormInstanceManager.UpdateDbRecord(id, record => { record.Data = System.Web.Helpers.Json.Encode(data); }); TongJi.Web.Notifications.Notification.EnqueueMessage("表单数据已保存。"); ViewBag.partial = partial; ViewBag.showButton = showButton; ViewBag.Form = form; ViewBag.Inst = inst; return(View(data)); }
public ActionResult InstDelete(int id) { FormInstanceManager.DeleteDbRecord(id); return(null); }
public ActionResult InstList(Guid?id) { var insts = id == null?FormInstanceManager.GetAllDbRecords() : FormInstanceManager.Query(x => x.FormID == id); return(View(insts)); }
public ActionResult Data(int id) { var inst = FormInstanceManager.GetDbRecord(id); return(Content(inst.Data, "application/json")); }