public string _UpdateOrder(string jsonData) { // String s = (new System.IO.StreamReader(HttpContext.Current.Request.InputStream)).ReadToEnd(); OrderBll ob = new OrderBll(); List<Order> we = JsonConvert.DeserializeObject(jsonData, typeof(List<Order>)) as List<Order>; string Flag = "success"; foreach (Order wd in we) { bool SuccessFlag = ob.Update(wd); if (!SuccessFlag) { Flag = "error"; } } return Flag; }
public bool _DelOrder(string jsonData) { OrderBll ob = new OrderBll(); List<Order> we = JsonConvert.DeserializeObject(jsonData, typeof(List<Order>)) as List<Order>; return ob.DeleteList(we); }
public string _OrderList(string sqlwhere) { if (string.IsNullOrEmpty(sqlwhere)) { sqlwhere += "1=1"; } else sqlwhere += " and 1=1"; OrderBll ob = new OrderBll(); List<Order> orderList = new List<Order>(); orderList = ob.GetModelList(sqlwhere); int rows = ob.GetRecordCount(sqlwhere); string output = JsonConvert.SerializeObject(orderList); string json = @"{""Rows"":" + output + @",""Total"":""" + rows + @"""}"; return json; }
public string _AddOrder(string jsonData) { // String s = (new System.IO.StreamReader(HttpContext.Current.Request.InputStream)).ReadToEnd(); OrderBll ob = new OrderBll(); List<Order> we = JsonConvert.DeserializeObject(jsonData, typeof(List<Order>)) as List<Order>; string Flag = "success"; foreach (Order wd in we) { wd.eg4 = DateTime.Now.ToString(); int SuccessFlag = ob.Add(wd); if (SuccessFlag <= 0) { Flag = "error"; } } return Flag; }