Ejemplo n.º 1
0
 private void dgv1_DoubleClick(object sender, EventArgs e)
 {
     if (dgv1.RowCount > 0)
     {
         foreach (Form form in this.ParentForm.MdiChildren)
         {
             if (form.Text == "材料维护页面")
             {
                 if (form.WindowState == FormWindowState.Minimized)
                 {
                     form.WindowState = FormWindowState.Normal;
                 }
                 form.Activate();
                 return;
             }
         }
         string         project_name = "";
         string         site_no      = dgv1.CurrentRow.Cells["域"].Value.ToString();
         string         partno       = dgv1.CurrentRow.Cells["零件号"].Value.ToString();
         string         partname     = dgv1.CurrentRow.Cells["零件描述"].Value.ToString();
         string         designcode   = tb_designcode.Text.Trim();
         ProjectCmbItem item         = (ProjectCmbItem)cmb_project.SelectedItem;
         if (item != null)
         {
             project_name = item.Value;
         }
         else
         {
             MessageBox.Show("请选择项目!", "查询提醒");
             return;
         }
         DetailInfo.MaterialManage.MaterialDetail detailform = new DetailInfo.MaterialManage.MaterialDetail(project_name, partno, partname, site_no, designcode);
         detailform.Text      = "材料详情页面";
         detailform.MdiParent = this.MdiParent;
         detailform.Show();
     }
     else
     {
         return;
     }
 }
Ejemplo n.º 2
0
        private void dgv1_DoubleClick(object sender, EventArgs e)
        {
            if (dgv1.RowCount > 0)
            {
                foreach (Form form in this.ParentForm.MdiChildren)
                {
                    if (form.Text == "����ά��ҳ��")
                    {
                        if (form.WindowState == FormWindowState.Minimized)
                        {
                            form.WindowState = FormWindowState.Normal;
                        }
                        form.Activate();
                        return;
                    }
                }
                string project_name = "";
                string site_no = dgv1.CurrentRow.Cells["��"].Value.ToString();
                string partno = dgv1.CurrentRow.Cells["�����"].Value.ToString();
                string partname = dgv1.CurrentRow.Cells["�������"].Value.ToString();
                string designcode = tb_designcode.Text.Trim();
                ProjectCmbItem item = (ProjectCmbItem)cmb_project.SelectedItem;
                if (item != null)
                {
                    project_name = item.Value;
                }
                else
                {
                    MessageBox.Show("��ѡ����Ŀ��", "��ѯ����");
                    return;
                }
                DetailInfo.MaterialManage.MaterialDetail detailform = new DetailInfo.MaterialManage.MaterialDetail(project_name, partno, partname,site_no,designcode);
                detailform.Text = "��������ҳ��";
                detailform.MdiParent = this.MdiParent;
                detailform.Show();

            }
            else
            {
                return;
            }
        }