示例#1
0
    private int DAS_CODEPAGE = 65001;                //Define code page: UTF-8, http://ko.wikipedia.org/wiki/%EC%BD%94%EB%93%9C_%ED%8E%98%EC%9D%B4%EC%A7%80

    protected void Page_Load(object sender, EventArgs e)
    {
        int intRetVal = 0;

        BOQv7Das_Net.IDas objDas = null;

        string strErrMsg = string.Empty;
        string json      = "";

        try
        {
            objDas = new BOQv7Das_Net.IDas();

            objDas.Open(DAS_HOST);
            objDas.CommandType = CommandType.StoredProcedure;
            objDas.CodePage    = DAS_CODEPAGE;

            Stream req = Request.InputStream;
            req.Seek(0, System.IO.SeekOrigin.Begin);
            json = new StreamReader(req).ReadToEnd();

            Log(json);

            jsonVal jv = new jsonVal();

            jv = JsonConvert.DeserializeObject <jsonVal>(json);

            objDas.AddParam("@pi_intOrderNo", DBType.adBigInt, Convert.ToInt64(jv.order_no), 0, ParameterDirection.Input);
            objDas.AddParam("@pi_intStatus", DBType.adVarChar, 2, 0, ParameterDirection.Input);
            objDas.AddParam("@po_intRetVal", DBType.adInteger, DBNull.Value, 0, ParameterDirection.Output);
            objDas.AddParam("@po_strMsg", DBType.adVarChar, DBNull.Value, 256, ParameterDirection.Output);

            objDas.SetQuery("dbo.UP_ORDER_TX_UPD"); //Execute Query

            if (!objDas.LastErrorCode.Equals(0))
            {
                intRetVal = objDas.LastErrorCode;
                strErrMsg = objDas.LastErrorMessage;
            }

            intRetVal = Convert.ToInt32(objDas.GetParam("@po_intRetVal"));
            strErrMsg = objDas.GetParam("@po_strMsg");

            if (intRetVal.Equals(0))
            {
                chargePurchase(jv);
            }
        }
        catch (Exception ex)
        {
            Response.Write("{\"code\":1, \"message\":\"" + ex.Message + "\"}");
        }
        finally
        {
        }
    }
示例#2
0
    private void DisplayData(int packNo)
    {
        BOQv7Das_Net.IDas objDas = null;

        try
        {
            objDas = new BOQv7Das_Net.IDas();

            objDas.Open(DAS_HOST);
            objDas.CommandType = CommandType.StoredProcedure;
            objDas.CodePage    = DAS_CODEPAGE;

            objDas.AddParam("@pi_intPackNo", DBType.adInteger, packNo, 0, ParameterDirection.Input);
            objDas.AddParam("@po_strPname", DBType.adVarWChar, DBNull.Value, 20, ParameterDirection.Output);
            objDas.AddParam("@po_intPrice", DBType.adInteger, DBNull.Value, 0, ParameterDirection.Output);

            //프로시져 호출
            objDas.SetQuery("UP_PACKAGE_DTL_UR_LST");     //Execute Query

            string itemList = "";
            int    totalP   = 0;

            while (objDas.Read())
            {
                packImageViewUpd.Src = objDas["PACKIMG"].ToString().Replace("D:\\WEBHOSTING\\ejdo\\User", "http://ejdo.payletter.com");
                packNameUpd.Value    = objDas.GetParam("@po_strPname");
                packCntUpd.Value     = objDas["CNT"].ToString();
                packPriceUpd.Value   = objDas.GetParam("@po_intPrice");

                itemList += objDas["itemNo"] + ",";
                totalP   += Convert.ToInt32(objDas["ITEMPRICE"]);
            }

            itemListUpd.Value = itemList;
            totalPrice.Value  = totalP.ToString();
        }
        catch
        {
        }
        finally
        {
            //Close
            if (objDas != null)
            {
                objDas.Close();
                objDas = null;
            }
        }
        return;
    }
示例#3
0
    private void orderSuccess(string orderNo)
    {
        int intRetVal = 0;

        BOQv7Das_Net.IDas objDas = null;

        string strErrMsg = string.Empty;

        try
        {
            objDas = new BOQv7Das_Net.IDas();

            objDas.Open(DAS_HOST);
            objDas.CommandType = CommandType.StoredProcedure;
            objDas.CodePage    = DAS_CODEPAGE;


            objDas.AddParam("@pi_intOrderNo", DBType.adBigInt, Convert.ToInt64(orderNo), 0, ParameterDirection.Input);
            objDas.AddParam("@pi_intStatus", DBType.adVarChar, 2, 0, ParameterDirection.Input);
            objDas.AddParam("@po_intRetVal", DBType.adInteger, DBNull.Value, 0, ParameterDirection.Output);
            objDas.AddParam("@po_strMsg", DBType.adVarChar, DBNull.Value, 256, ParameterDirection.Output);

            objDas.SetQuery("dbo.UP_ORDER_TX_UPD"); //Execute Query

            if (!objDas.LastErrorCode.Equals(0))
            {
                intRetVal = objDas.LastErrorCode;
                strErrMsg = objDas.LastErrorMessage;
            }

            intRetVal = Convert.ToInt32(objDas.GetParam("@po_intRetVal"));
            strErrMsg = objDas.GetParam("@po_strMsg");
        }
        catch (Exception ex)
        {
            Response.Write("{\"code\":1, \"message\":\"" + ex.Message + "\"}");
        }
        finally
        {
        }
    }
示例#4
0
    ///----------------------------------------------------------------------
    /// <summary>
    /// 패키지 상세 조회
    /// </summary>
    ///----------------------------------------------------------------------
    private void getPackageDetail(int packNo)
    {
        BOQv7Das_Net.IDas objDas = null;

        try
        {
            objDas = new BOQv7Das_Net.IDas();

            objDas.Open(DAS_HOST);
            objDas.CommandType = CommandType.StoredProcedure;
            objDas.CodePage    = DAS_CODEPAGE;

            objDas.AddParam("@pi_intPackNo", DBType.adInteger, packNo, 0, ParameterDirection.Input);
            objDas.AddParam("@po_strPname", DBType.adVarWChar, DBNull.Value, 20, ParameterDirection.Output);
            objDas.AddParam("@po_intPrice", DBType.adInteger, DBNull.Value, 0, ParameterDirection.Output);

            //프로시져 호출
            objDas.SetQuery("dbo.UP_PACKAGE_DTL_UR_LST"); //Execute Query

            DataRow row = objDas.objDT.Rows[0];
            packImg.Src         = row["PACKIMG"].ToString().Replace("D:\\WEBHOSTING\\ejdo\\User", "");
            packName.InnerText  = objDas.GetParam("@po_strPname");
            packPrice.InnerText = objDas.GetParam("@po_intPrice");
            product_name        = objDas.GetParam("@po_strPname");
            amount = Convert.ToInt32(objDas.GetParam("@po_intPrice"));
        }
        catch
        {
        }
        finally
        {
            //Close
            if (objDas != null)
            {
                objDas.Close();
                objDas = null;
            }
        }
    }
示例#5
0
    protected void btnPay_Click(object sender, EventArgs e)
    {
        pgcode        = Request["pgCode"];
        dateRecvStart = Request.Form["dateRecvStart"];
        chargeAmount  = Convert.ToInt32(Request["chargeAmountVal"]);
        cashAmount    = Convert.ToInt32(Request["cashAmountVal"]);

        if (userTotalCash < cashAmount)
        {
            Response.Write("<script>alert('구매 실패');</script>");
            Response.Write("<script>location.href='../Item/ItemList.aspx';</script>");
            return;
        }
        else
        {
            int intRetVal            = 0;
            BOQv7Das_Net.IDas objDas = null;

            string strErrMsg = string.Empty;

            try {
                objDas = new BOQv7Das_Net.IDas();

                objDas.Open(DAS_HOST);
                objDas.CommandType = CommandType.StoredProcedure;
                objDas.CodePage    = DAS_CODEPAGE;

                objDas.AddParam("@pi_strUserId", DBType.adVarChar, Page.Session["userId"], 20, ParameterDirection.Input);
                objDas.AddParam("@pi_intPackNo", DBType.adInteger, packNo, 0, ParameterDirection.Input);
                objDas.AddParam("@pi_intChargeAmount", DBType.adInteger, chargeAmount, 0, ParameterDirection.Input);
                objDas.AddParam("@pi_intCashAmount", DBType.adInteger, cashAmount, 0, ParameterDirection.Input);
                objDas.AddParam("@pi_strDateRecvStart", DBType.adDate, dateRecvStart, 0, ParameterDirection.Input);
                objDas.AddParam("@pi_strAddress", DBType.adVarWChar, address, 100, ParameterDirection.Input);
                objDas.AddParam("@pi_strMethod", DBType.adVarChar, pgcode, 20, ParameterDirection.Input);

                objDas.AddParam("@po_intOrderNo", DBType.adBigInt, 0, 0, ParameterDirection.Output);
                objDas.AddParam("@po_intRetVal", DBType.adInteger, DBNull.Value, 0, ParameterDirection.Output);
                objDas.AddParam("@po_strMsg", DBType.adVarChar, DBNull.Value, 256, ParameterDirection.Output);


                objDas.SetQuery("dbo.UP_ORDER_TX_INS"); //Execute Query

                if (!objDas.LastErrorCode.Equals(0))
                {
                    intRetVal = objDas.LastErrorCode;
                    strErrMsg = objDas.LastErrorMessage;
                }

                orderNo = objDas.GetParam("@po_intOrderNo");

                if (chargeAmount > 0)
                {
                    sendPayment(orderNo);
                }
                else
                {
                    orderSuccess(orderNo);
                    int cpRetVal = chargePurchase(orderNo);

                    if (cpRetVal == 0)
                    {
                        Response.Write("<script>fnOrderSuccess();</script>");
                        Response.Write("<script>location.href='../Membership/PurchaseList.aspx';</script>");
                    }
                }
            }
            catch
            {
            }finally
            {
                //Close
                if (objDas != null)
                {
                    objDas.Close();
                    objDas = null;
                }
            }
        }
    }