资源简介

CS开发模式,小区物业系统,代码完全,SQLSERVER数据库需要将MDB文件导入就可使用(改数据库地址)。适合新手练习或者公司个人二次开发。

资源截图

代码片段和文件信息

using System;
using System.Data;
using System.Text;
using System.Data.OleDb;
using zoruan.DBUtility;//请先添加引用
namespace zoruan.DAL
{
/// 
/// 数据访问类Building。
/// 

public class BuildingDAL
{
        public BuildingDAL()
{}
#region  成员方法

/// 
/// 是否存在该记录
/// 

public bool Exists(int Building_ID)
{
StringBuilder strSql=new StringBuilder();
strSql.Append(“select count(1) from Building“);
strSql.Append(“ where Building_ID=@Building_ID “);
OleDbParameter[] parameters = {
new OleDbParameter(“@Building_ID“ OleDbType.Integer4)};
parameters[0].Value = Building_ID;

return DbHelperOleDb.Exists(strSql.ToString()parameters);
}


/// 
/// 增加一条数据
/// 

public int Add(zoruan.Model.Building model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append(“insert into Building(“);
strSql.Append(“Building_Name)“);
strSql.Append(“ values (“);
strSql.Append(“@Building_Name)“);
OleDbParameter[] parameters = {
new OleDbParameter(“@Building_Name“ OleDbType.VarChar50)};
parameters[0].Value = model.Building_Name;

return DbHelperOleDb.ExecuteSql(strSql.ToString()parameters);
}
/// 
/// 更新一条数据
/// 

public int Update(zoruan.Model.Building model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append(“update Building set “);
strSql.Append(“Building_Name=@Building_Name“);
strSql.Append(“ where Building_ID=@Building_ID “);
OleDbParameter[] parameters = {
new OleDbParameter(“@Building_Name“ OleDbType.VarChar50)
                    new OleDbParameter(“@Building_ID“ OleDbType.Integer4)};
            parameters[0].Value = model.Building_Name;
parameters[1].Value = model.Building_ID;


    return DbHelperOleDb.ExecuteSql(strSql.ToString()parameters);
}

/// 
/// 删除一条数据
/// 

public int Delete(int Building_ID)
{

StringBuilder strSql=new StringBuilder();
strSql.Append(“delete from Building “);
strSql.Append(“ where Building_ID=@Building_ID “);
OleDbParameter[] parameters = {
new OleDbParameter(“@Building_ID“ OleDbType.Integer4)};
parameters[0].Value = Building_ID;

    return DbHelperOleDb.ExecuteSql(strSql.ToString()parameters);
}


/// 
/// 得到一个对象实体
/// 

public zoruan.Model.Building GetModel(int Building_ID)
{

StringBuilder strSql=new StringBuilder();
strSql.Append(“select Building_IDBuilding_Name from Building “);
strSql.Append(“ where Building_ID=@Building_ID “);
OleDbParameter[] parameters = {
new OleDbParameter(“@Building_ID“ OleDbType.Integer4)};
parameters[0].Value = Building_ID;

zoruan.Model.Building model=new zoruan.Model.Building();
DataSet ds=DbHelperOleDb.Query(strSql.ToString()parameters);
if(ds.Tables[0].Rows.Count>0)
{
if(d

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     90624  2016-04-27 02:28  小区物业管理系统源码\.vs\WuYe\v14\.suo

     文件      65536  2019-06-26 15:48  小区物业管理系统源码\DAL\bin\Debug\DAL.dll

     文件      93696  2019-06-26 15:48  小区物业管理系统源码\DAL\bin\Debug\DAL.pdb

     文件    3543552  2014-09-15 13:45  小区物业管理系统源码\DAL\bin\Debug\DevComponents.DotNetBar2.dll

     文件     102400  2014-09-15 13:45  小区物业管理系统源码\DAL\bin\Debug\IBatisNet.Common.dll

     文件     249856  2014-09-15 13:45  小区物业管理系统源码\DAL\bin\Debug\IBatisNet.DataMapper.dll

     文件      86016  2019-06-26 15:48  小区物业管理系统源码\DAL\bin\Debug\Maticsoft.DBUtility.dll

     文件     212480  2019-06-26 15:48  小区物业管理系统源码\DAL\bin\Debug\Maticsoft.DBUtility.pdb

     文件    1100392  2007-10-10 09:48  小区物业管理系统源码\DAL\bin\Debug\Microsoft.Office.Interop.Excel.dll

     文件      64088  2007-10-10 09:48  小区物业管理系统源码\DAL\bin\Debug\Microsoft.Vbe.Interop.dll

     文件      16896  2019-06-26 15:04  小区物业管理系统源码\DAL\bin\Debug\Model.dll

     文件      89600  2019-06-26 15:04  小区物业管理系统源码\DAL\bin\Debug\Model.pdb

     文件     274432  2014-09-15 13:45  小区物业管理系统源码\DAL\bin\Debug\MySql.Data.dll

     文件     223800  2007-10-10 09:48  小区物业管理系统源码\DAL\bin\Debug\office.dll

    .......     50688  2014-09-15 13:45  小区物业管理系统源码\DAL\bin\Release\DAL.pdb

    .......    102400  2014-09-15 13:45  小区物业管理系统源码\DAL\bin\Release\IBatisNet.Common.dll

    .......    249856  2014-09-15 13:45  小区物业管理系统源码\DAL\bin\Release\IBatisNet.DataMapper.dll

    .......     57344  2014-09-15 13:45  小区物业管理系统源码\DAL\bin\Release\Maticsoft.DBUtility.dll

    .......      9728  2014-09-15 13:45  小区物业管理系统源码\DAL\bin\Release\Model.dll

    .......     46592  2014-09-15 13:45  小区物业管理系统源码\DAL\bin\Release\Model.pdb

    .......    274432  2014-09-15 13:45  小区物业管理系统源码\DAL\bin\Release\MySql.Data.dll

    .......      4681  2014-09-15 13:45  小区物业管理系统源码\DAL\BuildingDAL.cs

    .......     42027  2014-09-15 13:45  小区物业管理系统源码\DAL\CostListDAL.cs

    .......      2933  2014-09-15 13:45  小区物业管理系统源码\DAL\DAL.csproj

    .......      5497  2014-09-15 13:45  小区物业管理系统源码\DAL\FloorDAL.cs

    .......     13651  2014-09-15 13:45  小区物业管理系统源码\DAL\HouseholdListDAL.cs

     文件       6385  2019-06-26 15:04  小区物业管理系统源码\DAL\obj\Debug\DAL.csproj.FileListAbsolute.txt

     文件      46824  2019-06-26 15:48  小区物业管理系统源码\DAL\obj\Debug\DAL.csprojResolveAssemblyReference.cache

     文件      65536  2019-06-26 15:48  小区物业管理系统源码\DAL\obj\Debug\DAL.dll

     文件      93696  2019-06-26 15:48  小区物业管理系统源码\DAL\obj\Debug\DAL.pdb

............此处省略442个文件信息

评论

共有 条评论