public JObject Add(JObject data) { try { DBServer dbserver = new SqlServer(); PhotoManage model = new PhotoManage(dbserver); string nvcStuNo = data["nvcStuNo"].ToString().Replace("\"", "").Trim(); string cmd = string.Format("delete from T_BaseInfo_PhotoManage where nvcStuNo='{0}'", nvcStuNo); dbserver.ExecuteNonQuery(cmd); data.Remove("ID"); data.Add(new JProperty("ID", GUID.NewGuid())); if (model.Create(data)) { return(ShowSuccess("保存成功.")); } else { return(ShowExecuteError("保存失败.")); } } catch (Exception ex) { return(ShowExecuteError(ex.Message)); } }
public JObject PageLoad(long start, long limit, string field, string direction, string searchInfo) { try { DBSortPage dbsort = new DBSortPage(start, limit, field, direction); DBServer dbserver = new SqlServer(); PhotoManage mybase = new PhotoManage(dbserver); string filterf = string.Format("nvcLoginCode='{0}' and nvcCheckResult !='通过' ", searchInfo); return(mybase.Load(dbsort, filterf)); } catch (Exception ex) { return(ShowDataLoadError(ex.Message)); } }