/// <summary> /// 获得js,sql内容. /// </summary> /// <returns></returns> public string MethodDoc_GetScript() { var en = new BP.Frm.MethodFunc(this.MyPK); int type = this.GetRequestValInt("TypeOfFunc"); if (type == 0) { return(en.MethodDoc_SQL); } if (type == 1) { return(en.MethodDoc_JavaScript); } if (type == 2) { return(en.MethodDoc_Url); } return("err@没有判断的类型."); }
/// <summary> /// 保存脚本 /// </summary> /// <returns></returns> public string MethodDoc_SaveScript() { var en = new BP.Frm.MethodFunc(this.MyPK); int type = this.GetRequestValInt("TypeOfFunc"); string doc = this.GetRequestVal("doc"); //sql模式. if (type == 0) { en.MethodDoc_SQL = doc; } //script. if (type == 1) { en.MethodDoc_JavaScript = doc; //string path=SystemConfig.PathOfDataUser + "JSLibData\\Method\\" ; //if (System.IO.Directory.Exists(path) == false) // System.IO.Directory.CreateDirectory(path); ////写入文件. //string file = path + en.MyPK + ".js"; //DataType.WriteFile(file, doc); } //url. if (type == 2) { en.MethodDoc_Url = doc; } en.MethodDocTypeOfFunc = type; en.Update(); return("保存成功."); }