public string _UserScaleList(string sqlwhere) { if (string.IsNullOrEmpty(sqlwhere)) { sqlwhere += "1=1"; } else sqlwhere += " and 1=1"; UserScaleBll ob = new UserScaleBll(); List<UserScale> orderList = new List<UserScale>(); orderList = ob.GetModelList(sqlwhere); int rows = ob.GetRecordCount(sqlwhere); string output = JsonConvert.SerializeObject(orderList); string json = @"{""Rows"":" + output + @",""Total"":""" + rows + @"""}"; return json; }
public bool _DelUserScale(string jsonData) { UserScaleBll ob = new UserScaleBll(); List<UserScale> we = JsonConvert.DeserializeObject(jsonData, typeof(List<UserScale>)) as List<UserScale>; return ob.DeleteList(we); }
public string _UpdateUserScale(string jsonData) { // String s = (new System.IO.StreamReader(HttpContext.Current.Request.InputStream)).ReadToEnd(); UserScaleBll ob = new UserScaleBll(); List<UserScale> we = JsonConvert.DeserializeObject(jsonData, typeof(List<UserScale>)) as List<UserScale>; string Flag = "success"; foreach (UserScale wd in we) { bool SuccessFlag = ob.Update(wd); if (!SuccessFlag) { Flag = "error"; } } return Flag; }
public string _AddUserScale(string jsonData) { // String s = (new System.IO.StreamReader(HttpContext.Current.Request.InputStream)).ReadToEnd(); UserScaleBll ob = new UserScaleBll(); List<UserScale> we = JsonConvert.DeserializeObject(jsonData, typeof(List<UserScale>)) as List<UserScale>; string Flag = "success"; foreach (UserScale wd in we) { if (Session["OrderID"] == null) { Flag = "error"; return Flag; } wd.id = Convert.ToInt32(Session["OrderID"]); int SuccessFlag = ob.Add(wd); if (SuccessFlag <= 0) { Flag = "error"; } } return Flag; }