コード例 #1
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.T_Batch model)
 {
     return(dal.Update(model));
 }
コード例 #2
0
        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_Batch t_batch = new T_Batch();
            t_batch = bll_batch.GetModel(Convert.ToInt32(id));
            if (t_batch.isDeleted == 1)
            {
                t_batch.isDeleted = 0;
                opt = "开启";
            }
            else
            {
                t_batch.isDeleted = 1;
                opt = "关闭";
            }
            flag = bll_batch.Update(t_batch);

            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));//返回给前台页面
        }
コード例 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Maticsoft.Model.T_Batch model)
 {
     return(dal.Add(model));
 }
コード例 #4
0
 private void GetModelById(HttpContext context)
 {
     //获取id
     string id = "";
     Model.T_Batch t_batch = new T_Batch();
     if (null != context.Request.QueryString["id"])
     {
         id = context.Request.QueryString["id"].ToString().Trim();
         t_batch = bll_batch.GetModel(Convert.ToInt32(id));
     }
     context.Response.Write(JsonHelper.Object2Json<T_Batch>(t_batch));
 }