文档介绍:房屋销售管理系统一、HouseManagerDAL数据访问层中设计三个类:(1);using;;;using;;{lassCustomerService{///ustomerGetCustomerByLoginName(stringname){stringsql=("select*fromCustomerswhereLoginName='{0}'",name);returnGetCustomerBySQL(sql);}///ustomerGetCustomerById(intid){stringsql=("select*fromCustomerswhereCustomerId={0}",id);returnGetCustomerBySQL(sql);}///私有方法,ustomerGetCustomerBySQL(stringsql){using(SqlConnectionconn=newSqlConnection()){Customerc=null;try{();mandcmd=mand(sql,conn);SqlDataReadersdr=();if(()){c=newCustomer();=(int)sdr["CustomerId"];=sdr["LoginName"].ToString();=sdr["Password"].ToString();}}catch(Exceptionex){();}finally{();}returnc;}}}}(2)在DBHelper中usingSystem;using;;{lassDBHelper{publicstaticreadonlystringconnectString="server=.;database=HouseDB;uid=sa;pwd=123456";}}(3)在HouseService中usingSystem;using;;;using;;{lassHouseService{///获取所有发布的房屋信息publicstaticIList<House>GetAllHouse(){List<House>houses=newList<House>();using(SqlConnectionconn=newSqlConnection()){try{();mandcmd=mand("select*fromHouses",conn);SqlDataReadersdr=();while(()){Househ=newHouse();=(int)sdr["HouseId"];=sdr["HouseTypeName"].ToString();=(int)sdr["Area"];=(sdr["Price"]);=sdr["Address"].ToString();//=((int)sdr["CustomerId"]);(h);}}catch(Exceptionex){();}finally{();}}returnhouses;}///根据房屋信息主键ID删除发布的房屋信息///<returns>受影响的行数</returns>publicstaticintDeleteHouseById(inthouserId){intcount=0;using(SqlConne