public ActionResult CreateSql(string sql, string code) { var res = false; var msg = ""; var mng = new SqlCrudManager(); var item = mng.GetSqlGet(code); try { if (item != null) { msg = "Sql с таким кодом уже существует в системе"; } else { var users = Membership.GetUser().UserName; item = new as_sqlGet { id = 0, code = code, sql = sql, users = users }; mng.SaveSql(item); res = true; } } catch (Exception ex) { RDL.Debug.LogError(ex); } return(Json(new { result = res, msg = msg, rightID = item.id }, JsonRequestBehavior.AllowGet)); }
public void SaveSql(as_sqlGet item) { try { db.SaveSql(item); } catch (Exception ex) { RDL.Debug.LogError(ex); } }
public void DeleteSqlCrud(as_sqlGet item) { try { RDL.CacheManager.PurgeCacheItems("as_sqlGet_id__" + item.code); db.DeleteSqlCrud(item.id); } catch (Exception ex) { RDL.Debug.LogError(ex); } }
public as_sqlGet GetSqlGet(string code) { var res = new as_sqlGet(); var key = "as_sqlGet_code_" + code; if (CacheManager.EnableCaching && CacheManager.Cache[key] != null && false) { res = (as_sqlGet)CacheManager.Cache[key]; } else { try { res = db.GetSql(code); CacheManager.CacheData(key, res); } catch (Exception ex) { Debug.LogError(ex); } } return(res); }
public as_sqlGet GetSqlCrud(int id) { var res = new as_sqlGet(); var key = "as_sqlCrud_id_" + id; if (CacheManager.EnableCaching && CacheManager.Cache[key] != null && false) { res = (as_sqlGet)CacheManager.Cache[key]; } else { try { res = db.GetSqlGet(id); CacheManager.CacheData(key, res); } catch (Exception ex) { Debug.LogError(ex); } } return(res); }