示例#1
0
        private void ShowContent(DataRow row)
        {
            string contexts = "";

            if (row["CONTENT"] != null && row["CONTENT"] != DBNull.Value)
            {
                // byte[] value = Convert.FromBase64String(row["CONTENT"].ToString());
                byte[] value = (byte[])row["CONTENT"];
                ////读取blob
                //contexts = Encoding.Default.GetString(value);
                //contexts = Convert.ToBase64String(value);
                contexts = Encoding.Unicode.GetString(value);
                //解密Blob的字符串

                contexts = DesSecurity.Decrypt(contexts); //StringHelper.Base64Decode(contexts);//
            }

            string contextsCopy = contexts;
            string AcsAddress   = ApplicationConfiguration.AcsAddress;

            contextsCopy = contextsCopy.Replace("../upload/", AcsAddress + "/upload/");

            lbDrugName.Text = txtKeyWords.Text;

            SetContext(contextsCopy);
        }
示例#2
0
    int getIntValueFromDecodedString(string decodedString)
    {
        string s   = DesSecurity.DesDecrypt(decodedString, DECODED_KEY);
        int    num = 0;

        int.TryParse(s, out num);
        return(num);
    }
示例#3
0
        public void DecryptFileTest()
        {
            string inFilePath  = string.Empty;
            string outFilePath = string.Empty;
            string sDecrKey    = string.Empty;

            DesSecurity.DecryptFile(inFilePath, outFilePath, sDecrKey);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
示例#4
0
 protected void BindDate()
 {
     M_PostConfig       = Post.GetConfig(PhyFilePath);
     this.txtEmail.Text = M_PostConfig.Email;
     //this.txtPassword.Text = M_PostConfig.Password;
     this.txtPassword.Attributes.Add("value", DesSecurity.DesDecrypt(M_PostConfig.Password, "emailpwd"));
     this.txtSmtpServer.Text = M_PostConfig.SmtpServer;
     this.txtPort.Text       = M_PostConfig.Port;
 }
示例#5
0
 public void DecoderBytesTest()
 {
     byte[] value    = null;
     byte[] key      = null;
     byte[] vector   = null;
     byte[] expected = null;
     byte[] actual;
     actual = DesSecurity.DecoderBytes(value, key, vector);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("验证此测试方法的正确性。");
 }
示例#6
0
 static WSHelper()
 {
     try
     {
         //»ñÈ¡WebServiceÃÜÂë
         SPassword = System.Configuration.ConfigurationManager.AppSettings["WSPassword"].ToString();
         SPassword = DesSecurity.Decrypt(SPassword);
     }
     catch
     { }
 }
示例#7
0
        public void DecryptStringTest()
        {
            string decryptString = string.Empty;
            string decryptKey    = string.Empty;
            string expected      = string.Empty;
            string actual;

            actual = DesSecurity.DecryptString(decryptString, decryptKey);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DesSecurity des = new DesSecurity();
            //Kiểm tra Vietnamobile
            int    is3g   = 0;
            string msisdn = MobileUtils.GetMSISDN(out is3g);
            //string msisdn = MobileUtils.GetMSISDN();

            //if (String.IsNullOrEmpty(msisdn) && Session["msisdn"] == null)
            //    msisdn = MobileUtils.GetVietnamobileMsisdn();
            int partnerId = ConvertUtility.ToInt32(Request.QueryString["partnerid"]);

            log.Info("partnerId: " + partnerId);


            if (!string.IsNullOrEmpty(msisdn) && MobileUtils.CheckOperator(msisdn, "vietnammobile"))
            {
                log.Info("msisdn: " + msisdn);
                if (partnerId == 0)
                {
                    Response.Redirect("http://payment.xzone.vn/sc.aspx?link=" + des.Des3Encrypt("4|" + msisdn + "||", ConfigurationSettings.AppSettings.Get("msisdnkey")));
                }
                else
                {
                    try
                    {
                        DataTable dtPartner      = DBController.Partner_GetInfo(partnerId);
                        string    vTransactionID = DBController.Transaction_Online_Insert(msisdn, 4, partnerId, "", "");

                        string url = "http://" + dtPartner.Rows[0]["Domain"].ToString() +
                                     dtPartner.Rows[0]["URL"].ToString() + "?p=" +
                                     des.Des3Encrypt(msisdn + "|4|" + vTransactionID,
                                                     dtPartner.Rows[0]["KeyCode"].ToString());

                        log.Info("Url Response : " + url);


                        Response.Redirect("http://" + dtPartner.Rows[0]["Domain"].ToString() + dtPartner.Rows[0]["URL"].ToString() + "?p=" + des.Des3Encrypt(msisdn + "|4|" + vTransactionID, dtPartner.Rows[0]["KeyCode"].ToString()), false);
                    }
                    catch (Exception ex)
                    {
                        log.Info("Ex Response : " + ex.Message + "|" + ex.StackTrace);
                    }
                }
            }
            else
            {
                DataTable dtPartner = DBController.Partner_GetInfoHasCache(partnerId);
                Response.Redirect("http://" + dtPartner.Rows[0]["Domain"].ToString() + dtPartner.Rows[0]["URL"].ToString() + "?p=" + des.Des3Encrypt("||", dtPartner.Rows[0]["KeyCode"].ToString()), false);


                //Response.Redirect("http://payment.xzone.vn/sc.aspx?link=" + des.Des3Encrypt("0|||", ConfigurationSettings.AppSettings.Get("msisdnkey")));
            }
        }
示例#9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                logger.Debug("------------- wapPayment4APP Vietnamobile ------------------");
                DesSecurity des = new DesSecurity();
                try
                {
                    string cipher     = ConvertUtility.ToString(Request.QueryString["link"]);
                    string price      = string.Empty;
                    string msisdn     = string.Empty;
                    string itemid     = string.Empty;
                    string itemtype   = string.Empty;
                    string itemdetail = string.Empty;
                    string partnerid  = string.Empty;
                    MobileUtils.GetDetailAppUrl(des.Des3Decrypt(cipher, ConfigurationSettings.AppSettings.Get("msisdnkey")), ref partnerid, ref price, ref itemid, ref itemtype, ref itemdetail);

                    //Kiểm tra Vinaphone
                    string alertMessage = string.Empty;

                    int is3g = 0;
                    //string msisdn = MobileUtils.GetMSISDN(out is3g);
                    msisdn = MobileUtils.GetMSISDN(out is3g);

                    logger.Debug("msisdn=" + msisdn);
                    //Nhận diện được MSISDN >> form xác thực yêu cầu thanh toán
                    if (!string.IsNullOrEmpty(msisdn) && MobileUtils.CheckOperator(msisdn, "vietnammobile"))
                    {
                        Session["_price"]      = price;
                        Session["_msisdn"]     = msisdn;
                        Session["_itemid"]     = itemid;
                        Session["_itemtype"]   = itemtype;
                        Session["_itemdetail"] = itemdetail;
                        Session["_partnerid"]  = partnerid;
                        ltrMSISDN.Text         = "Xin chào " + msisdn + "<br /><b>Nạp VKIM</b>";
                        ltrTB.Text             = "Phí nạp VKIM là " + price + " đồng. Vui lòng xác nhận để thực hiện giao dịch.";
                        pnlXacnhan.Visible     = true;
                    }
                    else
                    {
                        Response.Redirect("http://payment.xzone.vn/atc.aspx?link=END", false);
                        HttpContext.Current.ApplicationInstance.CompleteRequest();
                    }
                }
                catch (Exception ex)
                {
                    logger.Debug("Exception=" + ex.ToString());
                    Response.Redirect("http://payment.xzone.vn/atc.aspx?link=END", false);
                    HttpContext.Current.ApplicationInstance.CompleteRequest();
                }
            }
        }
示例#10
0
        public void DecoderStringByKeyTest()
        {
            string   textValue    = string.Empty;
            Encoding textEncoding = null;

            byte[] key      = null;
            byte[] vector   = null;
            string expected = string.Empty;
            string actual;

            actual = DesSecurity.DecoderStringByKey(textValue, textEncoding, key, vector);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
示例#11
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (IsHaveRightByOperCode("Edit"))
     {
         M_PostConfig.Email      = this.txtEmail.Text;
         M_PostConfig.Password   = DesSecurity.DesEncrypt(this.txtPassword.Text, "emailpwd");
         M_PostConfig.SmtpServer = this.txtSmtpServer.Text;
         M_PostConfig.Port       = this.txtPort.Text;
         Post.ConfigInfo         = M_PostConfig;
         bool   b           = Post.SaveConfig(PhyFilePath);
         string memberValue = "0";
         string mailValue   = "0";
         if (chkIsMember.Checked)
         {
             memberValue = "1";
         }
         if (chkIsEmail.Checked)
         {
             mailValue = "1";
         }
         bool b1 = Utils.XmlUpdate(hrFilePath, "HRConfig/IsMember", "", memberValue);
         bool b2 = Utils.XmlUpdate(hrFilePath, "HRConfig/IsSendToEmail", "", mailValue);
         Utils.XmlUpdate(hrFilePath, "HRConfig/EMailTitle", "", txtEMailTitle.Text);
         Utils.XmlCDATAUpdate(hrFilePath, "HRConfig/EMailContent", txtEMailContent.Content);
         if (!b)
         {
             Utils.RunJavaScript(this, "alert({msg:'设置失败," + PhyFilePath.Replace("\\", "\\\\") + "文件没有修改权限!',status: '2', title: '提示信息', time: 10000, width: 400})");
             return;
         }
         if (!b1)
         {
             Utils.RunJavaScript(this, "alert({msg:'设置失败," + hrFilePath.Replace("\\", "\\\\") + "文件没有修改权限!',status: '2', title: '提示信息', time: 10000, width: 400})");
             return;
         }
         WriteLog("人力资源参数设置成功!", "", 2);
         Utils.RunJavaScript(this, "alert({msg:'设置成功!',title:'提示信息'})");
     }
     else
     {
         Utils.RunJavaScript(this, "alert({msg:'你没有设置的权限,请联系站点管理员!',title:'提示信息'})");
     }
 }
示例#12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DesSecurity des = new DesSecurity();
            //Kiểm tra Vietnamobile
            int    is3g   = 0;
            string msisdn = MobileUtils.GetMSISDN(out is3g);
            //string msisdn = MobileUtils.GetMSISDN();

            //if (String.IsNullOrEmpty(msisdn) && Session["msisdn"] == null)
            //    msisdn = MobileUtils.GetVietnamobileMsisdn();

            string t = Request.QueryString["t"];

            if (!string.IsNullOrEmpty(msisdn) && MobileUtils.CheckOperator(msisdn, "vietnammobile"))
            {
                Response.Redirect(AppEnv.GetSetting("vsporturl") + des.Des3Encrypt("4|" + msisdn + "||", AppEnv.GetSetting("msisdnkey")) + "&t=" + t);
            }
            else
            {
                Response.Redirect(AppEnv.GetSetting("vsporturl") + des.Des3Encrypt("0|||", AppEnv.GetSetting("msisdnkey")) + "&t=" + t);
            }
        }
示例#13
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (IsHaveRightByOperCode("Edit"))
     {
         M_PostConfig.Email      = this.txtEmail.Text;
         M_PostConfig.Password   = DesSecurity.DesEncrypt(this.txtPassword.Text, "emailpwd");
         M_PostConfig.SmtpServer = this.txtSmtpServer.Text;
         M_PostConfig.Port       = this.txtPort.Text;
         Post.ConfigInfo         = M_PostConfig;
         bool b = Post.SaveConfig(PhyFilePath);
         if (!b)
         {
             Utils.RunJavaScript(this, "alert({msg:'站点信息设置失败," + PhyFilePath.Replace("\\", "\\\\") + "文件没有修改权限!',status: '2', title: '提示信息', time: 10000, width: 400})");
             return;
         }
         WriteLog("邮件参数设置成功!", "", 2);
         Utils.RunJavaScript(this, "alert({msg:'邮件参数设置成功!',title:'提示信息'})");
     }
     else
     {
         Utils.RunJavaScript(this, "alert({msg:'你没有修改邮箱设置的权限,请联系站点管理员!',title:'提示信息'})");
     }
 }
示例#14
0
        protected void BindDate()
        {
            M_PostConfig       = Post.GetConfig(PhyFilePath);
            this.txtEmail.Text = M_PostConfig.Email;
            //this.txtPassword.Text = M_PostConfig.Password;
            this.txtPassword.Attributes.Add("value", DesSecurity.DesDecrypt(M_PostConfig.Password, "emailpwd"));
            this.txtSmtpServer.Text = M_PostConfig.SmtpServer;
            this.txtPort.Text       = M_PostConfig.Port;

            string memberValue = Utils.XmlRead(hrFilePath, "HRConfig/IsMember", "");
            string mailValue   = Utils.XmlRead(hrFilePath, "HRConfig/IsSendToEmail", "");

            txtResumeDetailFilePath.Value = Utils.XmlRead(hrFilePath, "HRConfig/ResumeDetailFilePath", "");
            txtEMailTitle.Text            = Utils.XmlRead(hrFilePath, "HRConfig/EMailTitle", "").Replace("{SiteName}", siteName);
            txtEMailContent.Content       = Utils.XmlRead(hrFilePath, "HRConfig/EMailContent", "").Replace("{SiteName}", siteName);
            if (memberValue == "1")
            {
                chkIsMember.Checked = true;
            }
            if (mailValue == "1")
            {
                chkIsEmail.Checked = true;
            }
        }
示例#15
0
 static WSInfo()
 {
     WsURL     = System.Configuration.ConfigurationManager.AppSettings["WSAddress"].ToString();
     SPassword = System.Configuration.ConfigurationManager.AppSettings["WSPassword"].ToString();
     SPassword = DesSecurity.Decrypt(SPassword);
 }
示例#16
0
        /// <summary>
        /// 保存日志:[email protected]
        /// </summary>
        /// <param Name="Content">日志内容</param>
        /// <param Name="PostContent">提交内容</param>
        /// <param Name="LogType">日志类型,1=登录日志,2=操作日志,3=错误日志</param>
        public void WriteLog(string Content, string PostContent, int LogType)
        {
            string ip         = Utils.GetIP();                                                                                                                  //IP地址
            string ScriptName = HttpContext.Current.Request.ServerVariables["SCRIPT_NAME"] + "?" + HttpContext.Current.Request.ServerVariables["QUERY_STRING"]; //提交的页面地址
            //string ScriptName = HttpContext.Current.Request.Url.ToString (); //提交的页面地址
            //int urlNum = ScriptName.IndexOf(HttpContext.Current.Request.ServerVariables["SCRIPT_NAME"]);
            //if (urlNum > 0)
            //    ScriptName = ScriptName.Substring(urlNum);

            SiteParamConfig pci = SiteParam.GetConfig(GetSiteParamPath);

            if (pci.LogType == "0")  //保存到数据库
            {
                KingTop.Model.SysManage.SysLog objlog    = new KingTop.Model.SysManage.SysLog();
                KingTop.BLL.SysManage.SysLog   objBllLog = new KingTop.BLL.SysManage.SysLog();
                objlog.IP      = ip;
                objlog.Content = Content;
                objlog.LogType = LogType;

                // objlog.NodeId = NodeId;

                objlog.NodeCode = NodeCode;

                objlog.PostContent = PostContent;
                objlog.ScriptName  = ScriptName;
                objlog.SiteID      = SiteID;
                objlog.UserNo      = UserNo;
                objBllLog.Save("NEW", objlog);
            }
            else  //保存到文件
            {
                string       logPath  = pci.LogDir;
                StreamWriter sw       = null;
                DateTime     date     = DateTime.Now;
                string       FileName = date.Year + "-" + date.Month;
                if (logPath.IndexOf(":") == -1)     //相对路径
                {
                    if (logPath.Trim().Length == 0) //路径为空
                    {
                        logPath = "Logs";
                    }
                    logPath = HttpContext.Current.Server.MapPath("~/" + logPath);
                }

                try
                {
                    FileName = logPath + "/" + UserNo + "_" + FileName + "-" + DesSecurity.DesEncrypt(FileName, "hqbonline") + "-s.log";

                    #region 检测日志目录是否存在

                    if (!Directory.Exists(logPath))
                    {
                        Directory.CreateDirectory(logPath);
                    }

                    if (!File.Exists(FileName))
                    {
                        sw = File.CreateText(FileName);
                    }
                    else
                    {
                        sw = File.AppendText(FileName);
                    }
                    #endregion

                    sw.WriteLine("[NodeCode]       :" + NodeCode + "\r");
                    sw.WriteLine("[SiteID]       :" + SiteID + "\r");
                    sw.WriteLine("[Content]      :" + Content);
                    sw.WriteLine("[AddDate]      :" + date.ToString("yyyy-MM-dd hh:mm:ss") + "\r");
                    sw.WriteLine("[UserNo]       :" + UserNo + "\r");
                    sw.WriteLine("[IP]           :" + ip + "\r");
                    sw.WriteLine("[ScriptName]   :" + ScriptName + "\r");
                    sw.WriteLine("[PostContent]  :" + PostContent + "\r");
                    sw.WriteLine("[LogType]      :" + LogType + "\r");
                    sw.WriteLine("≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡\r");
                    sw.Flush();
                }
                finally
                {
                    if (sw != null)
                    {
                        sw.Close();
                    }
                }
            }
        }
    public IEnumerator send()
    {
        string jsonContent = _data.toJson();

        string encodedJson = jsonContent;

        if (_formKey == "data")
        {
            encodedJson = DesSecurity.DesEncrypt(jsonContent, encoded_key);
        }

        WWWForm form = new WWWForm();

        form.AddField("deviceId", getDeviceID());
        form.AddField("openId", getOpenID());
        form.AddField(_formKey, encodedJson);

        if (_formKey == "data" && _data != null && _data.ContainsKey("cmd"))
        {
            form.AddField("cmd", _data["cmd"].ToString());
        }
        else
        {
            form.AddField("cmd", "bi");
        }

        //form.AddField("debug", "1");
        form.AddField("auth", _authCode.ToString());

        int userID = getUserID();

        if (userID != -1)
        {
            form.AddField("userId", userID.ToString());
        }

        string serverUrl = _formKey == "data" ? AppSettings.gameServerUrl : AppSettings.biServerUrl;

        WWW getData = new WWW(serverUrl, form);

        yield return(getData);

        if (getData.error == null)
        {
            //string result = getData.text;
            string result = DesSecurity.DesDecrypt(getData.text, encoded_key);

            // Cache UID
            Dictionary <string, object> dataDict = result.dictionaryFromJson();
            if (dataDict != null && dataDict.ContainsKey("userId"))
            {
                int uid = Convert.ToInt32(dataDict["userId"]);
                Debug.Log("Cache User ID: " + uid.ToString());
                setUserID(uid);
            }

            // verify auth code
            bool verifyOK = true;
            if (dataDict.ContainsKey("auth"))
            {
                int returnAuthCode = Convert.ToInt32(dataDict["auth"]);
                if (returnAuthCode != _authCode)
                {
                    verifyOK = false;
                }
            }

            if (dataDict.ContainsKey("cheat"))
            {
                int cheat = Convert.ToInt32(dataDict["cheat"]);
                PlayerPrefs.SetInt("cheat", cheat);
            }

            if (verifyOK && _successDelegate != null && dataDict.ContainsKey("data"))
            {
                Dictionary <string, object> dict = dataDict["data"] as Dictionary <string, object>;
                _successDelegate(dict.toJson());
            }
            else if (!verifyOK && _failDelgate != null)
            {
                _failDelgate();
            }

            Destroy(this.gameObject);
        }
        else
        {
            if (_failDelgate != null)
            {
                _failDelgate();
            }
            Debug.Log(getData.error);

            Destroy(this.gameObject);
        }
    }
示例#18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string partnerid = string.Empty;

            try
            {
                DesSecurity des   = new DesSecurity();
                string      token = des.Des3Decrypt(Request.QueryString["c"], AppEnv.GetSetting("msisdnkey"));

                logger.Debug("token =" + token);
                logger.Debug("c =" + Request.QueryString["c"]);

                DataTable dtTrans = DBController.Transaction_Online_GetByToken(token);
                if (dtTrans != null && dtTrans.Rows.Count > 0)
                {
                    //logger.Debug("dtTrans.Rows.Count =" + dtTrans.Rows.Count);

                    int    status       = 1;
                    string debit_status = string.Empty;
                    string strType      = Constant.pmContentTypeVNM[ConvertUtility.ToInt32(dtTrans.Rows[0]["ItemType"])];

                    partnerid = dtTrans.Rows[0]["PartnerID"].ToString();
                    WapXzone_VNM.Library.VNMCharging.VNMChargingGW charging = new WapXzone_VNM.Library.VNMCharging.VNMChargingGW();

                    string productId  = string.Empty;
                    string productKey = string.Empty;

                    string price = dtTrans.Rows[0]["Price"].ToString();

                    if (strType == "TEXT")
                    {
                        if (price == "1000")
                        {
                            productId  = "RELAXSTORYREAD";
                            productKey = "READ";
                        }
                        else if (price == "15000")
                        {
                            productId  = "RELAXSTORYMONTHLY";
                            productKey = "READ_MONTHLY";
                        }
                        else if (price == "2000")
                        {
                            productId  = "RELAXLOVER";
                            productKey = "LOVER";
                        }
                        else if (price == "3000")
                        {
                            productId  = "RELAXPLACE";
                            productKey = "PLACE";
                        }
                        else if (price == "5000")
                        {
                            productId  = "RELAXADVISESEX";
                            productKey = "ADVISE_SEX";
                        }
                    }
                    else if (strType == "WP")
                    {
                        productId  = "PICDOWN";
                        productKey = "PIC_DOWN";
                    }
                    else if (strType == "TT")
                    {
                        productId  = "FOOTBALLSUMARY";
                        productKey = "FOOTBALL_SUMARY";
                    }
                    else if (strType == "JG")
                    {
                        productId  = "GAMEDOWN";
                        productKey = "GAME_DOWN";
                    }
                    else if (strType == "APP")
                    {
                        productId  = "APPDOWN";
                        productKey = "APP_DOWN";
                    }
                    else if (strType == "VID")
                    {
                        productId  = "VIDEODOWN";
                        productKey = "VIDEO_DOWN";
                    }
                    else if (strType == "YKCG")
                    {
                        productId  = "FOOTBALLADVISE";
                        productKey = "FOOTBALL_ADVISE";
                    }
                    else if (strType == "TIP")
                    {
                        productId  = "FOOTBALLADVISE";
                        productKey = "FOOTBALL_ADVISE";
                    }
                    else if (strType == "KQCHO")
                    {
                        productId  = "FOOTBALLRESULT";
                        productKey = "FOOTBALL_RESULT";
                    }
                    else if (strType == "KQXS")
                    {
                        productId  = "LOTOLASTRESULT";
                        productKey = "LAST_RESULT";
                    }
                    else if (strType == "SOICAU")
                    {
                        productId  = "LOTOSOICAU";
                        productKey = "SOICAU";
                    }
                    else if (strType == "XSKQCHO")
                    {
                        productId  = "LOTORESULT";
                        productKey = "RESULT";
                    }
                    else if (strType == "XOSO20")
                    {
                        productId  = "LOTORESULTMONTHLY";
                        productKey = "RESULTMONTHLY";
                    }
                    else if (strType == "RELAX")
                    {
                        productId  = "RELAXSTORYREAD";
                        productKey = "READ";
                    }
                    else if (strType == "GAME87")
                    {
                        productId  = "FOOTBALLADVISE";
                        productKey = "FOOTBALL_RESULT";
                    }
                    else if (strType == "Tu vi")
                    {
                        productId  = "HOROSCOPE";
                        productKey = "HOROSCOPE";
                    }

                    debit_status = charging.NavigatePaymentVnm(dtTrans.Rows[0]["msisdn"].ToString(), productId, productKey, price, "D", strType, UnicodeUtility.RemoveSpecialCharacter(UnicodeUtility.UnicodeToKoDau(dtTrans.Rows[0]["ItemDetail"].ToString())));

                    //debit_status = charging.PaymentVNM(dtTrans.Rows[0]["msisdn"].ToString(),productId,productKey);
                    if (!string.IsNullOrEmpty(debit_status) && debit_status == "1")
                    {
                        // Thanh toán thành công >> trả nội dung
                        status = 0;
                    }

                    //logger.Debug("debit_status =" + debit_status);

                    //Tạo Transaction_Online mới
                    string vTransactionID = DBController.Transaction_Online_Insert(dtTrans.Rows[0]["msisdn"].ToString(), 4, ConvertUtility.ToInt32(partnerid), "", "");
                    //Ghi Transaction, Transaction_Log, xoá Transaction_Online cũ
                    DBController.Transaction_Insert_New(dtTrans.Rows[0]["ItemID"].ToString(), dtTrans.Rows[0]["ItemDetail"].ToString(), ConvertUtility.ToInt32(dtTrans.Rows[0]["ItemType"]),
                                                        dtTrans.Rows[0]["msisdn"].ToString(), 4, 0, ConvertUtility.ToInt32(dtTrans.Rows[0]["Price"]), ConvertUtility.ToInt32(partnerid),
                                                        ConvertUtility.ToDecimal(dtTrans.Rows[0]["TransactionID"]), ConvertUtility.ToDateTime(dtTrans.Rows[0]["Created"]), "debit_status: " + debit_status, status);
                    WapController.Transaction_Online_Delete(dtTrans.Rows[0]["msisdn"].ToString());

                    //Trả kết quả qua URL
                    if (status == 0)
                    {
                        if (AppEnv.GetSetting("ExceptPartner").IndexOf("|" + ConvertUtility.ToString(dtTrans.Rows[0]["PartnerID"]) + "|") > -1)
                        {
                            logger.Debug("http://" + dtTrans.Rows[0]["Domain"].ToString() + dtTrans.Rows[0]["CallBackUrl"].ToString() + "?&p=" + des.Des3Encrypt(dtTrans.Rows[0]["msisdn"].ToString() + "|1|" + vTransactionID + "|" + dtTrans.Rows[0]["TransactionID"].ToString(), dtTrans.Rows[0]["KeyCode"].ToString()));

                            Response.Redirect(@"http://" + dtTrans.Rows[0]["Domain"].ToString() + dtTrans.Rows[0]["CallBackUrl"].ToString() + "?&p=" + des.Des3Encrypt(dtTrans.Rows[0]["msisdn"].ToString() + "|1|" + vTransactionID + "|" + dtTrans.Rows[0]["TransactionID"].ToString(), dtTrans.Rows[0]["KeyCode"].ToString()), false);
                            //HttpContext.Current.ApplicationInstance.CompleteRequest();
                            return;
                        }
                        else
                        {
                            logger.Debug("http://" + dtTrans.Rows[0]["Domain"].ToString() + dtTrans.Rows[0]["CallBackUrl"].ToString() + "?p=" + des.Des3Encrypt(dtTrans.Rows[0]["msisdn"].ToString() + "|1|" + vTransactionID + "|" + dtTrans.Rows[0]["TransactionID"].ToString(), dtTrans.Rows[0]["KeyCode"].ToString()));
                            if (dtTrans.Rows[0]["CallBackUrl"].ToString().IndexOf("?") > -1)
                            {
                                Response.Redirect(@"http://" + dtTrans.Rows[0]["Domain"].ToString() + dtTrans.Rows[0]["CallBackUrl"].ToString() + "&p=" + des.Des3Encrypt(dtTrans.Rows[0]["msisdn"].ToString() + "|1|" + vTransactionID + "|" + dtTrans.Rows[0]["TransactionID"].ToString(), dtTrans.Rows[0]["KeyCode"].ToString()), false);
                            }
                            else
                            {
                                Response.Redirect(@"http://" + dtTrans.Rows[0]["Domain"].ToString() + dtTrans.Rows[0]["CallBackUrl"].ToString() + "?p=" + des.Des3Encrypt(dtTrans.Rows[0]["msisdn"].ToString() + "|1|" + vTransactionID + "|" + dtTrans.Rows[0]["TransactionID"].ToString(), dtTrans.Rows[0]["KeyCode"].ToString()), false);
                            }
                            //HttpContext.Current.ApplicationInstance.CompleteRequest();
                            return;
                        }
                    }
                    else
                    {
                        if (dtTrans.Rows[0]["CallBackUrl"].ToString().IndexOf("?") > -1)
                        {
                            Response.Redirect("http://" + dtTrans.Rows[0]["Domain"].ToString() + dtTrans.Rows[0]["CallBackUrl"].ToString() + "&p=" + des.Des3Encrypt(dtTrans.Rows[0]["msisdn"].ToString() + "|-1|" + vTransactionID + "|" + dtTrans.Rows[0]["TransactionID"].ToString(), dtTrans.Rows[0]["KeyCode"].ToString()), false);
                        }
                        else
                        {
                            Response.Redirect("http://" + dtTrans.Rows[0]["Domain"].ToString() + dtTrans.Rows[0]["CallBackUrl"].ToString() + "?p=" + des.Des3Encrypt(dtTrans.Rows[0]["msisdn"].ToString() + "|-1|" + vTransactionID + "|" + dtTrans.Rows[0]["TransactionID"].ToString(), dtTrans.Rows[0]["KeyCode"].ToString()), false);
                        }
                    }
                }
                else
                {
                    Response.Redirect("http://payment.xzone.vn/e.aspx", false);
                }
            }
            catch (Exception ex)
            {
                logger.Debug("Exception=" + ex.ToString());
                Response.Redirect("http://payment.xzone.vn/e.aspx", false);
                //Response.Write(ex.ToString());
                //Response.Redirect("http://payment.xzone.vn/sc.aspx?pid=" + partnerid);
            }
        }