【小程序】【在线缴费系统】(六)管理端功能-banner图管理-数据库+逻辑处理
导读部分
教程目录:http://www.sufeinet.com/thread-40967-1-1.html
教程部分
数据库设计:
Model层:
[C#] 纯文本查看 复制代码 using SufeiDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using zaixianjiaofei_demo.Dict;
using zaixianjiaofei_demo.Utils;
namespace zaixianjiaofei_demo.Model
{
/// <summary>
/// 广告图片管理
/// </summary>
public class sys_banner
{
/// <summary>
/// id
/// </summary>
[OrmLiteField(IsPrimaryKey = true, InsertIgnore = true)]
public int id { get; set; }
/// <summary>
/// 名称
/// </summary>
public string title { get; set; }
/// <summary>
/// 类型
/// </summary>
public int type
{
get; set;
}
/// <summary>
/// 类型名称
/// </summary>
[OrmLiteField(Ignore = true)]
public string typename
{
get
{
return bannertype.GetItem(type).Name;
}
}
/// <summary>
/// 图片地址
/// </summary>
public string imgurl { get; set; }
/// <summary>
/// 图片地址
/// </summary>
[OrmLiteField(Ignore = true)]
public string imgurlstr { get { if (!string.IsNullOrEmpty(imgurl)) { return CommonConfig.DefaultDomain + imgurl; } return ""; } }
/// <summary>
///添加时间
/// </summary>
[OrmLiteField(Ignore = true)]
public DateTime addtime { get; set; }
/// <summary>
/// 添加时间str
/// </summary>
[OrmLiteField(Ignore = true)]
public string addtimestr { get { return addtime.ToString("yyyy-MM-dd HH:mm:ss"); } }
}
}
BLL逻辑结构层:
[C#] 纯文本查看 复制代码 using SufeiDAL.BaseApi;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using zaixianjiaofei_demo.Model;
namespace zaixianjiaofei_demo.BLL.data
{
/// <summary>
/// 图片管理
/// </summary>
public class sys_bannerBLL : BaseDAL<sys_banner>
{
/// <summary>
/// 数据库链接字符串
/// </summary>
protected override string ConnName
{
get { return DALConfig.Zaixianjiaofei; }
}
}
}
|