/// <summary> /// 验证数据 /// </summary> /// <returns></returns> private bool SaveVerify() { if (string.IsNullOrEmpty(DAL.SqlContext)) { Alert("SQL语句不能为空"); return(false); } if (DAL.OperaotId <= 0) { Alert(ResultType.非法数值, "操作员无效"); return(false); } Regex regex = new Regex("DELETE |UPDATE |INSERT |CREATE |DROP |ALTER |TRUNCATE "); var match = regex.Match(DAL.SqlContext.ToUpper()); if (match.Success) { Alert("SQL语句出现非法字符:\"" + match.Value + "\""); return(false); } Tdms_InfoCollection daInfo = new Tdms_InfoCollection(); if (!daInfo.CheckSQLCommand(DAL.SqlContext)) { Alert("SQL有误:" + daInfo.PromptInfo); return(false); } return(true); }
/// <summary> /// 执行SQL /// </summary> /// <returns></returns> public bool ExecuteSQL(string sql, out int count) { Tdms_InfoCollection daInfo = new Tdms_InfoCollection(); count = daInfo.ExecuteSQL(sql); return(true); }
public ActionResult SQLTitle() { Tdms_InfoCollection daInfoColl = new Tdms_InfoCollection(); daInfoColl.ListAll(); var arrayList = ToArrayList(daInfoColl.DataTable); return(Json(arrayList)); }
public ActionResult Index(FormCollection form) { string title = form["NodeTitle"]; int fatherId = form["fatherId"].Safe().ToInt32(); Tdms_InfoCollection daInfoColl = new Tdms_InfoCollection(); daInfoColl.ChangePage = this.ChangePage(); daInfoColl.ListByAppId(title, fatherId); return(ListViewResult(daInfoColl, ValueFormat)); }