Exemple #1
0
        private void DeleteInputTagCategory(HttpContext context)
        {
            KPI_ConstantDal DataAccess = new KPI_ConstantDal();
            HttpRequest     Request    = context.Request;
            HttpResponse    Response   = context.Response;
            Msg             msg;

            try {
                ConstantEntity Constant = new ConstantEntity {
                    ConstantID    = Request.Params["ConstantID"],
                    ConstantCode  = "M",
                    ConstantName  = Request.Params["ConstantName"],
                    ConstantValue = Request.Params["ConstantValue"]
                };
                DataAccess.DeleteConstant(Constant);
                msg = new Msg {
                    Status  = "ok",
                    Message = "数据删除成功!"
                };
            }
            catch (Exception ex) {
                msg = new Msg {
                    Status     = "error",
                    Message    = "数据删除失败!错误信息:" + ex.Message,
                    StackTrace = ex.StackTrace
                };
            }
            Response.Write(JsonConvert.SerializeObject(msg));
        }
Exemple #2
0
        protected void gvConstant_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string keyid = e.CommandArgument.ToString();

            if (e.CommandName == "dataDelete")
            {
                if (KPI_ConstantDal.DeleteConstant(keyid))
                {
                    MessageBox.popupClientMessage(this.Page, "删除成功!", "call();");

                    BindConstant();
                }
                else
                {
                    MessageBox.popupClientMessage(this.Page, "删除错误!", "call();");
                }
            }
        }