示例#1
0
        public List<FullHouse> Query(QueryHouseServiceForm form)
        {
            //form.OwnerID = "";
            List<FullHouse> list = new List<FullHouse>();
            ISqlMapper mapper = MapperHelper.GetMapper();

            HouseDao dao = new HouseDao(mapper);
            House_CustomerDao hcdao = new House_CustomerDao(mapper);
            CustomerDao customerdao = new CustomerDao(mapper);
            BuildingDao buildingdao = new BuildingDao(mapper);
            var house = dao.QueryFullHouse(form);
            var houseids = (from h in house select h.ID).ToList();
            var hos = hcdao.Query(new House_CustomerQueryForm { HouseOrRoomIDs = houseids });
            var customerids = (from ho in hos select ho.CustomerID).Distinct().ToList();
            var customers = customerdao.Query(new CustomerQueryForm { IDs = customerids, Enabled = 1, IsDeleted = 0 });
            var buildingids = (from h in house select h.BuildingID).Distinct().ToList();
            var buidlings = buildingdao.Query(new BuildingQueryForm { IDs = buildingids });
            foreach (var h in house)
            {
                FullHouse fh = new FullHouse
                {
                    House = h,
                    Customer = (from ho in hos
                                join c in customers on ho.CustomerID equals c.ID
                                where ho.HouseOrRoomID.Equals(h.ID)
                                select c).FirstOrDefault(),
                    Building = buidlings.Find(t => t.ID.Equals(h.BuildingID)),
                };
                list.Add(fh);
            }
            return list;
        }
示例#2
0
 public List<FullHouse> Query(QueryHouseServiceForm form)
 {
     form.IsDeleted = 0;
     form.Enabled = 1;
     form.IsOurs = 1;
     return bll.Query(form);
 }
示例#3
0
        public int QueryCount(QueryHouseServiceForm form)
        {
            form.OwnerID = "";
            List<FullHouse> list = new List<FullHouse>();
            ISqlMapper mapper = MapperHelper.GetMapper();

            HouseDao dao = new HouseDao(mapper);
            return dao.QueryFullHouseCount(form);
        }
示例#4
0
 public List<FullHouse> Query(QueryHouseServiceForm form)
 {
     UserBLL userbll = new UserBLL();
     var ids = Common.GetDataAuthorityUserIDList();
     form.IsDeleted = 0;
     form.OwnerIDs = ids;
     form.IsOurs = 1;
     //MonitorCache.GetInstance().PushMessage(new CacheMessage { Message = "ids:" + string.Join(",", ids) }, SOAFramework.Library.CacheEnum.FormMonitor);
     return bll.QueryFullHouse(form);
 }
示例#5
0
 public PagingEntity<FullHouse> QueryPaging(QueryHouseServiceForm form)
 {
     form.IsDeleted = 0;
     form.Enabled = 1;
     form.IsOurs = 1;
     PagingEntity<FullHouse> result = new PagingEntity<FullHouse>();
     result.Record = bll.Query(form);
     result.RecordCount = bll.QueryCount(form);
     return result;
 }
示例#6
0
        public List<FullHouse> QueryFullHouse(QueryHouseServiceForm form)
        {
            List<FullHouse> list = new List<FullHouse>();
            ISqlMapper mapper = MapperHelper.GetMapper();

            HouseDao dao = new HouseDao(mapper);
            House_CustomerDao hcdao = new House_CustomerDao(mapper);
            CustomerDao customerdao = new CustomerDao(mapper);
            BuildingDao buildingdao = new BuildingDao(mapper);
            RentFeeDao rfdao = new RentFeeDao(mapper);
            House_OtherFeeDao hofdao = new House_OtherFeeDao(mapper);
            OtherFeeDao ofdao = new OtherFeeDao(mapper);
            var house = dao.QueryFullHouse(form);
            var houseids = (from h in house select h.ID).ToList();
            var hcs = hcdao.Query(new House_CustomerQueryForm { HouseOrRoomIDs = houseids });
            var customerids = (from ho in hcs select ho.CustomerID).Distinct().ToList();
            var customers = customerdao.Query(new CustomerQueryForm { IDs = customerids, Enabled = 1, IsDeleted = 0, });
            var buildingids = (from h in house select h.BuildingID).Distinct().ToList();
            var buidlings = buildingdao.Query(new BuildingQueryForm { IDs = buildingids });
            var rentfees = rfdao.Query(new RentFeeQueryForm { HouseOrRoomIDs = houseids, Enabled = 1, IsDeleted = 0 });
            var rentfeeids = (from rf in rentfees select rf.ID).ToList();
            var hos = hofdao.Query(new House_OtherFeeQueryForm { HouseOrRoomIDs = houseids });
            var otherfeeids = (from ho in hos select ho.OtherFeeID).Distinct().ToList();
            var ofs = ofdao.Query(new OtherFeeQueryForm { IDs = otherfeeids });
            foreach (var h in house)
            {
                FullHouse fh = new FullHouse
                {
                    House = h,
                    Customer = (from ho in hcs
                                join c in customers on ho.CustomerID equals c.ID
                                where ho.HouseOrRoomID.Equals(h.ID) && c.Type == (int)CustomerType.业主
                                select c).FirstOrDefault(),
                    Building = buidlings.Find(t => t.ID.Equals(h.BuildingID)),
                    RentFee = rentfees.Find(t => t.HouseOrRoomID.Equals(h.ID)),
                    OtherFees = (from ho in hos
                                 join of in ofs on ho.OtherFeeID equals of.ID
                                 where ho.HouseOrRoomID.Equals(h.ID)
                                 select of).ToList(),
                    Renter = (from ho in hcs
                              join c in customers on ho.CustomerID equals c.ID
                              where ho.HouseOrRoomID.Equals(h.ID) && c.Type == (int)CustomerType.租客
                              select c).FirstOrDefault(),
                };
                list.Add(fh);
            }
            return list;
        }
示例#7
0
 public PagingEntity<FullHouse> QueryUnallocateHousePaging(QueryHouseServiceForm form)
 {
     form.Enabled = 1;
     form.OwnerID = "";
     form.IsOurs = 0;
     return QueryHousePaging(form);
 }
示例#8
0
 public List<FullHouse> QueryUnallocateHouse(QueryHouseServiceForm form)
 {
     form.Enabled = 1;
     form.OwnerID = "";
     form.IsOurs = 0;
     return QueryHouse(form);
 }
示例#9
0
 public PagingEntity<FullHouse> QuerySelfHousePaging(QueryHouseServiceForm form)
 {
     var ids = Common.GetDataAuthorityUserIDList();
     form.OwnerIDs = ids;
     form.Enabled = 1;
     return QueryHousePaging(form);
 }
示例#10
0
 public PagingEntity<FullHouse> QuerySelfAndUnallocateHousePaging(QueryHouseServiceForm form)
 {
     var ids = Common.GetDataAuthorityUserIDList();
     if (ids != null) ids.Add("");
     form.OwnerIDs = ids;
     form.Enabled = 1;
     return QueryHousePaging(form);
 }
示例#11
0
 public PagingEntity<FullHouse> QueryHousePaging(QueryHouseServiceForm form)
 {
     form.IsDeleted = 0;
     PagingEntity<FullHouse> result = new PagingEntity<FullHouse>();
     result.Record = housebll.QueryFullHouse(form);
     result.RecordCount = housebll.QueryFullHouseCount(form);
     return result;
 }
示例#12
0
 public List<FullHouse> QueryHouse(QueryHouseServiceForm form)
 {
     form.IsDeleted = 0;
     return housebll.QueryFullHouse(form);
 }
示例#13
0
 public PagingEntity<FullHouse> QueryAllocateHousePaging(QueryHouseServiceForm form)
 {
     form.Enabled = 1;
     form.IsOurs = 1;
     return QueryHousePaging(form);
 }
示例#14
0
 public List<FullHouse> QueryAllocateHouse(QueryHouseServiceForm form)
 {
     form.Enabled = 1;
     form.IsOurs = 1;
     return QueryHouse(form);
 }
示例#15
0
        public List<FullHouse> QueryFullHouse(QueryHouseServiceForm form)
        {
            List<FullHouse> list = new List<FullHouse>();
            ISqlMapper mapper = MapperHelper.GetMapper();
            UserBLL userbll = new UserBLL();

            HouseDao dao = new HouseDao(mapper);
            House_CustomerDao hcdao = new House_CustomerDao(mapper);
            CustomerDao customerdao = new CustomerDao(mapper);
            BuildingDao buildingdao = new BuildingDao(mapper);
            FollowupDao followupdao = new FollowupDao(mapper);
            form.IsDeleted = 0;
            var house = dao.QueryFullHouse(form);
            var houseids = (from h in house select h.ID).ToList();
            var hos = hcdao.Query(new House_CustomerQueryForm { HouseOrRoomIDs = houseids });
            var customerids = (from ho in hos select ho.CustomerID).Distinct().ToList();
            var customers = customerdao.Query(new CustomerQueryForm { IDs = customerids, Enabled = 1, IsDeleted = 0 });
            var buildingids = (from h in house select h.BuildingID).Distinct().ToList();
            var buidlings = buildingdao.Query(new BuildingQueryForm { IDs = buildingids });
            //var ownerids = (from h in house where !string.IsNullOrEmpty(h.OwnerID.Trim()) select h.OwnerID).Distinct().ToList();
            var users = userbll.Query(new FullUserQueryForm { Enabled = 1, IsDeleted = 0 });
            var followups = followupdao.Query(new FollowupQueryForm { HouseIDs = houseids });
            var fullfollowup = (from f in followups
                                join u in users on f.Creator equals u.ID
                                select new FullFollowup
                                {
                                    ID = f.ID,
                                    Creator = f.Creator,
                                    CreateTime = f.CreateTime,
                                    HouseID = f.HouseID,
                                    Name = f.Name,
                                    CreatorName = u.CnName,
                                    Remark = f.Remark
                                }).ToList();
            //var rentfee = rentfeebll.Query(new RentFeeQueryForm { HouseOrRoomIDs = houseids, Type = (int)HouseOrRoomType.House, Enabled = 1, IsDeleted = 0 });
            //var house_otherfee = hobll.Query(new House_OtherFeeQueryForm { HouseOrRoomIDs = houseids, Type = (int)HouseOrRoomType.House });
            //var otherfee = ofbll.Query(new OtherFeeQueryForm { Enabled = 1, IsDeleted = 0 });
            foreach (var h in house)
            {
                FullHouse fh = new FullHouse
                {
                    House = h,
                    //RentFee = rentfee.Find(t => t.HouseOrRoomID.Equals(h.ID)),
                    //OtherFees = (from ho in house_otherfeeu
                    //join of in otherfee on ho.OtherFeeID equals of.ID
                    //where ho.HouseOrRoomID.Equals(h.ID)
                    //select of).ToList(),
                    Customer = (from ho in hos
                                join c in customers on ho.CustomerID equals c.ID
                                where ho.HouseOrRoomID.Equals(h.ID)
                                select c).FirstOrDefault(),
                    Building = buidlings.Find(t => t.ID.Equals(h.BuildingID)),
                    Owner = users.Find(t => t.ID.Equals(h.OwnerID)),
                    Followups = fullfollowup.FindAll(t => t.HouseID.Equals(h.ID)),
                };

                //rentfee.Remove(fh.RentFee);
                //house_otherfee.RemoveAll(t => t.HouseOrRoomID.Equals(fh.House.ID));
                list.Add(fh);
            }
            return list;
        }
示例#16
0
 public int QueryFullHouseCount(QueryHouseServiceForm form)
 {
     ISqlMapper mapper = MapperHelper.GetMapper();
     HouseDao dao = new HouseDao(mapper);
     form.IsDeleted = 0;
     return dao.QueryFullHouseCount(form);
 }