/// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(SchSystem.Model.SchMenuInfoExt model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update SchMenuInfoExt set ");
            strSql.Append("Pid=@Pid,");
            strSql.Append("Expn=@Expn,");
            strSql.Append("NavUrl=@NavUrl,");
            strSql.Append("SelAct=@SelAct,");
            strSql.Append("Targets=@Targets,");
            strSql.Append("TextName=@TextName,");
            strSql.Append("FuncCode=@FuncCode,");
            strSql.Append("FuncLv=@FuncLv,");
            strSql.Append("OrderId=@OrderId,");
            strSql.Append("Ico=@Ico,");
            strSql.Append("Stat=@Stat");
            strSql.Append(" where MenuId=@MenuId");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Pid",      SqlDbType.Int,       4),
                new SqlParameter("@Expn",     SqlDbType.TinyInt,   1),
                new SqlParameter("@NavUrl",   SqlDbType.VarChar, 200),
                new SqlParameter("@SelAct",   SqlDbType.VarChar,  50),
                new SqlParameter("@Targets",  SqlDbType.VarChar,  20),
                new SqlParameter("@TextName", SqlDbType.VarChar,  30),
                new SqlParameter("@FuncCode", SqlDbType.Int,       4),
                new SqlParameter("@FuncLv",   SqlDbType.VarChar,  10),
                new SqlParameter("@OrderId",  SqlDbType.Int,       4),
                new SqlParameter("@Ico",      SqlDbType.VarChar, 300),
                new SqlParameter("@Stat",     SqlDbType.TinyInt,   1),
                new SqlParameter("@MenuId",   SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.Pid;
            parameters[1].Value  = model.Expn;
            parameters[2].Value  = model.NavUrl;
            parameters[3].Value  = model.SelAct;
            parameters[4].Value  = model.Targets;
            parameters[5].Value  = model.TextName;
            parameters[6].Value  = model.FuncCode;
            parameters[7].Value  = model.FuncLv;
            parameters[8].Value  = model.OrderId;
            parameters[9].Value  = model.Ico;
            parameters[10].Value = model.Stat;
            parameters[11].Value = model.MenuId;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public SchSystem.Model.SchMenuInfoExt DataRowToModel(DataRow row)
 {
     SchSystem.Model.SchMenuInfoExt model = new SchSystem.Model.SchMenuInfoExt();
     if (row != null)
     {
         if (row["MenuId"] != null && row["MenuId"].ToString() != "")
         {
             model.MenuId = int.Parse(row["MenuId"].ToString());
         }
         if (row["Pid"] != null && row["Pid"].ToString() != "")
         {
             model.Pid = int.Parse(row["Pid"].ToString());
         }
         if (row["Expn"] != null && row["Expn"].ToString() != "")
         {
             model.Expn = int.Parse(row["Expn"].ToString());
         }
         if (row["NavUrl"] != null)
         {
             model.NavUrl = row["NavUrl"].ToString();
         }
         if (row["SelAct"] != null)
         {
             model.SelAct = row["SelAct"].ToString();
         }
         if (row["Targets"] != null)
         {
             model.Targets = row["Targets"].ToString();
         }
         if (row["TextName"] != null)
         {
             model.TextName = row["TextName"].ToString();
         }
         if (row["FuncCode"] != null && row["FuncCode"].ToString() != "")
         {
             model.FuncCode = int.Parse(row["FuncCode"].ToString());
         }
         if (row["FuncLv"] != null)
         {
             model.FuncLv = row["FuncLv"].ToString();
         }
         if (row["OrderId"] != null && row["OrderId"].ToString() != "")
         {
             model.OrderId = int.Parse(row["OrderId"].ToString());
         }
         if (row["Ico"] != null)
         {
             model.Ico = row["Ico"].ToString();
         }
         if (row["Stat"] != null && row["Stat"].ToString() != "")
         {
             model.Stat = int.Parse(row["Stat"].ToString());
         }
     }
     return(model);
 }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(SchSystem.Model.SchMenuInfoExt model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into SchMenuInfoExt(");
            strSql.Append("Pid,Expn,NavUrl,SelAct,Targets,TextName,FuncCode,FuncLv,OrderId,Ico,Stat)");
            strSql.Append(" values (");
            strSql.Append("@Pid,@Expn,@NavUrl,@SelAct,@Targets,@TextName,@FuncCode,@FuncLv,@OrderId,@Ico,@Stat)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Pid",      SqlDbType.Int,       4),
                new SqlParameter("@Expn",     SqlDbType.TinyInt,   1),
                new SqlParameter("@NavUrl",   SqlDbType.VarChar, 200),
                new SqlParameter("@SelAct",   SqlDbType.VarChar,  50),
                new SqlParameter("@Targets",  SqlDbType.VarChar,  20),
                new SqlParameter("@TextName", SqlDbType.VarChar,  30),
                new SqlParameter("@FuncCode", SqlDbType.Int,       4),
                new SqlParameter("@FuncLv",   SqlDbType.VarChar,  10),
                new SqlParameter("@OrderId",  SqlDbType.Int,       4),
                new SqlParameter("@Ico",      SqlDbType.VarChar, 300),
                new SqlParameter("@Stat",     SqlDbType.TinyInt, 1)
            };
            parameters[0].Value  = model.Pid;
            parameters[1].Value  = model.Expn;
            parameters[2].Value  = model.NavUrl;
            parameters[3].Value  = model.SelAct;
            parameters[4].Value  = model.Targets;
            parameters[5].Value  = model.TextName;
            parameters[6].Value  = model.FuncCode;
            parameters[7].Value  = model.FuncLv;
            parameters[8].Value  = model.OrderId;
            parameters[9].Value  = model.Ico;
            parameters[10].Value = model.Stat;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public SchSystem.Model.SchMenuInfoExt GetModel(int MenuId)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 MenuId,Pid,Expn,NavUrl,SelAct,Targets,TextName,FuncCode,FuncLv,OrderId,Ico,Stat from SchMenuInfoExt ");
            strSql.Append(" where MenuId=@MenuId");
            SqlParameter[] parameters =
            {
                new SqlParameter("@MenuId", SqlDbType.Int, 4)
            };
            parameters[0].Value = MenuId;

            SchSystem.Model.SchMenuInfoExt model = new SchSystem.Model.SchMenuInfoExt();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }