private void btnLogin_Click(object sender, EventArgs e) { //client = WcfClient.CommonUntils.proxy("192.168.0.8", "8000"); client = Common.Util.Service; WcfClient.pdmService.ResultObject obj = client.Login(txtUserName.Text.Trim(), txtPassWord.Text.Trim()); if (obj.AckResult) { if (DialogResult.OK == MessageBox.Show("用户登录成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information)) { Common.Util.UserName = txtUserName.Text.Trim(); //COM方式获取AutoCAD应用程序对象 AcadApplication acadApp = (AcadApplication)services.Application.AcadApplication; var menuCount = acadApp.MenuGroups.Item(0).Menus.Item(0).Count; for (int i = 0; i < menuCount; i++) { acadApp.MenuGroups.Item(0).Menus.Item(0).Item(i).Enable = true; } this.Visible = false; } } else { MessageBox.Show(obj.ErrMessage); } }
/// <summary> /// 加载图纸对象列表 /// </summary> private static void InitDrawList() { WcfClient.pdmService.IPDMService client = Util.Service; DrawListControl f = new DrawListControl(Util.paramsEntity()); f.ShowDialog(); }
private void btnDrawFind_Click(object sender, EventArgs e) { client = Common.Util.Service; //PDM_DRAWING draw = client.GetDrawingByID("e896d90d-55e8-4ef6-af89-4f0333438c04"); DrawListControl f = new DrawListControl(Common.Util.paramsEntity(draw)); //ConnectForm f = new ConnectForm(Common.Util.paramsEntity(draw), CommonUntils.RelationType.Product); //WcfClient.ConnectForm f = new WcfClient.ConnectForm("192.168.0.8", "8000"); f.ShowDialog(); }
public void InitLoad() { client = Common.Util.Service; lstDrawType.DataSource = (object)this.client.GetDrawType().DtResult; lstDrawType.SelectedItem = null; lstPartsType.Items.Clear(); string[] partsType = new string[Enum.GetNames(typeof(CommonUntils.RelationType)).Length - 1]; partsType[0] = "产品"; partsType[1] = "半成品"; partsType[2] = "材料"; lstPartsType.Items.AddRange(partsType); lstPartsType.SelectedItem = null; }
private void btnPartFind_Click(object sender, EventArgs e) { client = Common.Util.Service; draw = Common.Util.Drawing; if (draw != null) { ConnectForm f = new ConnectForm(Common.Util.paramsEntity(draw), CommonUntils.RelationType.ALL); f.ShowDialog(); } else { MessageBox.Show("图纸对象为空!"); } }
/// <summary> /// 图纸对象创建 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDrawCreate_Click(object sender, EventArgs e) { client = Common.Util.Service; //draw =client.GetDrawingByID("29152e50-0b0d-4e15-94a9-847aa7f83725"); //PDM_DRAWING draw = client.GetDrawingByID("e896d90d-55e8-4ef6-af89-4f0333438c04"); //第一种方式,需要已经知道的对象 DrawRegForm form = new DrawRegForm(Common.Util.paramsEntity(draw), lstDrawType.SelectedValue.ToString()); //WcfClient.AddFileFrm f = new WcfClient.AddFileFrm(entity); //第二种方式,不需要传对象 if (DialogResult.OK == form.ShowDialog()) { draw = form.Document; if (draw != null) { lblDrawCode.Text = draw.DOCNO; Common.Util.Drawing = draw; } } }
private void btnPartCreate_Click(object sender, EventArgs e) { client = Common.Util.Service; if (lstPartsType.Text.ToString().Equals("产品")) { ProductsAddForm form = new ProductsAddForm(Common.Util.paramsEntity(draw)); form.ShowDialog(); } if (lstPartsType.Text.ToString().Equals("半成品")) { PartsAddForm form = new PartsAddForm(Common.Util.paramsEntity(draw)); form.ShowDialog(); } if (lstPartsType.Text.ToString().Equals("材料")) { MaterailAddForm form = new MaterailAddForm(Common.Util.paramsEntity(draw)); form.ShowDialog(); } }