private void GetModelById(HttpContext context)
        {
            string id = "";

            if (context.Request["id"] != null && context.Request["id"].ToString().Trim() != "")
            {
                id = context.Request["id"].ToString();
            }
            Model.T_LevyCompensate t_levy = bll_levy.GetModel(Convert.ToInt32(id));
            context.Response.Write(JsonHelper.Object2Json <Model.T_LevyCompensate>(t_levy));
        }
        private void EditHasLevyArea(HttpContext context)
        {
            //获取字段:【用户name】
            string id, hasLevyArea;

            id = hasLevyArea = "";

            if (null != context.Request.QueryString["id"])
            {
                id = context.Request.QueryString["id"].ToString().Trim();
            }
            if (null != context.Request.QueryString["hasLevyArea"])
            {
                hasLevyArea = context.Request.QueryString["hasLevyArea"].ToString().Trim();
            }

            Model.T_LevyCompensate model = bll_levy.GetModel(Convert.ToInt32(id));

            if (hasLevyArea != "")
            {
                model.hasLevyArea = Convert.ToDecimal(hasLevyArea);
            }

            bool flag = bll_levy.Update(model);

            if (flag)
            {
                message.flag = true;
                message.msg  = "修改成功";
            }
            else
            {
                message.flag = false;
                message.msg  = "修改失败";
            }

            String jsonString = JsonHelper.Object2Json <Message>(message);

            context.Response.Write(jsonString);
        }
        private void AddOrModify(HttpContext context)
        {
            //===============================================================
            //获取字段:【用户name】
            string id, year, administratorArea, batchId, landblockId, batchTypeId, town, village, _group, totalPeopleNumber, planLevyArea, hasLevyArea, levyNationalLandArea, levyColletLandArea, levyPreDeposit, countrySocialSecurityFund, countryCompensate, areaWaterFacilitiesCompensate, provHeavyAgriculturalFunds, provAdditionalFee, provReclamationFee, provArableLandTax, provSurveyFee, provServiceFee, des;
            id = year = administratorArea = batchId = landblockId = batchTypeId = town = village = _group = totalPeopleNumber = planLevyArea = hasLevyArea = levyNationalLandArea = levyColletLandArea = levyPreDeposit = countrySocialSecurityFund = countryCompensate = areaWaterFacilitiesCompensate = provHeavyAgriculturalFunds = provAdditionalFee = provReclamationFee = provArableLandTax = provSurveyFee = provServiceFee = des = "";

            //获取参数
            if (context.Request["id"] != null && context.Request["id"].ToString().Trim() != "")
            {
                id = context.Request["id"].ToString().Trim();
            }
            if (null != context.Request.QueryString["year"])
            {
                year = context.Request.QueryString["year"].ToString().Trim();
            }
            if (null != context.Request.QueryString["administratorArea"])
            {
                administratorArea = context.Request.QueryString["administratorArea"].ToString().Trim();
            }
            if (context.Request["batchId"] != null && context.Request["batchId"].ToString().Trim() != "")
            {
                batchId = context.Request["batchId"].ToString().Trim();
            }
            if (context.Request["landblockId"] != null && context.Request["landblockId"].ToString().Trim() != "")
            {
                landblockId = context.Request["landblockId"].ToString().Trim();
            }
            if (context.Request["batchTypeId"] != null && context.Request["batchTypeId"].ToString().Trim() != "")
            {
                batchTypeId = context.Request["batchTypeId"].ToString().Trim();
            }
            if (context.Request["town"] != null && context.Request["town"].ToString().Trim() != "")
            {
                town = context.Request["town"].ToString().Trim();
            }
            if (context.Request["village"] != null && context.Request["village"].ToString().Trim() != "")
            {
                village = context.Request["village"].ToString().Trim();
            }
            if (context.Request["_group"] != null && context.Request["_group"].ToString().Trim() != "")
            {
                _group = context.Request["_group"].ToString().Trim();
            }
            if (context.Request["totalPeopleNumber"] != null && context.Request["totalPeopleNumber"].ToString().Trim() != "")
            {
                totalPeopleNumber = context.Request["totalPeopleNumber"].ToString().Trim();
            }
            if (context.Request["hasLevyArea"] != null && context.Request["hasLevyArea"].ToString().Trim() != "")
            {
                hasLevyArea = context.Request["hasLevyArea"].ToString().Trim();
            }
            if (context.Request.QueryString["planLevyArea"] != null && context.Request["planLevyArea"].ToString().Trim() != "")
            {
                planLevyArea = context.Request.QueryString["planLevyArea"].ToString();
            }
            if (context.Request.QueryString["levyNationalLandArea"] != null && context.Request["levyNationalLandArea"].ToString().Trim() != "")
            {
                levyNationalLandArea = context.Request.QueryString["levyNationalLandArea"].ToString();
            }
            if (context.Request.QueryString["levyColletLandArea"] != null && context.Request["levyColletLandArea"].ToString().Trim() != "")
            {
                levyColletLandArea = context.Request.QueryString["levyColletLandArea"].ToString();
            }

            if (context.Request.QueryString["levyPreDeposit"] != null && context.Request["levyPreDeposit"].ToString().Trim() != "")
            {
                levyPreDeposit = context.Request.QueryString["levyPreDeposit"].ToString();
            }
            if (context.Request.QueryString["countrySocialSecurityFund"] != null && context.Request["countrySocialSecurityFund"].ToString().Trim() != "")
            {
                countrySocialSecurityFund = context.Request.QueryString["countrySocialSecurityFund"].ToString();
            }
            if (context.Request.QueryString["countryCompensate"] != null && context.Request["countryCompensate"].ToString().Trim() != "")
            {
                countryCompensate = context.Request.QueryString["countryCompensate"].ToString();
            }
            if (context.Request.QueryString["areaWaterFacilitiesCompensate"] != null && context.Request["areaWaterFacilitiesCompensate"].ToString().Trim() != "")
            {
                areaWaterFacilitiesCompensate = context.Request.QueryString["areaWaterFacilitiesCompensate"].ToString();
            }
            if (context.Request.QueryString["provHeavyAgriculturalFunds"] != null && context.Request["provHeavyAgriculturalFunds"].ToString().Trim() != "")
            {
                provHeavyAgriculturalFunds = context.Request.QueryString["provHeavyAgriculturalFunds"].ToString();
            }
            if (context.Request.QueryString["provAdditionalFee"] != null && context.Request["provAdditionalFee"].ToString().Trim() != "")
            {
                provAdditionalFee = context.Request.QueryString["provAdditionalFee"].ToString();
            }
            if (context.Request.QueryString["provReclamationFee"] != null && context.Request["provReclamationFee"].ToString().Trim() != "")
            {
                provReclamationFee = context.Request.QueryString["provReclamationFee"].ToString();
            }
            if (context.Request.QueryString["provArableLandTax"] != null && context.Request["provArableLandTax"].ToString().Trim() != "")
            {
                provArableLandTax = context.Request.QueryString["provArableLandTax"].ToString();
            }
            if (context.Request.QueryString["provSurveyFee"] != null && context.Request["provSurveyFee"].ToString().Trim() != "")
            {
                provSurveyFee = context.Request.QueryString["provSurveyFee"].ToString();
            }
            if (context.Request.QueryString["provServiceFee"] != null && context.Request["provServiceFee"].ToString().Trim() != "")
            {
                provServiceFee = context.Request.QueryString["provServiceFee"].ToString();
            }
            if (context.Request.QueryString["des"] != null)
            {
                des = context.Request.QueryString["des"];
            }

            if (id == "")
            {
                Model.T_LevyCompensate model = new Model.T_LevyCompensate();

                if (batchTypeId != ""){model.batchTypeId = Convert.ToInt32(batchTypeId);}else{model.batchTypeId = 0;}
                model.year = year;
                model.administratorArea = administratorArea;
                if (batchId != "")
                {
                    model.batchId = Convert.ToInt32(batchId);
                }
                else
                {
                    model.batchId = 0;
                }
                if (landblockId != "")
                {
                    model.landblockId = Convert.ToInt32(landblockId);
                }
                else
                {
                    model.landblockId = 0;
                }
                model.town = town;
                model.village = village;
                model._group = _group;
                if (totalPeopleNumber != ""){model.totalPeopleNumber = Convert.ToDecimal(totalPeopleNumber);}else{model.totalPeopleNumber = 0;}
                if (planLevyArea != ""){model.planLevyArea = Convert.ToDecimal(planLevyArea);}else{model.planLevyArea = 0;}
                if (hasLevyArea != ""){model.hasLevyArea = Convert.ToDecimal(hasLevyArea);}else{model.hasLevyArea = 0;}
                if (levyNationalLandArea != ""){model.levyNationalLandArea = Convert.ToDecimal(levyNationalLandArea);}else{model.levyNationalLandArea = 0;}
                if (levyColletLandArea != ""){model.levyColletLandArea = Convert.ToDecimal(levyColletLandArea);}else{model.levyColletLandArea = 0;}
                if (levyPreDeposit != ""){model.levyPreDeposit = Convert.ToDecimal(levyPreDeposit);}else{model.levyPreDeposit = 0;}
                if (countrySocialSecurityFund != ""){model.countrySocialSecurityFund = Convert.ToDecimal(countrySocialSecurityFund);}else{model.countrySocialSecurityFund = 0;}
                if (countryCompensate != ""){model.countryCompensate = Convert.ToDecimal(countryCompensate);}else{model.countryCompensate = 0;}
                if (areaWaterFacilitiesCompensate != "") { model.areaWaterFacilitiesCompensate = Convert.ToDecimal(areaWaterFacilitiesCompensate); } else { model.areaWaterFacilitiesCompensate = 0; }
                if (provHeavyAgriculturalFunds != "") { model.provHeavyAgriculturalFunds = Convert.ToDecimal(provHeavyAgriculturalFunds); } else { model.provHeavyAgriculturalFunds = 0; }
                if (provAdditionalFee != "") { model.provAdditionalFee = Convert.ToDecimal(provAdditionalFee); } else { model.provAdditionalFee = 0; }
                if (provReclamationFee != "") { model.provReclamationFee = Convert.ToDecimal(provReclamationFee); } else { model.provReclamationFee = 0; }
                if (provArableLandTax != "") { model.provArableLandTax = Convert.ToDecimal(provArableLandTax); } else { model.provArableLandTax = 0; }
                if (provSurveyFee != "") { model.provSurveyFee = Convert.ToDecimal(provSurveyFee); } else { model.provSurveyFee = 0; }
                if (provServiceFee != "") { model.provServiceFee = Convert.ToDecimal(provServiceFee); } else { model.provServiceFee = 0; }
                if (context.Session["user_id"].ToString() != ""){model.userId = Convert.ToInt32(context.Session["user_id"]);}else{model.userId = 0;}
                model.createTime = System.DateTime.Now;
                model.isSubmited = 0;
                model.isDeleted = 0;
                model.des = des;

                int n = bll_levy.Add(model);
                if (n > 0)
                {
                    message.flag = true;
                    message.msg = "添加成功";
                }
                else
                {
                    message.flag = false;
                    message.msg = "添加失败";
                }
            }
            else
            {
                Model.T_LevyCompensate model = bll_levy.GetModel(Convert.ToInt32(id));
                model.year = year;
                model.administratorArea = administratorArea;
                if (batchTypeId != "") { model.batchTypeId = Convert.ToInt32(batchTypeId); } else { model.batchTypeId = 0; }
                if (batchId != "")
                {
                    model.batchId = Convert.ToInt32(batchId);
                }
                else
                {
                    model.batchId = 0;
                }
                if (landblockId != "")
                {
                    model.landblockId = Convert.ToInt32(landblockId);
                }
                else
                {
                    model.landblockId = 0;
                }
                model.town = town;
                model.village = village;
                model._group = _group;
                if (totalPeopleNumber != "") { model.totalPeopleNumber = Convert.ToDecimal(totalPeopleNumber); } else { model.totalPeopleNumber = 0; }
                if (planLevyArea != "") { model.planLevyArea = Convert.ToDecimal(planLevyArea); } else { model.planLevyArea = 0; }
                if (hasLevyArea != "") { model.hasLevyArea = Convert.ToDecimal(hasLevyArea); } else { model.hasLevyArea = 0; }
                if (levyNationalLandArea != "") { model.levyNationalLandArea = Convert.ToDecimal(levyNationalLandArea); } else { model.levyNationalLandArea = 0; }
                if (levyColletLandArea != "") { model.levyColletLandArea = Convert.ToDecimal(levyColletLandArea); } else { model.levyColletLandArea = 0; }
                if (levyPreDeposit != "") { model.levyPreDeposit = Convert.ToDecimal(levyPreDeposit); } else { model.levyPreDeposit = 0; }
                if (countrySocialSecurityFund != "") { model.countrySocialSecurityFund = Convert.ToDecimal(countrySocialSecurityFund); } else { model.countrySocialSecurityFund = 0; }
                if (countryCompensate != "") { model.countryCompensate = Convert.ToDecimal(countryCompensate); } else { model.countryCompensate = 0; }
                if (areaWaterFacilitiesCompensate != "") { model.areaWaterFacilitiesCompensate = Convert.ToDecimal(areaWaterFacilitiesCompensate); } else { model.areaWaterFacilitiesCompensate = 0; }
                if (provHeavyAgriculturalFunds != "") { model.provHeavyAgriculturalFunds = Convert.ToDecimal(provHeavyAgriculturalFunds); } else { model.provHeavyAgriculturalFunds = 0; }
                if (provAdditionalFee != "") { model.provAdditionalFee = Convert.ToDecimal(provAdditionalFee); } else { model.provAdditionalFee = 0; }
                if (provReclamationFee != "") { model.provReclamationFee = Convert.ToDecimal(provReclamationFee); } else { model.provReclamationFee = 0; }
                if (provArableLandTax != "") { model.provArableLandTax = Convert.ToDecimal(provArableLandTax); } else { model.provArableLandTax = 0; }
                if (provSurveyFee != "") { model.provSurveyFee = Convert.ToDecimal(provSurveyFee); } else { model.provSurveyFee = 0; }
                if (provServiceFee != "") { model.provServiceFee = Convert.ToDecimal(provServiceFee); } else { model.provServiceFee = 0; }
                if (context.Session["user_id"].ToString() != "") { model.userId = Convert.ToInt32(context.Session["user_id"]); } else { model.userId = 0; }
                model.createTime = System.DateTime.Now;
                model.isSubmited = 0;
                model.isDeleted = 0;
                model.des = des;

                bool flag = bll_levy.Update(model);
                if (flag)
                {
                    message.flag = true;
                    message.msg = "修改成功";
                }
                else
                {
                    message.flag = false;
                    message.msg = "修改失败";
                }
            }

            String jsonString = JsonHelper.Object2Json<Message>(message);
            context.Response.Write(jsonString);
        }
        private void AddOrModify(HttpContext context)
        {
            //===============================================================
            //获取字段:【用户name】
            string id, year, administratorArea, batchId, landblockId, batchTypeId, town, village, _group, totalPeopleNumber, planLevyArea, hasLevyArea, levyNationalLandArea, levyColletLandArea, levyPreDeposit, countrySocialSecurityFund, countryCompensate, areaWaterFacilitiesCompensate, provHeavyAgriculturalFunds, provAdditionalFee, provReclamationFee, provArableLandTax, provSurveyFee, provServiceFee, des;

            id = year = administratorArea = batchId = landblockId = batchTypeId = town = village = _group = totalPeopleNumber = planLevyArea = hasLevyArea = levyNationalLandArea = levyColletLandArea = levyPreDeposit = countrySocialSecurityFund = countryCompensate = areaWaterFacilitiesCompensate = provHeavyAgriculturalFunds = provAdditionalFee = provReclamationFee = provArableLandTax = provSurveyFee = provServiceFee = des = "";

            //获取参数
            if (context.Request["id"] != null && context.Request["id"].ToString().Trim() != "")
            {
                id = context.Request["id"].ToString().Trim();
            }
            if (null != context.Request.QueryString["year"])
            {
                year = context.Request.QueryString["year"].ToString().Trim();
            }
            if (null != context.Request.QueryString["administratorArea"])
            {
                administratorArea = context.Request.QueryString["administratorArea"].ToString().Trim();
            }
            if (context.Request["batchId"] != null && context.Request["batchId"].ToString().Trim() != "")
            {
                batchId = context.Request["batchId"].ToString().Trim();
            }
            if (context.Request["landblockId"] != null && context.Request["landblockId"].ToString().Trim() != "")
            {
                landblockId = context.Request["landblockId"].ToString().Trim();
            }
            if (context.Request["batchTypeId"] != null && context.Request["batchTypeId"].ToString().Trim() != "")
            {
                batchTypeId = context.Request["batchTypeId"].ToString().Trim();
            }
            if (context.Request["town"] != null && context.Request["town"].ToString().Trim() != "")
            {
                town = context.Request["town"].ToString().Trim();
            }
            if (context.Request["village"] != null && context.Request["village"].ToString().Trim() != "")
            {
                village = context.Request["village"].ToString().Trim();
            }
            if (context.Request["_group"] != null && context.Request["_group"].ToString().Trim() != "")
            {
                _group = context.Request["_group"].ToString().Trim();
            }
            if (context.Request["totalPeopleNumber"] != null && context.Request["totalPeopleNumber"].ToString().Trim() != "")
            {
                totalPeopleNumber = context.Request["totalPeopleNumber"].ToString().Trim();
            }
            if (context.Request["hasLevyArea"] != null && context.Request["hasLevyArea"].ToString().Trim() != "")
            {
                hasLevyArea = context.Request["hasLevyArea"].ToString().Trim();
            }
            if (context.Request.QueryString["planLevyArea"] != null && context.Request["planLevyArea"].ToString().Trim() != "")
            {
                planLevyArea = context.Request.QueryString["planLevyArea"].ToString();
            }
            if (context.Request.QueryString["levyNationalLandArea"] != null && context.Request["levyNationalLandArea"].ToString().Trim() != "")
            {
                levyNationalLandArea = context.Request.QueryString["levyNationalLandArea"].ToString();
            }
            if (context.Request.QueryString["levyColletLandArea"] != null && context.Request["levyColletLandArea"].ToString().Trim() != "")
            {
                levyColletLandArea = context.Request.QueryString["levyColletLandArea"].ToString();
            }

            if (context.Request.QueryString["levyPreDeposit"] != null && context.Request["levyPreDeposit"].ToString().Trim() != "")
            {
                levyPreDeposit = context.Request.QueryString["levyPreDeposit"].ToString();
            }
            if (context.Request.QueryString["countrySocialSecurityFund"] != null && context.Request["countrySocialSecurityFund"].ToString().Trim() != "")
            {
                countrySocialSecurityFund = context.Request.QueryString["countrySocialSecurityFund"].ToString();
            }
            if (context.Request.QueryString["countryCompensate"] != null && context.Request["countryCompensate"].ToString().Trim() != "")
            {
                countryCompensate = context.Request.QueryString["countryCompensate"].ToString();
            }
            if (context.Request.QueryString["areaWaterFacilitiesCompensate"] != null && context.Request["areaWaterFacilitiesCompensate"].ToString().Trim() != "")
            {
                areaWaterFacilitiesCompensate = context.Request.QueryString["areaWaterFacilitiesCompensate"].ToString();
            }
            if (context.Request.QueryString["provHeavyAgriculturalFunds"] != null && context.Request["provHeavyAgriculturalFunds"].ToString().Trim() != "")
            {
                provHeavyAgriculturalFunds = context.Request.QueryString["provHeavyAgriculturalFunds"].ToString();
            }
            if (context.Request.QueryString["provAdditionalFee"] != null && context.Request["provAdditionalFee"].ToString().Trim() != "")
            {
                provAdditionalFee = context.Request.QueryString["provAdditionalFee"].ToString();
            }
            if (context.Request.QueryString["provReclamationFee"] != null && context.Request["provReclamationFee"].ToString().Trim() != "")
            {
                provReclamationFee = context.Request.QueryString["provReclamationFee"].ToString();
            }
            if (context.Request.QueryString["provArableLandTax"] != null && context.Request["provArableLandTax"].ToString().Trim() != "")
            {
                provArableLandTax = context.Request.QueryString["provArableLandTax"].ToString();
            }
            if (context.Request.QueryString["provSurveyFee"] != null && context.Request["provSurveyFee"].ToString().Trim() != "")
            {
                provSurveyFee = context.Request.QueryString["provSurveyFee"].ToString();
            }
            if (context.Request.QueryString["provServiceFee"] != null && context.Request["provServiceFee"].ToString().Trim() != "")
            {
                provServiceFee = context.Request.QueryString["provServiceFee"].ToString();
            }
            if (context.Request.QueryString["des"] != null)
            {
                des = context.Request.QueryString["des"];
            }



            if (id == "")
            {
                Model.T_LevyCompensate model = new Model.T_LevyCompensate();

                if (batchTypeId != "")
                {
                    model.batchTypeId = Convert.ToInt32(batchTypeId);
                }
                else
                {
                    model.batchTypeId = 0;
                }
                model.year = year;
                model.administratorArea = administratorArea;
                if (batchId != "")
                {
                    model.batchId = Convert.ToInt32(batchId);
                }
                else
                {
                    model.batchId = 0;
                }
                if (landblockId != "")
                {
                    model.landblockId = Convert.ToInt32(landblockId);
                }
                else
                {
                    model.landblockId = 0;
                }
                model.town    = town;
                model.village = village;
                model._group  = _group;
                if (totalPeopleNumber != "")
                {
                    model.totalPeopleNumber = Convert.ToDecimal(totalPeopleNumber);
                }
                else
                {
                    model.totalPeopleNumber = 0;
                }
                if (planLevyArea != "")
                {
                    model.planLevyArea = Convert.ToDecimal(planLevyArea);
                }
                else
                {
                    model.planLevyArea = 0;
                }
                if (hasLevyArea != "")
                {
                    model.hasLevyArea = Convert.ToDecimal(hasLevyArea);
                }
                else
                {
                    model.hasLevyArea = 0;
                }
                if (levyNationalLandArea != "")
                {
                    model.levyNationalLandArea = Convert.ToDecimal(levyNationalLandArea);
                }
                else
                {
                    model.levyNationalLandArea = 0;
                }
                if (levyColletLandArea != "")
                {
                    model.levyColletLandArea = Convert.ToDecimal(levyColletLandArea);
                }
                else
                {
                    model.levyColletLandArea = 0;
                }
                if (levyPreDeposit != "")
                {
                    model.levyPreDeposit = Convert.ToDecimal(levyPreDeposit);
                }
                else
                {
                    model.levyPreDeposit = 0;
                }
                if (countrySocialSecurityFund != "")
                {
                    model.countrySocialSecurityFund = Convert.ToDecimal(countrySocialSecurityFund);
                }
                else
                {
                    model.countrySocialSecurityFund = 0;
                }
                if (countryCompensate != "")
                {
                    model.countryCompensate = Convert.ToDecimal(countryCompensate);
                }
                else
                {
                    model.countryCompensate = 0;
                }
                if (areaWaterFacilitiesCompensate != "")
                {
                    model.areaWaterFacilitiesCompensate = Convert.ToDecimal(areaWaterFacilitiesCompensate);
                }
                else
                {
                    model.areaWaterFacilitiesCompensate = 0;
                }
                if (provHeavyAgriculturalFunds != "")
                {
                    model.provHeavyAgriculturalFunds = Convert.ToDecimal(provHeavyAgriculturalFunds);
                }
                else
                {
                    model.provHeavyAgriculturalFunds = 0;
                }
                if (provAdditionalFee != "")
                {
                    model.provAdditionalFee = Convert.ToDecimal(provAdditionalFee);
                }
                else
                {
                    model.provAdditionalFee = 0;
                }
                if (provReclamationFee != "")
                {
                    model.provReclamationFee = Convert.ToDecimal(provReclamationFee);
                }
                else
                {
                    model.provReclamationFee = 0;
                }
                if (provArableLandTax != "")
                {
                    model.provArableLandTax = Convert.ToDecimal(provArableLandTax);
                }
                else
                {
                    model.provArableLandTax = 0;
                }
                if (provSurveyFee != "")
                {
                    model.provSurveyFee = Convert.ToDecimal(provSurveyFee);
                }
                else
                {
                    model.provSurveyFee = 0;
                }
                if (provServiceFee != "")
                {
                    model.provServiceFee = Convert.ToDecimal(provServiceFee);
                }
                else
                {
                    model.provServiceFee = 0;
                }
                if (context.Session["user_id"].ToString() != "")
                {
                    model.userId = Convert.ToInt32(context.Session["user_id"]);
                }
                else
                {
                    model.userId = 0;
                }
                model.createTime = System.DateTime.Now;
                model.isSubmited = 0;
                model.isDeleted  = 0;
                model.des        = des;

                int n = bll_levy.Add(model);
                if (n > 0)
                {
                    message.flag = true;
                    message.msg  = "添加成功";
                }
                else
                {
                    message.flag = false;
                    message.msg  = "添加失败";
                }
            }
            else
            {
                Model.T_LevyCompensate model = bll_levy.GetModel(Convert.ToInt32(id));
                model.year = year;
                model.administratorArea = administratorArea;
                if (batchTypeId != "")
                {
                    model.batchTypeId = Convert.ToInt32(batchTypeId);
                }
                else
                {
                    model.batchTypeId = 0;
                }
                if (batchId != "")
                {
                    model.batchId = Convert.ToInt32(batchId);
                }
                else
                {
                    model.batchId = 0;
                }
                if (landblockId != "")
                {
                    model.landblockId = Convert.ToInt32(landblockId);
                }
                else
                {
                    model.landblockId = 0;
                }
                model.town    = town;
                model.village = village;
                model._group  = _group;
                if (totalPeopleNumber != "")
                {
                    model.totalPeopleNumber = Convert.ToDecimal(totalPeopleNumber);
                }
                else
                {
                    model.totalPeopleNumber = 0;
                }
                if (planLevyArea != "")
                {
                    model.planLevyArea = Convert.ToDecimal(planLevyArea);
                }
                else
                {
                    model.planLevyArea = 0;
                }
                if (hasLevyArea != "")
                {
                    model.hasLevyArea = Convert.ToDecimal(hasLevyArea);
                }
                else
                {
                    model.hasLevyArea = 0;
                }
                if (levyNationalLandArea != "")
                {
                    model.levyNationalLandArea = Convert.ToDecimal(levyNationalLandArea);
                }
                else
                {
                    model.levyNationalLandArea = 0;
                }
                if (levyColletLandArea != "")
                {
                    model.levyColletLandArea = Convert.ToDecimal(levyColletLandArea);
                }
                else
                {
                    model.levyColletLandArea = 0;
                }
                if (levyPreDeposit != "")
                {
                    model.levyPreDeposit = Convert.ToDecimal(levyPreDeposit);
                }
                else
                {
                    model.levyPreDeposit = 0;
                }
                if (countrySocialSecurityFund != "")
                {
                    model.countrySocialSecurityFund = Convert.ToDecimal(countrySocialSecurityFund);
                }
                else
                {
                    model.countrySocialSecurityFund = 0;
                }
                if (countryCompensate != "")
                {
                    model.countryCompensate = Convert.ToDecimal(countryCompensate);
                }
                else
                {
                    model.countryCompensate = 0;
                }
                if (areaWaterFacilitiesCompensate != "")
                {
                    model.areaWaterFacilitiesCompensate = Convert.ToDecimal(areaWaterFacilitiesCompensate);
                }
                else
                {
                    model.areaWaterFacilitiesCompensate = 0;
                }
                if (provHeavyAgriculturalFunds != "")
                {
                    model.provHeavyAgriculturalFunds = Convert.ToDecimal(provHeavyAgriculturalFunds);
                }
                else
                {
                    model.provHeavyAgriculturalFunds = 0;
                }
                if (provAdditionalFee != "")
                {
                    model.provAdditionalFee = Convert.ToDecimal(provAdditionalFee);
                }
                else
                {
                    model.provAdditionalFee = 0;
                }
                if (provReclamationFee != "")
                {
                    model.provReclamationFee = Convert.ToDecimal(provReclamationFee);
                }
                else
                {
                    model.provReclamationFee = 0;
                }
                if (provArableLandTax != "")
                {
                    model.provArableLandTax = Convert.ToDecimal(provArableLandTax);
                }
                else
                {
                    model.provArableLandTax = 0;
                }
                if (provSurveyFee != "")
                {
                    model.provSurveyFee = Convert.ToDecimal(provSurveyFee);
                }
                else
                {
                    model.provSurveyFee = 0;
                }
                if (provServiceFee != "")
                {
                    model.provServiceFee = Convert.ToDecimal(provServiceFee);
                }
                else
                {
                    model.provServiceFee = 0;
                }
                if (context.Session["user_id"].ToString() != "")
                {
                    model.userId = Convert.ToInt32(context.Session["user_id"]);
                }
                else
                {
                    model.userId = 0;
                }
                model.createTime = System.DateTime.Now;
                model.isSubmited = 0;
                model.isDeleted  = 0;
                model.des        = des;

                bool flag = bll_levy.Update(model);
                if (flag)
                {
                    message.flag = true;
                    message.msg  = "修改成功";
                }
                else
                {
                    message.flag = false;
                    message.msg  = "修改失败";
                }
            }


            String jsonString = JsonHelper.Object2Json <Message>(message);

            context.Response.Write(jsonString);
        }