public ActionResult UploadTemplateImage(Guid AccountID, Guid TemplateID, HttpPostedFileBase fileData)
        {
            if (fileData != null)
            {
                try
                {
                    Account_QRCode_Template_BLL bll = new Account_QRCode_Template_BLL();



                    Account_QRCode_Template aqt = new Account_QRCode_Template();
                    aqt.ATID       = Guid.NewGuid();
                    aqt.AccountID  = AccountID;
                    aqt.TemplateID = TemplateID;
                    aqt.CreateTime = DateTime.Now;
                    //bll.Add(aqt);


                    byte[] buffer = new byte[fileData.ContentLength];
                    fileData.InputStream.Read(buffer, 0, fileData.ContentLength);

                    Stream stream = new MemoryStream(buffer);

                    string key = "qrcodebgimg/" + Guid.NewGuid().ToString() + Path.GetExtension(fileData.FileName);
                    if (QiNiuHelper.PutFile(ConfigurationManager.AppSettings["QiNiuBucket"].ToString().Trim(), key, stream))
                    {
                        //if (aqt.QRCodeBgImg != null)
                        //{
                        //    QiNiuHelper.Delete(ConfigurationManager.AppSettings["QiNiuBucket"].ToString().Trim(), aqt.QRCodeBgImg);
                        //}



                        aqt.QRCodeBgImg = key;

                        bll.Add(aqt);

                        string filename = Path.GetFileName(fileData.FileName);
                        string fileurl  = ConfigurationManager.AppSettings["QiNiuDomain"] + key;
                        return(Json(new { Success = true, FileName = filename, SaveName = fileurl }));
                    }
                    else
                    {
                        return(Json(new { Success = false, Message = "上传失败,请稍后再试!" }));
                    }
                }
                catch (Exception ex)
                {
                    return(Json(new { Success = false, Message = ex.Message }, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                return(Json(new { Success = false, Message = "请选择要上传的文件!" }, JsonRequestBehavior.AllowGet));
            }
        }
        public ActionResult ConfirmTemplate(Guid AccountID, Guid TemplateID)
        {
            Account_QRCode_Template_BLL bll = new Account_QRCode_Template_BLL();
            Account_QRCode_Template     aqt = new Account_QRCode_Template();

            aqt.ATID       = Guid.NewGuid();
            aqt.AccountID  = AccountID;
            aqt.TemplateID = TemplateID;
            aqt.CreateTime = DateTime.Now;
            bll.Add(aqt);
            return(RedirectToAction("SetQRCodeBgImg", new { ATID = aqt.ATID }));
        }