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();//已打开,获得焦点,置顶。
                    }
                }
            }
        }
예제 #2
0
 void Reflected( )
 {
     if (bill == "付款申请单" || bill == "收款记录单")
     {
         if (bill == "付款申请单")
         {
             FormPaymentTabie PaymentTabie = new FormPaymentTabie(billNum);
             PaymentTabie.ShowDialog();
         }
         if (bill == "收款记录单")
         {
             FormReceiptRecordtable ReceiptRecordtable = new FormReceiptRecordtable(billNum);
             ReceiptRecordtable.ShowDialog();
         }
     }
     else
     {
         if (bill.Equals("销售申请单"))
         {
             path = "FishClient.FormSalesRequisition";
         }
         if (bill.Equals("预售申请单"))
         {
             path = "FishClient.FormPresaleRequisition";
         }
         if (bill.Equals("鱼粉预售合同"))
         {
             path = "FishClient.FormPresaleRContract";
         }
         if (bill.Equals("现货销售合同"))
         {
             path = "FishClient.FormSalesRContract";
         }
         if (bill.Equals("提货单"))
         {
             path = "FishClient.FormBilloflading";
         }
         if (bill.Equals("磅单"))
         {
             path = "FishClient.FormOnepound";
         }
         if (bill.Equals("货物反馈单"))
         {
             path = "FishClient.FormCargoFeedbackSheet";
         }
         if (bill.Equals("公司问题反馈单"))
         {
             path = "FishClient.FormTheproblemsheet";
         }
         Assembly asm = Assembly.GetExecutingAssembly();
         Form     doc = (Form)asm.CreateInstance(path);
         Megres.oddNum = billNum;
         doc.Show();
     }
 }
예제 #3
0
        private void dataGridView1_CellClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            billNum = string.Empty;
            path    = string.Empty;

            if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("Numbering", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("销售申请单") == true)
                {
                    //关联表
                    FormSalesRequisition from = new FormSalesRequisition(dataGridView1.Rows [e.RowIndex].Cells ["Numbering"].Value.ToString( ));
                    from.ShowDialog( );
                }
            }
            if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("ContractCode", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("现货销售合同") == true)
                {
                    //关联表
                    FormSalesRContract from1 = new FormSalesRContract(dataGridView1.Rows [e.RowIndex].Cells ["Numbering"].Value.ToString( ));
                    from1.ShowDialog( );
                }
            }
            if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("Numbering1", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("付款申请单") == true)
                {
                    //关联表
                    if (PaymentTabie == null || PaymentTabie.IsDisposed)
                    {
                        PaymentTabie = new FormPaymentTabie(dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value.ToString(), "X");
                        PaymentTabie.Show();//未打开,直接打开。
                    }
                    else
                    {
                        PaymentTabie.Activate();//已打开,获得焦点,置顶。
                    }
                }
            }
            else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("Numbering2", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("提货单") == true)
                {
                    //提货单表
                    if (BillofladingTable == null || BillofladingTable.IsDisposed)
                    {
                        BillofladingTable = new FormBillofladingTable(dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value.ToString());
                        BillofladingTable.Show();//未打开,直接打开。
                    }
                    else
                    {
                        BillofladingTable.Activate();//已打开,获得焦点,置顶。
                    }
                }
            }
            else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("Numbering3", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("磅单") == true)
                {
                    //磅单表
                    if (OnepoundTable == null || OnepoundTable.IsDisposed)
                    {
                        OnepoundTable = new FormOnepoundTable(dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value.ToString(), false);
                        OnepoundTable.Show();//未打开,直接打开。
                    }
                    else
                    {
                        OnepoundTable.Activate();//已打开,获得焦点,置顶。
                    }
                }
            }
            else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("Numbering4", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("货物反馈单") == true)
                {
                    //TODO:此处改成货物反馈关联表
                    if (CargoFeedbackSheetTable == null || CargoFeedbackSheetTable.IsDisposed)
                    {
                        CargoFeedbackSheetTable = new FormCargoFeedbackSheetTable(dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value.ToString());
                        CargoFeedbackSheetTable.Show();//未打开,直接打开。
                    }
                    else
                    {
                        CargoFeedbackSheetTable.Activate();//已打开,获得焦点,置顶。
                    }
                }
            }
            else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("Numbering5", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("公司问题反馈单") == true)
                {
                    //TODO:此处改成问题反馈关联表
                    if (Theproblemsheet == null || Theproblemsheet.IsDisposed)
                    {
                        Theproblemsheet = new FormTheproblemsheetTable(dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value.ToString());
                        Theproblemsheet.Show();//未打开,直接打开。
                    }
                    else
                    {
                        Theproblemsheet.Activate();//已打开,获得焦点,置顶。
                    }
                }
            }
            else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("code3", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("退货单") == true)
                {
                    //退货表
                    if (ReturnTable == null || ReturnTable.IsDisposed)
                    {
                        ReturnTable = new FormReturnAssociation(dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value.ToString());
                        ReturnTable.Show();//未打开,直接打开。
                    }
                    else
                    {
                        ReturnTable.Activate();//已打开,获得焦点,置顶。
                    }
                }
            }
            else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("Numbering6", StringComparison.OrdinalIgnoreCase))
            {
                if (Authority.ProcessControText("收款记录单") == true)
                {
                    //关联表
                    if (ReceiptRecordtable == null || ReceiptRecordtable.IsDisposed)
                    {
                        ReceiptRecordtable = new FormReceiptRecordtable(dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value.ToString());
                        ReceiptRecordtable.Show();//未打开,直接打开。
                    }
                    else
                    {
                        ReceiptRecordtable.Activate();//已打开,获得焦点,置顶。
                    }
                }
            }
            if (!string.IsNullOrEmpty(path))
            {
                Reflected(path);
            }
        }
        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);
            }
        }
예제 #5
0
 private void dataGridView1_CellClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     billNum = string.Empty;
     path    = string.Empty;
     if (e.RowIndex < 0 || e.ColumnIndex < 0)
     {
         return;
     }
     if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("createman", StringComparison.OrdinalIgnoreCase))
     {
         if (Authority.ProcessControText("销售申请单") == true)
         {
             path    = "FishClient.FormSalesRequisition";
             billNum = dataGridView1.Rows [e.RowIndex].Cells ["Numbering"].Value.ToString( );
         }
     }
     else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("createman2", StringComparison.OrdinalIgnoreCase))
     {
         if (Authority.ProcessControText("现货销售合同") == true)
         {
             path    = "FishClient.FormSalesRContract";
             billNum = dataGridView1.Rows [e.RowIndex].Cells ["Numbering"].Value.ToString( );
         }
     }
     else if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("product_id", StringComparison.OrdinalIgnoreCase))//product_id
     {
         if (Authority.ProcessControText("鱼粉资料") == true)
         {
             FormNewFish fish = new FormNewFish(dataGridView1.Rows[e.RowIndex].Cells["product_id"].Value.ToString());
             fish.Show();
         }
     }
     else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("coun", StringComparison.OrdinalIgnoreCase))
     {
         if (Authority.ProcessControText("付款申请单") == true)
         {
             if (PaymentTabie == null || PaymentTabie.IsDisposed)
             {
                 PaymentTabie = new FormPaymentTabie(dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value.ToString(), "X");
                 PaymentTabie.Show();//未打开,直接打开。
             }
             else
             {
                 PaymentTabie.Activate();//已打开,获得焦点,置顶。
             }
         }
     }
     else if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("Numbering2", StringComparison.OrdinalIgnoreCase))
     {
         if (Authority.ProcessControText("出库单") == true)
         {
             //出库单表
             if (OutboundTable == null || OutboundTable.IsDisposed)
             {
                 OutboundTable = new FormOutboundAssociation(dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value.ToString());
                 OutboundTable.Show();//未打开,直接打开。
             }
             else
             {
                 OutboundTable.Activate();//已打开,获得焦点,置顶。
             }
         }
     }
     else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("Numbering3", StringComparison.OrdinalIgnoreCase))
     {
         if (Authority.ProcessControText("磅单") == true)
         {
             //磅单表
             if (BillofladingTable == null || BillofladingTable.IsDisposed)
             {
                 BillofladingTable = new FormOnepoundTable(dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value.ToString(), true);
                 BillofladingTable.Show();//未打开,直接打开。
             }
             else
             {
                 BillofladingTable.Activate();//已打开,获得焦点,置顶。
             }
         }
     }
     else if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("Numbering4", StringComparison.OrdinalIgnoreCase))
     {
         if (Authority.ProcessControText("货物反馈单") == true)
         {
             //TODO:此处改成货物反馈表
             if (CargoFeedbackSheetTable == null || CargoFeedbackSheetTable.IsDisposed)
             {
                 CargoFeedbackSheetTable = new FormCargoFeedbackSheetTable(dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value.ToString());
                 CargoFeedbackSheetTable.Show();//未打开,直接打开。
             }
             else
             {
                 CargoFeedbackSheetTable.Activate();//已打开,获得焦点,置顶。
             }
         }
     }
     else if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("Numbering5", StringComparison.OrdinalIgnoreCase))
     {
         if (Authority.ProcessControText("公司问题反馈单") == true)
         {
             //TODO:此处改成问题反馈表
             if (Theproblemsheet == null || Theproblemsheet.IsDisposed)
             {
                 Theproblemsheet = new FormTheproblemsheetTable(dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value.ToString());
                 Theproblemsheet.Show();//未打开,直接打开。
             }
             else
             {
                 Theproblemsheet.Activate();//已打开,获得焦点,置顶。
             }
         }
     }
     else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("code3", StringComparison.OrdinalIgnoreCase))
     {
         if (Authority.ProcessControText("退货单") == true)
         {
             //退货表
             if (ReturnTable == null || ReturnTable.IsDisposed)
             {
                 ReturnTable = new FormReturnAssociation(dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value.ToString());
                 ReturnTable.Show();//未打开,直接打开。
             }
             else
             {
                 ReturnTable.Activate();//已打开,获得焦点,置顶。
             }
         }
     }
     else if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("Numbering6", StringComparison.OrdinalIgnoreCase))
     {
         if (Authority.ProcessControText("收款记录单") == true)
         {
             FormReceiptRecordtable ReceiptRecordtable = null;
             if (ReceiptRecordtable == null || ReceiptRecordtable.IsDisposed)
             {
                 ReceiptRecordtable = new FormReceiptRecordtable(dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value.ToString());
                 ReceiptRecordtable.Show();//未打开,直接打开。
             }
             else
             {
                 ReceiptRecordtable.Activate();//已打开,获得焦点,置顶。
             }
         }
     }
     if (!string.IsNullOrEmpty(path))
     {
         Reflected(path);
     }
 }
예제 #6
0
 //单击
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex < 0 || e.RowIndex < 0)
     {
         return;
     }
     if (dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value != null)
     {
         _list.Numbering = dataGridView1.Rows[e.RowIndex].Cells["Numbering"].Value.ToString();
         if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("xssqBool", StringComparison.OrdinalIgnoreCase) == true)
         {
             if (Authority.ProcessControText("销售申请单") == true)
             {
                 FormSalesRequisition Sales = new FormSalesRequisition(_list.Numbering);
                 Sales.ShowDialog();
             }
         }
         if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("xshtBool", StringComparison.OrdinalIgnoreCase) == true)
         {
             if (Authority.ProcessControText("现货销售合同") == true)
             {
                 FormSalesRContract SalesRCont = new FormSalesRContract(_list.Numbering);
                 SalesRCont.ShowDialog();
             }
         }
         if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("fksqBool", StringComparison.OrdinalIgnoreCase) == true)
         {
             if (Authority.ProcessControText("付款申请单") == true)
             {
                 FormPaymentTabie PaymentTabie = new FormPaymentTabie(_list.Numbering, "X");
                 PaymentTabie.ShowDialog();
             }
         }
         if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("thdBool", StringComparison.OrdinalIgnoreCase) == true)
         {
             if (Authority.ProcessControText("提货单") == true)
             {
                 FormBillofladingTable BillofladingTable = new FormBillofladingTable(_list.Numbering);
                 BillofladingTable.ShowDialog();
             }
         }
         if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("bdbool", StringComparison.OrdinalIgnoreCase) == true)
         {
             if (Authority.ProcessControText("磅单") == true)
             {
                 FormOnepoundTable BillofladingTable = new FormOnepoundTable(_list.Numbering, false);
                 BillofladingTable.ShowDialog();
             }
         }
         if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("hwfkBool", StringComparison.OrdinalIgnoreCase) == true)
         {
             if (Authority.ProcessControText("货物反馈单") == true)
             {
                 FormCargoFeedbackSheetTable CargoFeedbackSheetTable = new FormCargoFeedbackSheetTable(_list.Numbering);
                 CargoFeedbackSheetTable.ShowDialog();
             }
         }
         if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("wtfkBool", StringComparison.OrdinalIgnoreCase) == true)
         {
             if (Authority.ProcessControText("公司问题反馈单") == true)
             {
                 FormTheproblemsheetTable Theproblemsheet = new FormTheproblemsheetTable(_list.Numbering);
                 Theproblemsheet.ShowDialog();
             }
         }
         if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("skjlBool", StringComparison.OrdinalIgnoreCase) == true)
         {
             if (Authority.ProcessControText("收款记录单") == true)
             {
                 FormReceiptRecordtable ReceiptRecordtable = new FormReceiptRecordtable(_list.Numbering);
                 ReceiptRecordtable.ShowDialog();
             }
         }
         if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("effect", StringComparison.OrdinalIgnoreCase) == true)
         {
             boolget = true;
         }
         else
         {
             boolget = false;
         }
     }
 }