public BaseContainer(JsonDTO json) { Id = json.Id; Headers = json.Headers; Model = json.Model; Tag = json.Tag; }
public ActionResult Zhuanjia() { try { FansInfo Fans = Session["FansInfo"] as FansInfo; Dictionary <string, string> dic = new Dictionary <string, string>(); logger.Fatal(Fans.Openid); dic.Add("openid", Fans.Openid); JsonDTO <bool> result = RequestHelp.RequestGet <bool>("Member/ChckBind", dic).Result; string json = JsonConvert.SerializeObject(Fans); ViewBag.FansInfo = false; //如果是注册用户 if (result.Data) { ViewBag.FansInfo = true; } return(View()); //return Redirect(ConfigurationManager.AppSettings["WebUrl"] + "/hmjmember/tozhuce.do"); } catch (System.Exception) { return(View()); } }
public ModelDadorCancelarConsultToBot CheckIfDadorForCancelarConsulta(string docIdentificacao) { using (var client = new HttpClient()) { // Passing service base url client.BaseAddress = new Uri(Baseurl_Consulta); client.DefaultRequestHeaders.Clear(); // Define request data format client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); var jsonString = new JsonDTO { DocIdentificacao = docIdentificacao }; var jsonT = JsonConvert.SerializeObject(jsonString); var Res = client.PostAsync(Baseurl_Consulta, new StringContent(jsonT, Encoding.UTF8, "application/json")).Result; // Checking the response is successful or not which is sent using HttpClient if (Res.IsSuccessStatusCode) { ModelDadorCancelarConsultToBot resJson = Res.Content.ReadAsAsync <ModelDadorCancelarConsultToBot>().Result; return(resJson); } else // Não encontrou nenhum match { return(null); } } }
internal static BaseTextedElement CreateTextElementModel(JsonDTO json) { var model = Type.GetType($"SophiApp.Models.{json.Model}"); var element = Activator.CreateInstance(model, json) as BaseTextedElement; element.CurrentStateAction = FindCurrentStateAction(element.Id); element.SystemStateAction = FindSystemStateAction(element.Id); return(element); }
public BaseTextedElement(JsonDTO json) { ContainerId = json.ContainerId; Id = json.Id; Descriptions = json.Descriptions; Headers = json.Headers; Model = json.Model; Tag = json.Tag; }
/// <summary> /// 显示页面 /// </summary> /// <returns></returns> public async Task <ActionResult> Index() { JsonDTO <MemberResDTO> result = await RequestHelp.RequestPost <MemberResDTO, MemberUpdateReqDTO>("Test/PostTest", new MemberUpdateReqDTO() { NAME_LAST = "你好" }); //return Json(result); return(View()); }
/// <summary> /// 是否注册 /// </summary> /// <returns></returns> public ActionResult IsRegister() { string str = Request["openid"]; Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("openid", str); JsonDTO <bool> result = RequestHelp.RequestGet <bool>("Member/ChckBind", dic).Result; return(Json(result.Data)); }
internal static IEnumerable <JsonDTO> ParseJson(byte[] json) { var matchPattern = @"\n {(.*?)\n }"; return(Regex.Matches(Encoding.UTF8.GetString(json), matchPattern, RegexOptions.Compiled | RegexOptions.Singleline) .Cast <Match>() .Select(match => { var dto = new JsonDTO(); using (MemoryStream memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(match.Value))) { var jsonSerializer = new DataContractJsonSerializer(typeof(JsonDTO), new DataContractJsonSerializerSettings() { UseSimpleDictionaryFormat = true }); dto = (JsonDTO)jsonSerializer.ReadObject(memoryStream); } return dto; })); }
internal static RadioButtonGroup CreateRadioButtonGroupModel(JsonDTO json) { var model = Type.GetType($"SophiApp.Models.{json.Model}"); return(Activator.CreateInstance(model, json) as RadioButtonGroup); }
internal static ExpandingGroup CreateExpandingGroupModel(JsonDTO json) { var model = Type.GetType($"SophiApp.Models.{json.Model}"); return(Activator.CreateInstance(model, json) as ExpandingGroup); }
public CheckBox(JsonDTO json) : base(json) { }
public RadioButtonGroup(JsonDTO json) : base(json) { }
public ExpandingGroup(JsonDTO json) : base(json) { }
public Switch(JsonDTO json) : base(json) { }
/// <summary> /// 显示页面 /// </summary> /// <returns></returns> public async Task <ActionResult> Index() { JsonDTO <CityResDTO> result = await RequestHelp.RequestGet <CityResDTO>("Test/PostTest", null); return(Json(result)); }
public RadioButton(JsonDTO json) : base(json) { }