private void dataGridView1_CellClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }

            if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("codeNum2", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("付款申请单") == true)
                {
                    if (PaymentTabie == null || PaymentTabie.IsDisposed)

                    {
                        PaymentTabie = new FormPaymentTabie(dataGridView1.Rows[e.RowIndex].Cells["codeNum"].Value.ToString(), "C");

                        PaymentTabie.Show();//未打开,直接打开。
                    }

                    else

                    {
                        PaymentTabie.Activate();//已打开,获得焦点,置顶。
                    }
                }
            }
            else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("jindan1", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("进仓单") == true)
                {
                    //自营仓库
                    if (BarnTable == null || BarnTable.IsDisposed)
                    {
                        BarnTable = new  FormBarnAssociation(dataGridView1.Rows[e.RowIndex].Cells["codeNum"].Value.ToString());
                        BarnTable.Show();//未打开,直接打开。
                    }
                    else
                    {
                        BarnTable.Activate();//已打开,获得焦点,置顶。
                    }
                }
            }
            else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("code2", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("行情定价单") == true)
                {
                    //行情定价表
                    if (PricingTable == null || PricingTable.IsDisposed)
                    {
                        PricingTable = new  FormPricingAssociation(dataGridView1.Rows[e.RowIndex].Cells["fishId"].Value.ToString());
                        PricingTable.Show();//未打开,直接打开。
                    }
                    else
                    {
                        PricingTable.Activate();//已打开,获得焦点,置顶。
                    }
                }
            }
        }
        private void dataGridView1_CellClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            path          = string.Empty;
            Megres.oddNum = string.Empty;
            if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("error", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("付款申请单") == true)
                {
                    if (PaymentTabie == null || PaymentTabie.IsDisposed)
                    {
                        PaymentTabie = new FormPaymentTabie(dataGridView1.Rows[e.RowIndex].Cells["codeNum"].Value.ToString(), "C");

                        PaymentTabie.Show();//未打开,直接打开。
                    }

                    else

                    {
                        PaymentTabie.Activate();//已打开,获得焦点,置顶。
                    }
                }
            }
            else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("weight", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("进仓单") == true)
                {
                    //自营仓库

                    if (BarnTable == null || BarnTable.IsDisposed)

                    {
                        BarnTable = new FormBarnAssociation(dataGridView1.Rows[e.RowIndex].Cells["codeNum"].Value.ToString());

                        BarnTable.Show();//未打开,直接打开。
                    }

                    else

                    {
                        BarnTable.Activate();//已打开,获得焦点,置顶。
                    }
                }
            }
            else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("coun1", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("入库申请单") == true)
                {
                    FormWarehousingAssociation WarehousingTable = new FormWarehousingAssociation(dataGridView1.Rows[e.RowIndex].Cells["codeNum"].Value.ToString());
                    WarehousingTable.ShowDialog();
                    //path = "FishClient.FormStorageOfRequisition";
                    //Megres . oddNum  = dataGridView1 . Rows [ e . RowIndex ] . Cells [ "codeNumContract" ] . Value . ToString ( );
                    //Megres . fishId = dataGridView1 . Rows [ e . RowIndex ] . Cells [ "fishId" ] . Value . ToString ( );
                }
            }
            else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("code2", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("配料单") == true)
                {
                    FormIngredientAssociation IngredientTable = new FormIngredientAssociation(dataGridView1.Rows[e.RowIndex].Cells["codeNum"].Value.ToString());
                    IngredientTable.ShowDialog();
                }
            }
            else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("code3", StringComparison.OrdinalIgnoreCase))                //FormProcessStateForMacOne
            {
                if (Authority.ProcessControText("自定义标准表") == true)
                {
                    path          = "FishClient.FormCustomStandardTable";
                    Megres.oddNum = "1=1";
                }
            }
            else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("code4", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("成品出库单") == true)
                {
                    FormFinishedProductAssociation FinishedTable = new FormFinishedProductAssociation(dataGridView1.Rows[e.RowIndex].Cells["fishId"].Value.ToString());
                    FinishedTable.ShowDialog();
                }
            }
            if (!string.IsNullOrEmpty(path))
            {
                Reflected(path);
            }
        }