Esempio n. 1
0
    protected void BindData()
    {
        string chkFlag = "";

        try
        {
            if (Request.Form["hdnPrPriceId"] != null)
            {
                SqlParameter[] paras = new SqlParameter[6];
                paras[0] = new SqlParameter("@ProdPriceId", Request.Form["hdnPrPriceId"].ToString());
                if (UserInfo.GetUserInfo() != null)
                {
                    paras[1] = new SqlParameter("@UserId", UserInfo.GetUserInfo().userId);
                }
                else
                {
                    paras[1] = new SqlParameter("@UserId", "1");
                }
                paras[2] = new SqlParameter("@FunType", hdnActionType.Value == "" ? "I" : hdnActionType.Value);
                if (!String.IsNullOrEmpty(OrderId))
                {
                    paras[3] = new SqlParameter("@OrderHeaderId", OrderId);
                }
                else
                {
                    paras[3] = new SqlParameter("@OrderHeaderId", "0");
                }
                paras[4] = new SqlParameter("@msgOut", SqlDbType.VarChar, 10000);

                if (!String.IsNullOrEmpty(AffiliateID))
                {
                    paras[5] = new SqlParameter("@AffiliatId", Convert.ToInt64(AffiliateID));
                }
                else
                {
                    paras[5] = new SqlParameter("@AffiliatId", 0);
                }

                chkFlag = objDataAccess.ExecSPWithOutPutPara("Cart_IUD", paras, 4, System.Data.CommandType.StoredProcedure);

                if (!String.IsNullOrEmpty(chkFlag))
                {
                    OrderId = chkFlag.Split('|')[1].ToString();
                }
                //This to remove affiliate Id
                OrderID.RemoveAffId();
            }



            BindCartGrid();
        }
        catch (Exception)
        {
        }
    }