예제 #1
0
        public IEnumerable <PrincipalModel> GetPrincipal()
        {
            string sql = "SELECT Principal.Id,PrincipalName,PrincipalPhone,CommodityName,Enter,CommodityId,PrImage,Email,QQ,WeChat,CommodityPhone,CommoditySite,CommodityState,CommodityArgot FROM Principal INNER JOIN Commodity ON Principal.CommodityId = Commodity.Id";

            return(DapperHelper <PrincipalModel> .Query(sql, null));
        }
예제 #2
0
        /// <summary>
        /// 获取经纪人信息
        /// </summary>
        /// <returns></returns>
        public IEnumerable <PrincipalModel> GetPrincipalById(int id)
        {
            string sql = $"select * from Principal p join Commodity c on c.Id =p.CommodityId where p.Id={id}";

            return(DapperHelper <PrincipalModel> .Query(sql, null));
        }
예제 #3
0
 //添加客户信息
 public int AddClientInfo(ClientInfoModel cm)
 {
     return(DapperHelper <ClientInfoModel> .Execute($"insert into ClientInfo values('{cm.ClientName}','{cm.ClientPhone}',{cm.ClientSex})", null));
 }
예제 #4
0
        public IEnumerable <HouseCollectModel> GetHouseCollect()
        {
            string sql = $"select * from HouseCollect where HouseType=7  and HouseModel=1";

            return(DapperHelper <HouseCollectModel> .Query(sql, null));
        }
예제 #5
0
        //获取商家信息
        public List <CommodityModel> CommodityShow()
        {
            string str = "select *from Commodity";

            return(DapperHelper <CommodityModel> .Query(str, null));
        }
예제 #6
0
 //添加商家信息
 public int AddCommodity(CommodityModel cdm)
 {
     return(DapperHelper <CommodityModel> .Execute($"insert into Commodity values('{cdm.CommodityName}','{cdm.CommodityPhone}','{cdm.CommoditySite}','{cdm.CommodityArgot}','{cdm.CommodityState}')", null));
 }
예제 #7
0
        /// <summary>
        /// 删除新房源
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DelHouse(int id)
        {
            string sql = $"Delete from HouseCollect where Id={id}";

            return(DapperHelper <HouseCollectModel> .Execute(sql, null));
        }
예제 #8
0
        //根据id查询二维码
        public string GetUrl(int id)
        {
            string str = "select WeChat from Principal where Id=" + id;

            return(DapperHelper <string> .ExecuteScalarForT(str, null));
        }
예제 #9
0
        /// <summary>
        /// 获取经纪人信息
        /// </summary>
        /// <returns></returns>
        public List <PrincipalModel> GetPrincipals()
        {
            string sql = "select * from GetPrincipals";

            return(DapperHelper <PrincipalModel> .Query(sql, null));
        }
예제 #10
0
        /// <summary>
        /// 显示新房源
        /// </summary>
        /// <returns></returns>
        public IEnumerable <HouseCollectModel> houseCollects()
        {
            string sql = " select * from HouseCollect  where HouseModel =1";

            return(DapperHelper <HouseCollectModel> .Query(sql, null));
        }
예제 #11
0
        /// <summary>
        /// 添加房源
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int AddHouse(HouseCollectModel model)
        {
            string sql = $"insert into HouseCollect values('{model.HouseName}','{model.HouseSite}','{model.HouseInfo}',{model.HouseType},{model.HouseGradation},{model.HouseSum},{model.HousePrice},{model.HouseArea},'Wybimages/{model.HouseImage}','{model.HouseIntro}',{model.HouseModel},'{model.HouseTenement}/m²',{model.HouseNumber})";

            return(DapperHelper <HouseCollectModel> .Execute(sql, null));
        }
예제 #12
0
        /// <summary>
        /// 显示房屋类型
        /// </summary>
        /// <returns></returns>
        public IEnumerable <HouseTypeModel> GetHT()
        {
            string sql = "select * from HouseType";

            return(DapperHelper <HouseTypeModel> .Query(sql, null));
        }
예제 #13
0
        //获取客户信息
        public IEnumerable <ClientInfoModel> GetClientInfo()
        {
            string str = "select *from ClientInfo";

            return(DapperHelper <ClientInfoModel> .Query(str, null));
        }
예제 #14
0
 //删除经纪人信息
 public int DelPrincipal(int id)
 {
     return(DapperHelper <PrincipalModel> .Execute("delete from Principal where Id=" + id, null));
 }
예제 #15
0
        /// <summary>
        /// 查询新房
        /// </summary>
        /// <param name="HouseModel"></param>
        /// <param name="HouseType"></param>
        /// <returns></returns>
        public IEnumerable <HouseCollectModel> collectModels(string name)
        {
            string sql = $"select * from HouseCollect  where HouseName like '%{name}%'";

            return(DapperHelper <HouseCollectModel> .Query(sql, null));
        }
예제 #16
0
 /// <summary>
 /// 添加经纪人信息
 /// </summary>
 /// <param name="principalModel"></param>
 /// <returns></returns>
 public int AddPrincipal(PrincipalModel principalModel)
 {
     return(DapperHelper <PrincipalModel> .Execute($"insert into Principal values('{principalModel.PrincipalName}','{principalModel.PrincipalPhone}',{principalModel.CommodityId},'{principalModel.Enter}','{principalModel.PrImage}','{principalModel.Email}','{principalModel.QQ}','{principalModel.WeChat}')", null));
 }
예제 #17
0
        /// <summary>
        /// 获取房屋状态
        /// </summary>
        /// <returns></returns>
        public IEnumerable <RoomTypeModel> roomTypes()
        {
            string sql = "select * from HouseModel";

            return(DapperHelper <RoomTypeModel> .Query(sql, null));
        }
예제 #18
0
 /// <summary>
 /// 获取商家信息
 /// </summary>
 /// <returns></returns>
 public IEnumerable <CommodityModel> GetCommodities()
 {
     return(DapperHelper <CommodityModel> .Query("select * from Commodity", null));
 }
예제 #19
0
        /// <summary>
        /// 添加新房源
        /// </summary>
        /// <param name="house"></param>
        /// <returns></returns>
        public int AddNewH(HouseCollectModel house)
        {
            string sql = $"insert into HouseCollect values('{house.HouseName}','{house.HouseSite}','{house.HouseInfo}',{house.HouseType},{house.HouseGradation},{house.HouseSum},{house.HousePrice},{house.HouseArea},'Hxlimage/{house.HouseImage}','{house.HouseIntro}',{house.HouseModel},{house.HouseTenement},{house.HouseNumber})";

            return(DapperHelper <HouseCollectModel> .Execute(sql, null));
        }
예제 #20
0
 //删除商家信息
 public int DelCommodity(int id)
 {
     return(DapperHelper <CommodityModel> .Execute("delete from Commodity where Id=" + id, null));
 }
예제 #21
0
        /// <summary>
        /// 根据id显示房子具体信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public IEnumerable <HouseCollectModel> houses(int id)
        {
            string sql = $"select * from HouseCollect join HouseType on HouseCollect.HouseType=HouseType.Tid  where HouseCollect.Id={id}";

            return(DapperHelper <HouseCollectModel> .Query(sql, null));
        }
예제 #22
0
        ////自己创建个类写  这样分开好做 别写我这里面了!!!!!!!!!!!!


        /// <summary>
        /// 显示租房列表
        /// </summary>
        /// <returns></returns>
        public IEnumerable <HouseCollectModel> GetUsedHouse()
        {
            string sql = "select * from HouseCollect";

            return(DapperHelper <HouseCollectModel> .Query(sql, null));
        }
예제 #23
0
 //删除客户信息
 public int  DelClientInfo(int id)
 {
     return(DapperHelper <ClientInfoModel> .Execute("delete from ClientInfo where Id=" + id, null));
 }