protected void btniDelete_Click(object sender, EventArgs e) { int[] intRowindexarray = secondGrid.SelectedRowIndexArray; if (intRowindexarray.Length > 0) { cd_thermal_indicator cti = new cd_thermal_indicator(); object[] keys = secondGrid.DataKeys[intRowindexarray[0]]; string strID = keys[0].ToString(); string strtid = keys[1].ToString(); Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("ID", " cast(ID as varchar(36))='" + strID + "' "); int intresult = cti.deletebycondition("cd_thermal_indicator", dic); Alert alert = new Alert(); BindGrid(strtid); if (intresult > 0) { alert.Icon = Icon.Information; alert.Message = "成功移除数据"; } else { alert.MessageBoxIcon = MessageBoxIcon.Error; alert.Message = "数据移除失败"; } alert.Show(); } }
private void BindGrid(string strtid) { cd_thermal_batch ctb = new cd_thermal_batch(); cd_thermal_indicator ctic = new cd_thermal_indicator(); secondGrid.DataSource = ctic.getBindGridDataAsdt(strtid); secondGrid.DataBind(); mainGrid.DataSource = ctb.getBindGridDataAsdt(strtid); mainGrid.DataBind(); }
private void initbaseinfo_indicator(string strID) { if (strID.Trim() != "") { cd_thermal_indicator cti = new cd_thermal_indicator(); System.Data.DataTable dt = cti.getEditdata(strID); if (dt != null && dt.Rows.Count == 1) { DataRow r = dt.Rows[0]; iname.SelectedValue = r["iname"].ToString().Trim(); ivalue.Text = r["ivalue"].ToString().Trim(); icheck.Text = r["icheck"].ToString().Trim(); } } }
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(); } }