/// <summary> /// 拆迁详情 /// </summary> /// <param name="filters"></param> /// <param name="start"></param> /// <param name="limit"></param> /// <returns></returns> public WJ_CqxmsModel GetCqxmModel(int cqid) { WJ_FilesDAL dal = new WJ_FilesDAL(); WJ_CqxmsModel model = new WJ_CqxmsModel(); using (Entities db = new Entities()) { IQueryable <WJ_CqxmsModel> queryable = from a in db.wj_cqxms join b_join in db.base_users on a.createuserid equals b_join.id into bTmp from b in bTmp.DefaultIfEmpty() join c_join in db.base_zds on new { ssqy = a.ssqy, zd_type = "type_cq" } equals new { ssqy = c_join.zd_id, zd_type = c_join.zd_type } into cTmp from c in cTmp.DefaultIfEmpty() where a.cqid == cqid select new WJ_CqxmsModel { cqid = a.cqid, projectname = a.projectname, projectleader = a.projectleader, contackphone = a.contackphone, starttime = a.starttime, endtime = a.endtime, address = a.address, ssqyname = c == null ? "" : c.zd_name, createusername = b == null ? "" : b.displayname, cqarea = a.cqarea, ssqy = a.ssqy, geography = a.geography, remark = a.remark, }; model = queryable.FirstOrDefault(); if (model != null) { model.wjfilelist = dal.GetFileList(model.cqid, 2); model.path = "DemolitionOriginalPath"; } return(model); } }
/// <summary> /// 获取违建详情 /// </summary> /// <param name="wjid"></param> /// <returns></returns> public WJ_WzjzsModel GetWzjzModel(int wjid) { WJ_WzjzsModel model = new WJ_WzjzsModel(); WJ_FilesDAL dal = new WJ_FilesDAL(); using (Entities db = new Entities()) { IQueryable <WJ_WzjzsModel> queryable = from a in db.wj_wzjzs join b_join in db.base_users on a.createuserid equals b_join.id into btmp from b in btmp.DefaultIfEmpty() join c_join in db.base_zds on new { a1 = a.wj_wjtype, b1 = "type_wj_wjlx" } equals new { a1 = c_join.zd_id, b1 = c_join.zd_type } into ctmp from c in ctmp.DefaultIfEmpty() where a.wjid == wjid select new WJ_WzjzsModel { wjid = a.wjid, wjholder = a.wjholder, contactphone = a.contactphone, holderidentity = a.holderidentity, householdnum = a.householdnum, address = a.address, landproperty = a.landproperty, completiontime = a.completiontime, landnum = a.landnum, propertynum = a.propertynum, coverarea = a.coverarea, buildarea = a.buildarea, builduse = a.builduse, buildstructure = a.buildstructure, buildlayers_up = a.buildlayers_up, buildlayers_down = a.buildlayers_down, geography = a.geography, wj_wjtype = a.wj_wjtype, wj_use = a.wj_use, wj_land = a.wj_land, wj_time = a.wj_time, wj_landarea = a.wj_landarea, limittime = a.limittime, wj_wjarea = a.wj_wjarea, wj_buildstructure = a.wj_buildstructure, wj_layerup = a.wj_layerup, wj_layerdown = a.wj_layerdown, process = a.process, isgd = a.isgd, reportuser = a.reportuser, reporttime = a.reporttime, foundtime = a.foundtime, remark = a.remark, parentid = a.parentid, createuserid = a.createuserid, createtime = a.createtime, createusername = b.displayname, zd_name = c.zd_name }; model = queryable.FirstOrDefault(); if (model != null) { model.wjfilelist = dal.GetFileList(model.wjid, 1); model.path = "IllegallyBuiltOriginalPath"; } return(model); } }