/// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Maticsoft.Model.T_LevyCompensate model)
 {
     return(dal.Add(model));
 }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.T_LevyCompensate model)
 {
     return(dal.Update(model));
 }
        private void Lock(HttpContext context)
        {
            bool flag = false;
            string id = "";
            string opt = "";

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

            Model.T_LevyCompensate t_levy = new T_LevyCompensate();
            t_levy = bll_levy.GetModel(Convert.ToInt32(id));
            if (t_levy.isDeleted == 1)
            {
                t_levy.isDeleted = 0;
                opt = "开启";
            }
            else
            {
                t_levy.isDeleted = 1;
                opt = "关闭";
            }
            flag = bll_levy.Update(t_levy);

            message = new Message();
            if (flag)
            {
                message.flag = true;
                message.msg = opt + "成功";
            }
            else
            {
                message.flag = false;
                message.msg = opt + "失败";
            }
            context.Response.Write(JsonHelper.Object2Json<Message>(message));//返回给前台页面
        }