//楼宇详细信息 public ActionResult Detail(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BuildingDetailViewModel viewModel = new BuildingDetailViewModel(); viewModel.BuildingsAndBuildingMonthInfo = BuildingsAndBuildingMonthInfoBLL.Get(id.Value); viewModel.Enterprises = new RoadFlow.Platform.EnterpriseAndEnterpriseTaxBLL().GetAllByBuildingID(id.Value.ToString()); viewModel.Dictionarys = DictionaryBLL.GetListAll(); return(View(viewModel)); }
/// <summary> /// 楼栋列表视图初始化(商务局,街道办,报送单位) /// </summary> /// <returns></returns> private BuildingIndexViewModel BuildingInit(int type) { BuildingIndexViewModel viewModel = new BuildingIndexViewModel(); string pager = string.Empty; Dictionary <KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>, object> where = IndexGetMoreWhere();//更多条件 #region 固定where if (!string.IsNullOrWhiteSpace(Request["Name"])) { viewModel.Name = Request["Name"]; where.Add(new KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>("Name", RoadFlow.Data.Model.SQLFilterType.CHARINDEX), viewModel.Name); } if (!string.IsNullOrWhiteSpace(Request["SSJD"])) { viewModel.SSJD = Request["SSJD"]; where.Add(new KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>("SSJD", RoadFlow.Data.Model.SQLFilterType.EQUAL), viewModel.SSJD); } #endregion if (type == 0) {//商务局 viewModel.List = BuildingsAndBuildingMonthInfoBLL.GetPagerData(out pager, PageSize, RoadFlow.Utility.Tools.GetPageNumber(), where); } else if (type == 1) { //街道办 var ssjd = new RoadFlow.Platform.DictionaryBLL().GetCurrentSSJD(); viewModel.SSJD = ssjd == null ? "" : ssjd.Value.ToString(); if (string.IsNullOrWhiteSpace(Request["SSJD"])) { where.Add(new KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>("SSJD", RoadFlow.Data.Model.SQLFilterType.EQUAL), viewModel.SSJD); } viewModel.List = BuildingsAndBuildingMonthInfoBLL.GetPagerData(out pager, PageSize, RoadFlow.Utility.Tools.GetPageNumber(), where); } else { //报送单位 viewModel.List = BuildingsAndBuildingMonthInfoBLL.GetCurrentUsersOrganizeList(out pager, PageSize, RoadFlow.Utility.Tools.GetPageNumber(), where); } viewModel.Pager = pager; viewModel.Display = GetColItemList();//读取显示字段配置信息 viewModel.Dictionarys = DictionaryBLL.GetListAll(); viewModel.SSJDList = new SelectList(DictionaryBLL.GetListByCode("SSJD").ToList <RoadFlow.Data.Model.DictionaryModel>(), "ID", "Title", viewModel.SSJD); return(viewModel); }