private static void WriteJson(AjaxStatus status, string msg, object data) { AjaxObject model = new AjaxObject(); model.Status = status; model.Msg = msg; model.Data = data; HttpContext.Current.Response.Write(JsonConvert.SerializeObject(model)); HttpContext.Current.Response.End(); }
public JsonResult GetShoppingHisory() { AjaxStatus ajaj = new AjaxStatus(); IList <ShoppingViewModel> Data = this._shoppingService.GetUserShoppingHistory(User.Identity.Name); ajaj.IsSuccess = true; ajaj.JsonString = JsonConvert.SerializeObject(Data.OrderByDescending(x => x.ListID)); return(Json(ajaj)); }
public JsonResult Create([Bind(Include = "ProductID,Quantity,Price")] ProductDetail item) { AjaxStatus status = new AjaxStatus(); item.ProductName = this._shoppingService.GetProductName(item.ProductID); list.Clear(); if (this._shoppingService.HasSession()) { list = this._shoppingService.GetSession(); list.Add(item); status.IsSuccess = true; } else { list.Add(item); Session["ShoppingList"] = list; status.IsSuccess = true; } return(Json(status)); }
public override void callback(String url, String html, AjaxStatus status) { File dir_file = new File(mDownloadPath + id); if (!dir_file.exists()) { dir_file.mkdir(); } Pattern pattern = Pattern.compile("(?<=src=\")[^\"]+(?=\")"); Matcher matcher = pattern.matcher(html); StringBuffer sb = new StringBuffer(); while (matcher.find()) { downloadPic(id, matcher.group(0)); matcher.appendReplacement(sb, formatPath(matcher.group(0))); } matcher.appendTail(sb); html = sb.toString(); writeHtml(id, title, html); }
/// <summary> /// 有参构造函数 /// </summary> /// <param name="status">返回状态</param> /// <param name="message">返回信息</param> /// <param name="val">记录</param> public AjaxResult(AjaxStatus status, string message, T val) : this(status, message) { Value = val; }
/// <summary> /// 有参构造函数 /// </summary> /// <param name="status">返回状态</param> /// <param name="val">记录</param> public AjaxResult(AjaxStatus status, T val) : this(status) { Value = val; }
/// <summary> /// 有参构造函数 /// </summary> /// <param name="status">返回状态</param> /// <param name="message">返回信息</param> public AjaxResult(AjaxStatus status, string message) : this(status) { Message = message; }
/// <summary> /// 有参构造函数 /// </summary> /// <param name="status">返回状态</param> public AjaxResult(AjaxStatus status) : this() { Status = status; }
public AjaxResponse(AjaxStatus stat, List<FormValidators.FormValidatorError> errors) : this(stat, "") { if (stat == AjaxStatus.invalidData) this.errors = errors; }
public AjaxResponse(AjaxStatus stat) : this(stat, "") { }
public AjaxResponse(AjaxStatus stat, string msg) { this.msg = msg; this.stat = stat; }
public AjaxResult(AjaxStatus status, string msg) { this.Message = msg; this.Status = status; }
/// <summary> /// Modifies the view before adding it to the gridview. /// </summary> protected override void InvokeCallback(string url, Android.Widget.ImageView iv, Android.Graphics.Bitmap bitmap, AjaxStatus status) { imageViewOriginial = iv; iv.LayoutParameters = new RelativeLayout.LayoutParams(WindowManagerLayoutParams.MatchParent, _width); iv.SetScaleType(Android.Widget.ImageView.ScaleType.FitXy); //iv.SetPadding (2, 2, 2, 2); //Matrix used to crop image Matrix matrix = new Matrix(); matrix.PostScale(0.5f, 0.5f); Bitmap finalBitmap = null; int size = _bm.Width; if (size >= 40) { size = 40; } finalBitmap = global::Android.Graphics.Bitmap.CreateBitmap(_bm, 0, 0, size, size, matrix, true); iv.SetImageBitmap(finalBitmap); _bm.Recycle(); }
public AjaxResult(AjaxStatus status, string message) { Message = message; _status = status; Data = new Dictionary<string, object>(); }
public AjaxResult(AjaxStatus status, string message) { Message = message; _status = status; }