示例#1
0
    public string InvestViaPerfectMoney(int intUserID, string PerfectMoneyPayeerID, string strAmt, int intEpinTypeID, int intEpinCount, double dblEpinPrice, double dblTotPrice)
    {
        ArrayList arrResult = new ArrayList();
        clsWallet csWallet = new clsWallet();
        string    strResult = "";
        string    PerfectMoneyAc, PerfectMoneyPwd, ReciverPayeerID, strPayId;
        byte      b     = 0;
        string    strdt = csWallet.getAusCurDateTimeString();
        int       strPayin;
        Dictionary <string, string> d = new Dictionary <string, string>();

        PerfectMoneyAc  = "9573063";                   // ConfigurationManager.AppSettings["PMLoginID"];
        PerfectMoneyPwd = "35T5RE49bzVcPqoThyzkNWMZD"; // ConfigurationManager.AppSettings["PMPassPhrase"];
        ReciverPayeerID = "U14156621";                 // ConfigurationManager.AppSettings["PMPayee"];

        strPayin = 1;
        strPayId = csComm.GenrateRandomNumberString();

        d = obj.Transfer(PerfectMoneyAc, PerfectMoneyPwd, PerfectMoneyPayeerID, ReciverPayeerID, Convert.ToDouble(strAmt), Convert.ToInt32(strPayin), Convert.ToInt32(strPayId));
        foreach (var item in d)
        {
            if (item.Key == "ERROR")
            {
                strResult = item.Value;
                objOdbc.executeNonQuery("insert into mlm_perfectmoney_payment(userid,message,status) values('" + intUserID + "','" + strResult + "',2)");
                // CommonMessages.ShowAlertMessage(item.Value);
                // strResult = "Payment Fail!";
            }
            else
            {
                arrResult.Add(item.Value);
                b = 1;
            }
        }

        if (b == 1)
        {
            string strPayeeAccName   = arrResult[0].ToString();
            string strPayeeAccount   = arrResult[1].ToString();
            string strPayerAccount   = arrResult[2].ToString();
            string strAmount         = arrResult[3].ToString();
            string strPaymentBatchNo = arrResult[4].ToString();
            string strPaymentId      = arrResult[5].ToString();

            try
            {
                objOdbc.executeNonQuery("INSERT INTO mlm_perfectmoney_payment(userid,amt,pf_payee_acct_name,pf_payer_acct,pf_payee_acct,pf_amt,pf_batch_no,pf_payment_id,status,created_on, epin_type_id, epin_cost, epin_count, total_cost) VALUES(" + intUserID + "," + strAmount + ",'" + strPayeeAccName + "','" + strPayerAccount + "','" + strPayeeAccount + "'," + strAmount + ",'" + strPaymentBatchNo + "','" + strPaymentId + "', 1,'" + strdt + "', " + intEpinTypeID + ", " + dblEpinPrice + "," + intEpinCount + ", " + dblTotPrice + "  )");

                objOdbc.executeNonQuery("call purchase_epinBYPaymentgateway(" + intUserID + "," + intEpinTypeID + ", " + intEpinCount + ", 2, 2 , " + dblEpinPrice + " )");
                strResult = "A-Code Purchased Successfully !";
            }
            catch (Exception ex)
            { }
        }

        return(strResult);
    }
示例#2
0
    public string PurchaseIKeyByCoinpayment(double dblAmount, int IntUserID, int intEpinTypeID, int intEpinCount, double dblEpinPrice, double dblTotPrice)
    {
        string status_url = "";
        SortedList <string, string> listParam = new SortedList <string, string>();

        //add the elements in sortedlist
        listParam.Add("amount", (dblAmount).ToString());
        listParam.Add("currency1", "USD");
        listParam.Add("currency2", "BTC");
        listParam.Add("address", "37KfikBRm8q9b6efZ5pKbggQeA8pKfvyCc");
        listParam.Add("item_name", "A-Code Purchase");
        listParam.Add("ipn_url", "https://www.mysuccesswork.com/portal/user/success_bitcoin.aspx");

        var ret = new Dictionary <string, object>();

        ret = CallAPI("create_transaction", listParam);

        string error = ret["error"].ToString();

        if (error == "ok")
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string   objectString           = serializer.Serialize(ret["result"]);
            BlogSite bsObj = new BlogSite()
            {
                amount          = "",
                txn_id          = "",
                address         = "",
                confirms_needed = "",
                status_url      = "",
                qrcode_url      = ""
            };

            string amount = "", txn_id = "", address = "", confirms_needed = "", qrcode_url = "";
            var    json = new JavaScriptSerializer().Serialize(ret["result"]);
            using (var ms = new MemoryStream(Encoding.Unicode.GetBytes(json)))
            {
                // Deserialization from JSON
                DataContractJsonSerializer deserializer = new DataContractJsonSerializer(typeof(BlogSite));
                BlogSite bsObj2 = (BlogSite)deserializer.ReadObject(ms);
                amount          = bsObj2.amount;
                txn_id          = bsObj2.txn_id;
                address         = bsObj2.address;
                confirms_needed = bsObj2.confirms_needed;
                status_url      = bsObj2.status_url;
                qrcode_url      = bsObj2.qrcode_url;
            }

            clsWallet objwallet = new clsWallet();
            ODBC      clsOdbc   = new ODBC();

            clsOdbc.executeNonQuery("INSERT INTO `mlm_temp_invest_bitcoin`(`userid`, `amount`, `invest_by`, `error`, `btc_amount`, `txn_id`, `address`, `confirms_needed`, `status_url`, `qrcode_url`, `created_on`, epin_type_id, epin_cost, epin_count, total_cost) VALUES (" + IntUserID + ", " + dblAmount + ", " + IntUserID + ", '" + error + "','" + amount + "','" + txn_id + "','" + address + "','" + confirms_needed + "','" + status_url + "','" + qrcode_url + "','" + objwallet.getCurDateTimeString() + "', " + intEpinTypeID + ", " + dblEpinPrice + "," + intEpinCount + ", " + dblTotPrice + "  ) ");
        }

        CommonMessages.ShowAlertMessage(error.ToString());
        return(status_url);
    }
示例#3
0
    /// <summary>
    /// Sub menu strip button to show new game window
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void smnNewGame_Click(object sender, EventArgs e)
    {
        frmNewGame newGame = new frmNewGame();

        newGame.ShowDialog();
        if (newGame.ReadyStatus == 1)
        {
            GameTypeText      = newGame.GameTypeText;
            PlayerName        = newGame.NamePlayer;
            this.Text        += " - ยินดีต้อนรับคุณ " + PlayerName + " รูปแบบเกมของคุณคือ " + GameTypeText;
            lblTellRange.Text = "ใส่จำนวนที่ต้องการระหว่าง " + GameTypeText.Substring(0, 4);
            GettingProgramReady(newGame.ReadyStatus);
            GameType = newGame.GameType;
            myWallet = new clsWallet(GameType);
            UpdateForm();
            lblClue.Text      = "กรุณาใส่จำนวนเงินและกดสุ่ม";
            btnRandom.Enabled = true;
        }
        return;
    }
示例#4
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        string strQuery1     = null;
        string strQuery2     = null;
        string strUserID     = null;
        string strUserTypeID = null;

        string    strDateTime = string.Empty;
        clsEpin   objEpin     = new clsEpin();
        clsWallet objWallet   = new clsWallet();

        strDateTime = objWallet.getCurDateTimeString();

        // if (ctrlGoogleReCaptcha.Validate())
        // {
        strQuery1 = "SELECT count(1) From mlm_login where status = 1 and my_sponsar_id='" + clsOdbc.GetStringForSQL(txtUserID.Text) + "' and password='******'";

        int intCount = clsOdbc.executeScalar_int(strQuery1);


        if (intCount > 0)
        {
            System.Data.DataSet ds = new System.Data.DataSet();

            strQuery2 = "SELECT a.userid,a.UserTypeId From mlm_login a Where a.status = 1 and a.my_sponsar_id='" + clsOdbc.GetStringForSQL(txtUserID.Text) + "' and a.password='******'";

            try
            {
                ds = clsOdbc.getDataSet(strQuery2);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    strUserID     = ds.Tables[0].Rows[0][0].ToString();
                    strUserTypeID = ds.Tables[0].Rows[0][1].ToString();

                    string strIPAddress = Request.ServerVariables["REMOTE_ADDR"];
                    objother.AddLoginHistory(Int32.Parse(strUserID), strIPAddress);


                    if (strUserTypeID == "1")
                    {
                        Session["AdminID"] = strUserID;
                        Response.Redirect("portal/admin/dashboard.aspx");
                    }
                    else if (strUserTypeID == "2")
                    {
                        Session["UserID"] = strUserID;
                        Response.Redirect("portal/member/overview.aspx");
                    }
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                ds.Dispose();
            }
        }
        else
        {
            CommonMessages.ShowAlertMessage("Entered username or Password is Wrong!");
        }

        /*  }
         * else
         * {
         *    CommonMessages.ShowAlertMessage("Select Captcha!");
         * }*/
    }