Util.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:2k
- using System;
- using System.Text;
- using System.Data.SqlClient;
- using com.etong.SqlDataConnect;
- using System.Data;
- using System.IO;
- using System.Web;
- namespace com.etong.Utility
- {
- public class Util
- {
- private MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
- public Util()
- {
- //
- // TODO: 在此处添加构造函数逻辑
- //
- }
- /// <summary>
- /// 获取左边菜单列表
- /// </summary>
- /// <param name="i">表示菜单的父id</param>
- /// <returns></returns>
- public DataView GetPermission(string i)
- {
- if (i == "" || i == null)
- return null;
- string strSQL = "select * from Tb_Sys_Permission where ParentresCode='" + i.Trim() + "'";
-
- DataSet ds = new DataSet();
- MSDA.Open();
- MSDA.ExecuteDataset(CommandType.Text, strSQL, null, ds, "");
- MSDA.Close();
- return ds.Tables[0].DefaultView;
- }
- public static bool Copyfile(string sourcefilenme, string targetfilename)
- {
- //string fullpath = System.Environment.CurrentDirectory;
- //string path = Server.MapPath("Workflow/doc");
- //string path
- //string sourcepath = "C:\Inetpub\wwwroot\ASP\SOAaspcode\doc\" + sourcefilenme;
- //string targetpath= "C:\Inetpub\wwwroot\ASP\SOAaspcode\doc\DocTemplate\" + targetfilename;
- //string sourcepath = path + sourcefilenme;
- //string targetpath = path + targetfilename;
- try
- {
- File.Copy(sourcefilenme, targetfilename);
- return true;
- }
- catch
- {
- return false;
- }
- }
- }
- }