public ActionResult GetQr(int classId, bool isPromote = false, string replyText = "") { QrCodeView qrCodeView = null; if (string.IsNullOrEmpty(RouteChannelId)) { qrCodeView = _qrCodeService.GetDetail(classId); } else { qrCodeView = new QrCodeView(); qrCodeView.Id = 1; qrCodeView.WeChatPubId = SiteSection.Service.WeChatPubId; qrCodeView.Path = SiteSection.Html.WeChatQrCode; qrCodeView.UpdateTime = DateTime.Now.Date; } if (qrCodeView != null && qrCodeView.Id > 0) { qrCodeView.ReplyText = replyText; } var model = new SimpleResponse <QrCodeView>(qrCodeView != null && qrCodeView.Id > 0, qrCodeView); if (isPromote) { return(PartialView("/Views/QrCode/GetPromoteQr.cshtml", model)); } else { return(PartialView(model)); } }
public void EditDescription(QrCodeView model, string userName) { var old = this.Repository.Entities.Where(a => a.SceneId == model.SceneId && a.AppId == model.AppId && a.Deleted == false).FirstOrDefault(); if (old != null) { old.Description = model.Description; old.UpdatedDate = DateTime.Now; old.UpdatedUserID = userName; this.Repository.Update(old); } }
public QrCodeView GetDetail(int classId, int status = 1) { if (classId <= 0) { return(null); } QrCodeView qrCode = null; using (var conn = DbConnection(DbOperation.Read)) { var repo = new Repository.QrCodeRepo(conn); qrCode = repo.GetDetail(classId, status); } return(qrCode); }