コード例 #1
0
        /// <summary>
        /// 修改ModulInfo
        /// </summary>
        /// <param name="modul"></param>
        /// <returns></returns>
        public static int UpdateModul(ModulInfo modul)
        {
            string sql = @"UPDATE  [Modul] SET 
						ModulName=@ModulName,
						Controller=@Controller,
						Action=@Action,
						Description=@Description,
						CreateTime=@CreateTime,
						PId=@PId,
						OrderId=@OrderId,
						IsShow=@IsShow,
						Priority=@Priority,
						IsDisplay=@IsDisplay,
						Ico=@Ico
 WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", modul.Id, DbType.Int32);
            par.Add("@ModulName", modul.ModulName, DbType.String);
            par.Add("@Controller", modul.Controller, DbType.AnsiString);
            par.Add("@Action", modul.Action, DbType.AnsiString);
            par.Add("@Description", modul.Description, DbType.String);
            par.Add("@CreateTime", modul.CreateTime, DbType.DateTime);
            par.Add("@PId", modul.PId, DbType.Int32);
            par.Add("@OrderId", modul.OrderId, DbType.Int32);
            par.Add("@IsShow", modul.IsShow, DbType.Boolean);
            par.Add("@Priority", modul.Priority, DbType.Int32);
            par.Add("@IsDisplay", modul.IsDisplay, DbType.Boolean);
            par.Add("@Ico", modul.Ico, DbType.AnsiString);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
コード例 #2
0
 /// <summary>
 /// DataModel 转 ViewModel
 /// </summary>
 /// <param name="modul"></param>
 /// <returns></returns>
 public static ModulVModel ModulInfoToVModel(ModulInfo modul)
 {
     if (modul == null)
     {
         return(new ModulVModel());
     }
     return(new ModulVModel
     {
         Id = modul.Id,
         ModulName = modul.ModulName,
         Controller = modul.Controller,
         Action = modul.Action,
         Description = modul.Description,
         CreateTime = modul.CreateTime,
         PId = modul.PId,
         OrderId = modul.OrderId,
         IsShow = modul.IsShow,
         Priority = modul.Priority,
         IsDisplay = modul.IsDisplay,
         Ico = modul.Ico
     });
 }
コード例 #3
0
ファイル: Moduls.cs プロジェクト: szp11/HGShareBBS
        /// <summary>
        /// 添加ModulInfo
        /// </summary>
        /// <param name="modul"></param>
        /// <returns></returns>
        public static int AddModul(ModulInfo modul)
        {
            string sql = @"INSERT INTO Modul
			([ModulName],[Controller],[Action],[Description],[PId],[OrderId],[IsShow],[Priority],[IsDisplay],[Ico])
			VALUES
			(@ModulName,@Controller,@Action,@Description,@PId,@OrderId,@IsShow,@Priority,@IsDisplay,@Ico) 
			SELECT SCOPE_IDENTITY()
			"            ;
            var    par = new DynamicParameters();

            par.Add("@ModulName", modul.ModulName, DbType.String);
            par.Add("@Controller", modul.Controller, DbType.AnsiString);
            par.Add("@Action", modul.Action, DbType.AnsiString);
            par.Add("@Description", modul.Description, DbType.String);
            par.Add("@PId", modul.PId, DbType.Int32);
            par.Add("@OrderId", modul.OrderId, DbType.Int32);
            par.Add("@IsShow", modul.IsShow, DbType.Boolean);
            par.Add("@Priority", modul.Priority, DbType.Int32);
            par.Add("@IsDisplay", modul.IsDisplay, DbType.Boolean);
            par.Add("@Ico", modul.Ico, DbType.AnsiString);
            return(DapWrapper.InnerQueryScalarSql <int>(DbConfig.ArticleManagerConnString, sql, par));
        }
コード例 #4
0
 /// <summary>
 /// 修改ModulInfo
 /// </summary>
 /// <param name="modul"></param>
 /// <returns></returns>
 public static int UpdateModul(ModulInfo modul)
 {
     return(DataProvider.Moduls.UpdateModul(modul));
 }
コード例 #5
0
 /// <summary>
 /// 添加ModulInfo
 /// </summary>
 /// <param name="modul"></param>
 /// <returns></returns>
 public static int AddModul(ModulInfo modul)
 {
     return(DataProvider.Moduls.AddModul(modul));
 }