/// <summary> /// 户表管理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public static void mouse_SHBManager(object sender, EventArgs e) { var ee = (selectEntityArgs)e; var shb = new SHBMap(ee); Application.ShowModelessDialog(shb); }
private void btn_ok_Click(object sender, EventArgs e) { try { lb_SHBWarn.Text = ""; lb_SHBWarn.ForeColor = Color.Red; if (string.IsNullOrEmpty(tx_SHBYDH.Text)) { lb_SHBWarn.Text = "用户号不能为空."; return; } var temp_shb = DBManager.Instance.GetEntities <Gg_pd_dyshb_n>(o => o.YDH == tx_SHBYDH.Text.Trim()).FirstOrDefault(); if (temp_shb == null) { lb_SHBWarn.Text = "用户号不存在."; return; } var temp_shbpt = DBManager.Instance.GetEntities <Gg_jx_shbd_pt>( o => o.G3E_FID == temp_shb.G3E_FID && o.EntityState != EntityState.Delete).FirstOrDefault(); if (temp_shbpt == null) { return; } var temp_detail = DBManager.Instance.GetEntities <Detailreference_n>( o => o.G3E_DETAILID == temp_shbpt.G3E_DETAILID && o.EntityState != EntityState.Delete).FirstOrDefault(); if (temp_detail == null) { return; } var g3eObject = new G3EObject { G3E_ID = temp_detail.G3E_ID, G3E_FID = temp_detail.G3E_FID, G3E_FNO = temp_detail.G3E_FNO }; //var shbview = new SHBMap(temp_detail.G3E_FID, temp_shb.G3E_FID); var shbview = new SHBMap(new selectEntityArgs { g3eObject = g3eObject }, temp_shb.G3E_FID); Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(shbview); FixEntity.Instance.Fix(temp_detail.G3E_FID); } catch (Exception ex) { if (ex.Message.Contains("不存在")) { var strlx = ex.Message.Replace("不存在", ""); var type = TypeCache.Instance.GetTypeFromCache(typeof(DBEntity), strlx); var connectn = ReflectionUtils.CreateObject(new { }, type) as DBEntity; DBManager.Instance.Insert(connectn); } else { PublicMethod.Instance.ShowMessage(ex.Message); } } }