protected void SetQRCode(JinianNet.JNTemplate.TemplateContext context, string id) { QRCode qr = new QRCode(); ModuleField moduleFieldQRCodeType = this.ModuleFields.FirstOrDefault(f => f.Code == "QRCodeType"); ModuleField moduleFieldQRCodeUrl = this.ModuleFields.FirstOrDefault(f => f.Code == "QRCodeUrl"); string url = "http://www.vgo2013.com/WebService/QR.aspx"; if (moduleFieldQRCodeUrl != null) { url = moduleFieldQRCodeUrl.Value; } if (moduleFieldQRCodeType != null && moduleFieldQRCodeType.Value == "ImageQRCode") { context.TempData["qrcode"] = qr.GetImageQRCode(url + "?ID=" + id); } else { context.TempData["qrcode"] = qr.GetQRCode(url + "?ID=" + id); } }