Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 加载图纸对象列表
        /// </summary>
        private static void InitDrawList()
        {
            WcfClient.pdmService.IPDMService client = Util.Service;
            DrawListControl f = new DrawListControl(Util.paramsEntity());

            f.ShowDialog();
        }
Ejemplo n.º 3
0
 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);
     }
 }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
        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;
        }
Ejemplo n.º 6
0
 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("图纸对象为空!");
     }
 }
Ejemplo n.º 7
0
        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;
        }
Ejemplo n.º 8
0
 /// <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;
         }
     }
 }
Ejemplo n.º 9
0
 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();
     }
 }
Ejemplo n.º 10
0
        /// <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;
                }
            }
        }
Ejemplo n.º 11
0
        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();
        }
Ejemplo n.º 12
0
 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("图纸对象为空!");
     }
 }
Ejemplo n.º 13
0
 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();
     }
 }