//private string GetQuery() //{ // var qs = Request.Url.Query; // if (Request.HttpMethod == "GET" || Request.TotalBytes == 0) // return qs; // string ps = null; // var bin = Request.BinaryRead(Request.TotalBytes); // ps = ASCIIEncoding.UTF8.GetString(bin); // if (string.IsNullOrEmpty(qs)) // qs = ps; // else // qs += "&" + ps; // return qs; //} protected virtual Logical.ISMS_DataItem LoadItem() { var linkId = GetLinkId(); if (string.IsNullOrEmpty(linkId)) return null; if (!string.IsNullOrEmpty(api.MoCheck)) _MoItem = GetMOItemByLinkId(linkId); _MrItem = GetMRItemByLinkId(linkId); if (IsMo) { if (_MoItem == null) { IsNew = true; _MoItem = new LightDataModel.tbl_moItem(); _MoItem.create_date = DateTime.Now; _MoItem.linkid = linkId; } return _MoItem; } if (_MrItem == null) { IsNew = true; _MrItem = new LightDataModel.tbl_mrItem(); _MrItem.create_date = DateTime.Now; _MrItem.linkid = linkId; } return _MrItem; }
private void ProcessUser() { var mo = new LightDataModel.tbl_moItem(); mo.sp_api_url_id = api.id; mo.mobile = moRequest.body.message.senderAddress; mo.ori_trone = moRequest.body.message.smsServiceActivationNumber; mo.ori_order = moRequest.body.message.message; mo.sp_id = api.sp_id; mo.create_date = DateTime.Now; mo.mo_date = mo.create_date.Date; mo.ip = Shotgun.Library.Static.GetUserHostAddress(); mo.linkid = GetLinkId(); mo.cp_param = moRequest.header.linkId; //var cityInfo = LightDataModel.tbl_phone_locateItem.GetRowByMobile(dBase, spNum); //if (cityInfo == null) // return; //m.city_id = cityInfo.id; //m.province_id = cityInfo.province_id; //mo.ip= //var sms = new TelcomModel.MoToISMS(mo); var city = Library.GetCityInfo(dBase, mo.mobile, mo.imsi); mo.city_id = city.id; mo.province_id = city.province_id; var trone = n8wan.Public.Logical.BaseSPCallback.FillToneId(dBase, mo); mo.SaveToDatabase(dBase); if (trone == null) { WriteError("trone no found"); return; } var troneOrder = MatchTroneOrder(mo); var bp = new BasePool(); bp.trone = trone; bp.troneOrder = troneOrder; bp.dBase = dBase; if (!bp.Init(mo)) { WriteError("bp init fail" + bp.ErrorMesage); return; } bp.orderInfo.sp_exField = moRequest.header.transactionId; if (!bp.ProcesUserRequest()) { WriteError(bp.ErrorMesage); } else { WriteError("ok"); } return; }
/// <summary> /// 重置变量数据,多次同步模式时需要使用 /// </summary> /// <param name="all">是否重置所有数据</param> /// <returns></returns> protected void Reset(bool all) { if (all) _IsMo = 0; //_IsMo = 0; //重置时不进行MO状态复位 _linkId = null; _MoItem = null; _MrItem = null; SyncFlag = E_CP_SYNC_MODE.Auto; }