/// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Maticsoft.Model.T_Menu model)
 {
     return(dal.Add(model));
 }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.T_Menu 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_Menu t_menu = new T_Menu();
            t_menu = bll_menu.GetModel(Convert.ToInt32(id));
            if (t_menu.isDeleted == 1)
            {
                t_menu.isDeleted = 0;
                opt = "开启";
            }
            else
            {
                t_menu.isDeleted = 1;
                opt = "关闭";
            }
            flag = bll_menu.Update(t_menu);

            /*
               //添加登录日志
            Model.T_Log t_log = new T_Log();
            t_log.type = "【开启】";
            t_log.user_id = Convert.ToInt32(context.Session["user_id"].ToString());
            t_log.user_name = context.Session["user_name"].ToString();
            t_log.ip = Web.utils.Util.GetIP();
            t_log.create_time = DateTime.Now;
            t_log.id_role = context.Session["role_id"].ToString() + "";
            t_log.isDeleted = 0;
            t_log.des = "IP为 " + t_log.ip + " 的用户【" + context.Session["user_name"].ToString() + "】 身份【" + list_role[0].name + "】在 " + DateTime.Now + " 【启用】";
            bll_log.Add(t_log);
             */

            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));//返回给前台页面
        }