コード例 #1
0
        protected void btnSave_indicator_Click(object sender, EventArgs e)
        {
            FineUIPro.TreeNode treenode = firsttree.SelectedNode;

            if (treenode != null && treenode.Attributes["nodemenu"].ToString().Trim() == "2")
            {
                Dictionary <string, string> dic = initDatadic_indicator();
                string strID             = editID_indicator.Text.ToString().Trim();
                cd_thermal_indicator cti = new cd_thermal_indicator();
                int intresult            = 0;

                cd_thermal ct     = new cd_thermal();
                string     strtid = ct.isExistdata("cd_thermal", "pid", treenode.NodeID.ToString().Trim(), "ID").Trim();

                if (strID == "")
                {
                    dic.Add("ID", Guid.NewGuid().ToString());
                    dic.Add("tid", strtid);

                    intresult = cti.add(dic, "cd_thermal_indicator");
                }
                else
                {
                    intresult = cti.update(dic, "cd_thermal_indicator", "ID", strID);
                }

                Alert alert = new Alert();
                BindGrid(strtid);

                if (intresult == 1)
                {
                    alert.Icon    = Icon.Information;
                    alert.Message = "数据保存成功";
                }
                else
                {
                    alert.MessageBoxIcon = MessageBoxIcon.Error;
                    alert.Message        = "数据保存失败";
                }

                alert.Show();
            }
        }