Beispiel #1
0
        /// <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);
        }
Beispiel #2
0
        /// <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);
        }
Beispiel #3
0
        public ActionResult SQLTitle()
        {
            Tdms_InfoCollection daInfoColl = new Tdms_InfoCollection();

            daInfoColl.ListAll();
            var arrayList = ToArrayList(daInfoColl.DataTable);

            return(Json(arrayList));
        }
Beispiel #4
0
        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));
        }