Ejemplo n.º 1
0
        /// <summary>
        /// 执行
        /// </summary>
        /// <returns>返回执行结果</returns>
        public string DoMethod_ExeSQL()
        {
            MethodFunc func = new MethodFunc(this.MyPK);
            string     doc  = func.MethodDoc_SQL;

            GEEntity en = new GEEntity(func.FrmID, this.WorkID);

            doc = BP.WF.Glo.DealExp(doc, en, null); //替换里面的内容.

            try
            {
                DBAccess.RunSQLs(doc);
                if (func.MsgSuccess.Equals(""))
                {
                    func.MsgSuccess = "执行成功.";
                }

                return(func.MsgSuccess);
            }
            catch (Exception ex)
            {
                if (func.MsgErr.Equals(""))
                {
                    func.MsgErr = "执行失败(DoMethod_ExeSQL).";
                }
                return("err@" + func.MsgErr + " @ " + ex.Message);
            }
        }
Ejemplo n.º 2
0
        public string MethodDocDemoJS_Init()
        {
            var func = new MethodFunc(this.MyPK);

            return(func.MethodDoc_JavaScript_Demo);
        }
Ejemplo n.º 3
0
        public string MethodDocDemoSQL_Init()
        {
            var func = new MethodFunc(this.MyPK);

            return(func.MethodDoc_SQL_Demo);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 执行SQL
        /// </summary>
        /// <returns></returns>
        public string DoMethodPara_ExeSQL()
        {
            MethodFunc func = new MethodFunc(this.MyPK);
            string     doc  = func.MethodDoc_SQL;

            GEEntity en = new GEEntity(func.FrmID, this.WorkID);

            doc = BP.WF.Glo.DealExp(doc, en, null); //替换里面的内容.

            #region 替换参数变量.
            MapAttrs attrs = new MapAttrs();
            attrs.Retrieve(MapAttrAttr.FK_MapData, this.MyPK);
            foreach (MapAttr item in attrs)
            {
                if (item.UIContralType == UIContralType.TB)
                {
                    doc = doc.Replace("@" + item.KeyOfEn, this.GetRequestVal("TB_" + item.KeyOfEn));
                    continue;
                }

                if (item.UIContralType == UIContralType.DDL)
                {
                    doc = doc.Replace("@" + item.KeyOfEn, this.GetRequestVal("DDL_" + item.KeyOfEn));
                    continue;
                }


                if (item.UIContralType == UIContralType.CheckBok)
                {
                    doc = doc.Replace("@" + item.KeyOfEn, this.GetRequestVal("CB_" + item.KeyOfEn));
                    continue;
                }

                if (item.UIContralType == UIContralType.RadioBtn)
                {
                    doc = doc.Replace("@" + item.KeyOfEn, this.GetRequestVal("RB_" + item.KeyOfEn));
                    continue;
                }
            }
            #endregion 替换参数变量.

            #region 开始执行SQLs.
            try
            {
                DBAccess.RunSQLs(doc);
                if (func.MsgSuccess.Equals(""))
                {
                    func.MsgSuccess = "执行成功.";
                }

                return(func.MsgSuccess);
            }
            catch (Exception ex)
            {
                if (func.MsgErr.Equals(""))
                {
                    func.MsgErr = "执行失败.";
                }

                return("err@" + func.MsgErr + " @ " + ex.Message);
            }
            #endregion 开始执行SQLs.

            return("err@" + func.MethodDocTypeOfFunc + ",执行的类型没有解析.");
        }