public string _UpdateMaintainRegTB(string jsonData) { // String s = (new System.IO.StreamReader(HttpContext.Current.Request.InputStream)).ReadToEnd(); MaintainRegTBBll ob = new MaintainRegTBBll(); List<MaintainRegTB> we = JsonConvert.DeserializeObject(jsonData, typeof(List<MaintainRegTB>)) as List<MaintainRegTB>; string Flag = "success"; foreach (MaintainRegTB wd in we) { bool SuccessFlag = ob.Update(wd); if (!SuccessFlag) { Flag = "error"; } } return Flag; }
public bool _DelMaintainRegTB(string jsonData) { MaintainRegTBBll ob = new MaintainRegTBBll(); List<MaintainRegTB> we = JsonConvert.DeserializeObject(jsonData, typeof(List<MaintainRegTB>)) as List<MaintainRegTB>; return ob.DeleteList(we); }
public string _MaintainRegTBList(string sqlwhere) { if (string.IsNullOrEmpty(sqlwhere)) { sqlwhere += "1=1"; } else sqlwhere += " and 1=1"; MaintainRegTBBll ob = new MaintainRegTBBll(); List<MaintainRegTB> orderList = new List<MaintainRegTB>(); orderList = ob.GetModelList(sqlwhere); // int rows = ob.GetRecordCount(sqlwhere); int rows = orderList.Count; string output = JsonConvert.SerializeObject(orderList); string json = @"{""Rows"":" + output + @",""Total"":""" + rows + @"""}"; return json; }
public string _AddMaintainRegTB(string jsonData) { MaintainRegTBBll ob = new MaintainRegTBBll(); List<MaintainRegTB> we = JsonConvert.DeserializeObject(jsonData, typeof(List<MaintainRegTB>)) as List<MaintainRegTB>; string Flag = "success"; foreach (MaintainRegTB wd in we) { int SuccessFlag = ob.Add(wd); if (SuccessFlag <= 0) { Flag = "error"; } } return Flag; }