Exemplo n.º 1
0
        protected string DoGetMicroTypes(string pRequest)
        {
            //请求参数反序列化
            var rp = pRequest.DeserializeJSONTo <APIRequest <GetMicroTypesRP> >();

            //参数校验

            //构造响应数据
            var rd = new APIResponse <GetMicroTypesRD>(new GetMicroTypesRD());

            try
            {
                /*
                 * DataTable dt = new DataTable();
                 * dt.Columns.Add("TypeId");
                 * dt.Columns.Add("TypeName ");
                 * dt.Rows.Add(new string[] { "E8C34143-6419-4ABA-BF71-EA5B860BC934", "热点" });
                 * dt.Rows.Add(new string[] { "47131C9E-7B8B-4D17-8409-E5CAFCF7B1DA", "活动" });
                 */
                rd.Data.MicroTypeList = PrivateEclubMicroTypeBLL.GetMicroTypes(new EclubMicroTypeEntity());
            }
            catch (Exception ex)
            {
                Loggers.Exception(new ExceptionLogInfo(ex));
                throw new Exception(ex.Message, ex);
            }
            return(rd.ToJSON());
        }
Exemplo n.º 2
0
        public override bool Process(PayChannelEntity pChannel, HttpContext pContext, out Entity.AppOrderEntity pEntity)
        {
            pContext.Response.ContentType = "text/plain";
            try
            {
                var orderId    = pContext.Request["outTradeNo"];
                var outTradeNo = pContext.Request.QueryString["outTradeNo"];
                Loggers.Debug(new DebugLogInfo()
                {
                    Message = "outTradeNo:" + outTradeNo
                });
                Loggers.Debug(new DebugLogInfo()
                {
                    Message = "ChannelID:104&OrderId:" + orderId
                });
                AppOrderBLL bll = new AppOrderBLL(new Utility.BasicUserInfo());
                //根据订单号从数据库中找到记录
                pEntity = bll.GetByID(orderId);


                #region 更新订单状态
                pEntity.Status       = 2;
                pEntity.ErrorMessage = "";
                bll.Update(pEntity);
                #endregion

                return(true);
            }
            catch (Exception ex)
            {
                pEntity = null;
                Loggers.Exception(new ExceptionLogInfo(ex));
                return(false);
            }
        }
Exemplo n.º 3
0
        protected string DoGetMicroNums(string pRequest)
        {
            //请求参数反序列化
            var rp = pRequest.DeserializeJSONTo <APIRequest <GetMicroNumListRP> >();

            //参数校验

            //构造响应数据
            var rd = new APIResponse <GetMicroNumListRD>(new GetMicroNumListRD());

            try
            {
                /*
                 * DataTable dt = new DataTable();
                 * dt.Columns.Add("NumberID");
                 * dt.Columns.Add("NumberNo ");
                 * dt.Rows.Add(new string[] { "2438FFBF-437B-480D-B43C-307C84FF1595", "1" });
                 * dt.Rows.Add(new string[] { "9DED11A2-E1E4-4A23-8A13-AADE92B4C18E", "2" });*/
                rd.Data.NumberList = PrivateEclubMicroNumberBLL.GetMicroNums(new EclubMicroNumberEntity());
            }
            catch (Exception ex)
            {
                Loggers.Exception(new ExceptionLogInfo(ex));
                throw new Exception(ex.Message, ex);
            }
            return(rd.ToJSON());
        }
Exemplo n.º 4
0
        public static string DecodeHexStr(this string value, int dataCoding)
        {
            String strReturn = "";

            try
            {
                int    len    = value.Length / 2;
                byte[] bytSrc = new byte[len];
                for (int i = 0; i < len; i++)
                {
                    string s = value.Substring(i * 2, 2);
                    bytSrc[i] = Byte.Parse(s, System.Globalization.NumberStyles.AllowHexSpecifier);
                }

                if (dataCoding == 15)
                {
                    strReturn = Encoding.GetEncoding("GBK").GetString(bytSrc);
                }
                else if (dataCoding == 8)
                {
                    strReturn = Encoding.BigEndianUnicode.GetString(bytSrc);
                }
                else
                {
                    strReturn = System.Text.ASCIIEncoding.ASCII.GetString(bytSrc);
                }
            }
            catch (System.Exception err)
            {
                Loggers.Exception(new ExceptionLogInfo(err));
            }
            return(strReturn);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获取code
        /// </summary>
        private void GetOAuthCode(string strState)
        {
            try
            {
                //判断客户ID是否传递
                //if (!string.IsNullOrEmpty(Request["customerId"]))
                //{
                //    customerId = Request["customerId"];
                //}
                //if (!string.IsNullOrEmpty(Request["applicationId"]))
                //{
                //    applicationId = Request["applicationId"];
                //}
                //strState = (((goUrl1).Replace(".", "sb")).Replace("/", "555")).Replace(":", "666") + "sss" + customerId + "sss" + applicationId;
                //strState = CommonCompress.StringCompress(strState);
                string url = "http://open.weixin.qq.com/connect/oauth2/authorize?appid=" + strAppId + "&redirect_uri=" + HttpUtility.UrlEncode(strRedirectUri) + "&response_type=code&scope=snsapi_base&state=" + strState + "#wechat_redirect";
                //Response.Write(url);
                Loggers.Debug(new DebugLogInfo()
                {
                    Message = string.Format("GetOAuthCode: url = {0}", url)
                });

                Response.Redirect(url, false);
            }
            catch (Exception ex)
            {
                Loggers.Exception(new ExceptionLogInfo()
                {
                    ErrorMessage = string.Format("GetOAuthCode 出错: {0}", ex.ToString())
                });
                Response.Write("向微信请求认证Code出错,请联系管理员尽快处理.");
                Response.End();
            }
        }
Exemplo n.º 6
0
        public static string EncodeHexStr(this string value, int dataCoding)
        {
            string strhex = "";

            try
            {
                Byte[] bytSource = null;
                if (dataCoding == 15)
                {
                    bytSource = Encoding.GetEncoding("GBK").GetBytes(value);
                }
                else if (dataCoding == 8)
                {
                    bytSource = Encoding.BigEndianUnicode.GetBytes(value);
                }
                else
                {
                    bytSource = Encoding.ASCII.GetBytes(value);
                }
                for (int i = 0; i < bytSource.Length; i++)
                {
                    strhex = strhex + bytSource[i].ToString("X2");
                }
            }
            catch (System.Exception err)
            {
                Loggers.Exception(new ExceptionLogInfo(err));
            }
            return(strhex);
        }
Exemplo n.º 7
0
        protected override AppMgrResponse ProcessAction(string pAction, AppMgrRequest pRequest)
        {
            AppMgrResponse response = new AppMgrResponse()
            {
                ResultCode = 0, Message = "操作成功"
            };

            try
            {
                switch (pAction)
                {
                case "CheckAppVersion":
                    response.Data = API.ServiceAPI.CheckAppVersion(pRequest);
                    break;

                default:
                    throw new Exception("错误的接口:" + pAction);
                }
            }
            catch (Exception ex)
            {
                response.ResultCode = 100;
                response.Message    = ex.Message;
                Loggers.Exception(new ExceptionLogInfo(ex));
            }
            return(response);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 根据类别ID获取阿拉丁分类
        /// </summary>
        /// <returns></returns>
        protected string GetALDByCategoryId()
        {
            var data = this.DeserializeJSONContent <ItemCategoryInfo>();
            //同步到ALDCategoryID分类 data.CustomerID,      data.Item_Category_Id. data.ALDCategoryID
            var url     = ConfigurationManager.AppSettings["ALDApiURL"].ToString() + "/Gateway.ashx";
            var request = new ItemCategory2ALDRequest()
            {
                Parameters = data
            };
            var res    = new MallALDCategoryEntity();//
            var resstr = "";

            try
            {
                resstr = JIT.Utility.Web.HttpClient.GetQueryString(url, string.Format("Action=GetALDByCategoryId&ReqContent={0}", request.ToJSON()));
                Loggers.Debug(new DebugLogInfo()
                {
                    Message = "调用获取ALD类别接口:" + resstr
                });
                //   res = resstr.DeserializeJSONTo<MallALDCategoryEntity>();
            }
            catch (Exception ex)
            {
                Loggers.Exception(new ExceptionLogInfo(ex));
                throw new Exception("调用ALD平台失败:" + ex.Message);
            }



            return(resstr);
        }
Exemplo n.º 9
0
        protected string DoGetCheckInGroups(string pRequest)
        {
            //1、请求参数反序列化
            var rp = pRequest.DeserializeJSONTo <APIRequest <GetCheckInGroupsRP> >();

            //2、参数校验
            rp.Parameters.Validate();

            //3、构造响应数据
            var rd = new APIResponse <GetCheckInGroupsRD>(new GetCheckInGroupsRD());

            try
            {
                //4、获取当前用户登录信息
                var loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, rp.UserID);

                //5、签到
                rd.Data.GroupList = new LEventSignUpBLL(loggingSessionInfo).GetCheckInGroupsList(rp.Parameters.EventId, rp.Parameters.GroupName);
            }
            catch (Exception ex)
            {
                Loggers.Exception(new ExceptionLogInfo(ex));
                throw new Exception(ex.Message, ex);
            }
            return(rd.ToJSON());
        }
Exemplo n.º 10
0
        protected string DoEventCheckIn(string pRequest)
        {
            //1、请求参数反序列化
            var rp = pRequest.DeserializeJSONTo <APIRequest <EventCheckInRP> >();

            //2、参数校验
            rp.Parameters.Validate();

            //3、构造响应数据
            var rd = new APIResponse <EventCheckInRD>(new EventCheckInRD());

            try
            {
                //4、获取当前用户登录信息
                var loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, rp.UserID);

                //5、签到
                Dictionary <string, string> dicInfo = new Dictionary <string, string>();
                rd.Data.IsOk         = new LEventSignUpBLL(loggingSessionInfo).EventCheckInInfo("", rp.Parameters.RegCode, rp.Parameters.Mobile, out dicInfo);
                rd.Data.CheckinInfos = dicInfo;
            }
            catch (Exception ex)
            {
                Loggers.Exception(new ExceptionLogInfo(ex));
                throw new Exception(ex.Message, ex);
            }
            return(rd.ToJSON());
        }