Example #1
0
 private void Update()
 {
     if (sucEncode)
     {
         sucEncode = false;
         trans_qrcode.gameObject.SetActive(true);
         trans_qrcode.GetComponent <RawImage>().texture = QRManager.Encode(@"https://h5.btech.cc/" + UserModel.Ins.lineid + "/index.html?i=" + fileName, 226, 226);
     }
 }
Example #2
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Example #3
0
        public JsonResult RequestQRCode(QRManager qRManager)
        {
            string idUser = this.GetIdUser();

            if (idUser == null)
            {
                return(Json(new ResultOfRequest(false, "Không tồn tại người dùng!")));
            }
            qRManager.idUserRequest = idUser;
            ProductDAO dao    = new ProductDAO();
            var        result = dao.RequestQRCode(qRManager);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Example #4
0
 public void ChangeReceiveQR()
 {
     using (IQBContent db = new IQBContent())
     {
         //var list = db.DBQRUser.Where(a => a.QRType == QRReceiveType.Small).ToList();
         var list = db.DBQRUser.Where(a => a.QRType == QRReceiveType.Small && a.OpenId == "o3nwE0jrONff65oS-_W96ErKcaa0").ToList();
         foreach (EQRUser qr in list)
         {
             string  openId   = qr.OpenId;
             EQRUser updateQr = QRManager.CreateUserUrlById(qr);
         }
         db.SaveChanges();
     }
 }
Example #5
0
        public ResultOfRequest RequestQRCode(QRManager qRManager)
        {
            var old = Model.QRManagers.FirstOrDefault(f => f.idProduct == qRManager.idProduct);

            if (old != null)
            {
                return(new ResultOfRequest(false, "Đã gửi yêu cầu, vui lòng chờ quản trị viên xem xét!"));
            }
            qRManager.isDeleted   = 0;
            qRManager.linkImg     = "";
            qRManager.accepted    = 0;
            qRManager.dateCreated = DateTime.Today;
            qRManager.dateUpdated = DateTime.Today;
            if (qRManager.amount == null || qRManager.amount < 0)
            {
                qRManager.amount = 100;
            }
            Model.QRManagers.Add(qRManager);
            if (Model.SaveChanges() > 0)
            {
                return(new ResultOfRequest(true, "Gửi yêu cầu thành công!"));
            }
            return(new ResultOfRequest(false, "Lỗi gửi yêu cầu, vui lòng thử lại!"));
        }