using BP.DA; using BP.WF.HttpHandler; using BP.CCBill.Template; namespace BP.CCBill { /// /// 页面功能实体 /// public class WF_CCBill_Admin_MethodDoc : DirectoryPageBase { #region 属性. public string GroupID { get { string str = this.GetRequestVal("GroupID"); return str; } } #endregion 属性. /// /// 构造函数 /// public WF_CCBill_Admin_MethodDoc() { } /// /// 移动方法. /// /// public string MethodParas_Mover() { string[] ens = this.GetRequestVal("MyPKs").Split(','); for (int i = 0; i < ens.Length; i++) { string enNo = ens[i]; string sql = "UPDATE Sys_MapAttr SET Idx=" + i + " WHERE MyPK='" + enNo + "'"; DBAccess.RunSQL(sql); } return "方法顺序移动成功.."; } /// /// 获得js,sql内容. /// /// public string MethodDoc_GetScript() { MethodFunc en = new MethodFunc(this.No); 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@没有判断的类型."; } /// /// 保存脚本 /// /// public string MethodDoc_SaveScript() { MethodFunc en = new MethodFunc(this.No); int type = this.GetRequestValInt("TypeOfFunc"); string doc = this.GetRequestVal("doc"); string funcstr = this.GetRequestVal("funcstr"); //sql模式. if (type == 0) { doc = doc.Replace("/#", "+"); doc = doc.Replace("/$", "-"); en.MethodDoc_SQL = doc; } //script. if (type == 1) { en.MethodDoc_JavaScript = doc; string path = BP.Difference.SystemConfig.PathOfDataUser + "JSLibData/Method/"; if (System.IO.Directory.Exists(path) == false) System.IO.Directory.CreateDirectory(path); //写入文件. string file = path + en.No + ".js"; funcstr = funcstr.Replace("/#", "+"); funcstr = funcstr.Replace("/$", "-"); DataType.WriteFile(file, funcstr); } //url. 、 methond. if (type == 2 || type == 3) en.Tag1 = this.GetRequestVal("Tag1"); en.MethodDocTypeOfFunc = type; en.DirectUpdate(); return "保存成功."; } } }