示例#1
0
        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();
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }
示例#4
0
            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);
            }
示例#5
0
 /// <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;
 }
示例#6
0
 /// <summary>
 /// 有参构造函数
 /// </summary>
 /// <param name="status">返回状态</param>
 /// <param name="val">记录</param>
 public AjaxResult(AjaxStatus status, T val)
     : this(status)
 {
     Value = val;
 }
示例#7
0
 /// <summary>
 /// 有参构造函数
 /// </summary>
 /// <param name="status">返回状态</param>
 /// <param name="message">返回信息</param>
 public AjaxResult(AjaxStatus status, string message)
     : this(status)
 {
     Message = message;
 }
示例#8
0
 /// <summary>
 /// 有参构造函数
 /// </summary>
 /// <param name="status">返回状态</param>
 public AjaxResult(AjaxStatus status)
     : this()
 {
     Status = status;
 }
示例#9
0
 public AjaxResponse(AjaxStatus stat, List<FormValidators.FormValidatorError> errors)
     : this(stat, "")
 {
     if (stat == AjaxStatus.invalidData)
         this.errors = errors;
 }
示例#10
0
 public AjaxResponse(AjaxStatus stat)
     : this(stat, "")
 {
 }
示例#11
0
 public AjaxResponse(AjaxStatus stat, string msg)
 {
     this.msg = msg;
     this.stat = stat;
 }
示例#12
0
文件: AjaxState.cs 项目: skehya/cms
 public AjaxResult(AjaxStatus status, string msg)
 {
     this.Message = msg;
     this.Status  = status;
 }
示例#13
0
 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();
            }
示例#15
0
 public AjaxResult(AjaxStatus status, string message)
 {
     Message = message;
     _status = status;
     Data = new Dictionary<string, object>();
 }
示例#16
0
 public AjaxResult(AjaxStatus status, string message)
 {
     Message = message;
     _status = status;
 }