/// <summary> /// 删除按钮响应 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tsBtnDel_Click(object sender, EventArgs e) { if (!Alert.confirm(Const_GM.TUNNEL_INFO_MSG_DEL)) { return; } //掘进ID var selectedIndex = gridView1.GetSelectedRows(); foreach (var tunnel in selectedIndex.Select(i => (Tunnel)gridView1.GetRow(i))) { GisHelper.DelHdByHdId(tunnel.TunnelId.ToString(CultureInfo.InvariantCulture)); tunnel.Delete(); } RefreshData(); }
/// <summary> /// 删除按钮响应 /// </summary> /// <params name="sender"></params> /// <params name="e"></params> private void tsBtnDel_Click(object sender, EventArgs e) { //是否删除导线点 if (!Alert.Confirm("确认要删除吗?")) { return; } var selectedIndex = gridView1.GetSelectedRows(); foreach (var wire in selectedIndex.Select(index => (Wire)gridView1.GetRow(index))) { GisHelper.DelHdByHdId(wire.tunnel.id.ToString(CultureInfo.InvariantCulture)); wire.Delete(); } RefreshData(); }
public string LoginBtn() { string username = Request["username"].Trim(); string password = Request["password"].Trim(); string status = Request["status"]; var json = new JObject(); try { if (string.IsNullOrWhiteSpace(username) && string.IsNullOrWhiteSpace(password)) { json.Add("result", false); json.Add("msg", "用户或密码为空!"); } else { //调用接口登录方法 webService.Service1 wbs = new webService.Service1(); DataTable logindt = wbs.Getlogindt(username, password); if (logindt.Rows.Count > 0) { int mid = int.Parse(logindt.Rows[0]["mid"].ToString()); // 获取有权限管理单元 string mids = "1"; DataTable dt = wbs.Getmidfulllistdsbyusermid(username, int.Parse(logindt.Rows[0]["mid"].ToString())); if (dt.Rows.Count > 0) { mids = dt.Rows[0]["midful"].ToString(); } //设置管理单元集合缓存 DateTime _now = DateTime.Now; string txtName = username + "#" + _now.ToString("yyyy-MM-dd") + "#" + _now.Millisecond; string txtPath = Server.MapPath("~/MidsTxt/"); GisHelper.CheckTxt(username, txtPath); GisHelper.WriteTxt(txtName, mids, txtPath); // 设置cookie SetLoginCookie(username, password, status); SetCookie(logindt, txtName); json.Add("result", true); json.Add("msg", "登录成功!"); json.Add("url", "../Main/Index"); } else { json.Add("result", false); json.Add("msg", "用户或密码错误!"); } } } catch (Exception ex) { json.Add("result", false); json.Add("msg", ex.Message); } return(json.ToString()); }