/// <summary> /// 获取该地块被征收补偿用了还剩多少 /// </summary> /// <param name="context"></param> private void GetRemainLandBlock(HttpContext context) { string landblockId = ""; if (null != context.Request.QueryString["landblockId"]) { landblockId = context.Request.QueryString["landblockId"].ToString().Trim(); } //组合查询语句:条件+排序 StringBuilder strWhere = new StringBuilder(); strWhere.Append(" 1=1 and"); if (landblockId != "") { strWhere.AppendFormat(" landblockId = '{0}' and ", landblockId); } //删除多余的and int startindex = strWhere.ToString().LastIndexOf("and");//获取最后一个and的位置 if (startindex >= 0) { strWhere.Remove(startindex, 3);//删除多余的and关键字 } //地块信息 Model.T_LandBlock t_landblock = bll_land_block.GetModel(Convert.ToInt32(landblockId)); //用了该地块的征收补偿 List <Model.T_LevyCompensate> list_levy = bll_levy.GetModelList(strWhere.ToString()); if (list_levy.Count > 0) { decimal usedArea = 0; foreach (Model.T_LevyCompensate t_levy in list_levy) { usedArea += (decimal)t_levy.planLevyArea; } message.msg = t_landblock.area - usedArea + ""; } else { message.msg = t_landblock.area + ""; } context.Response.Write(JsonHelper.Object2Json <Message>(message)); }
/// <summary> /// 获取该批次下的下一个地块名称 /// </summary> /// <param name="context"></param> private void GetNextLandBlock(HttpContext context) { string batchId = ""; if (null != context.Request.QueryString["batchId"]) { batchId = context.Request.QueryString["batchId"].ToString().Trim(); } //组合查询语句:条件+排序 StringBuilder strWhere = new StringBuilder(); strWhere.Append(" 1=1 and"); if (batchId != "") { strWhere.AppendFormat(" batchId = '{0}' and ", batchId); } //删除多余的and int startindex = strWhere.ToString().LastIndexOf("and");//获取最后一个and的位置 if (startindex >= 0) { strWhere.Remove(startindex, 3);//删除多余的and关键字 } DataSet ds = bll_land_block.GetList(1, strWhere.ToString(), " id desc"); if (ds.Tables[0].Rows.Count == 0) { message.msg = "地块1"; } else { Model.T_LandBlock model = bll_land_block.GetModel(Convert.ToInt32(ds.Tables[0].Rows[0]["id"])); string name = model.name; int nextId = Convert.ToInt32(name.Substring(2)) + 1; message.msg = "地块" + nextId; } context.Response.Write(JsonHelper.Object2Json <Message>(message)); }