private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (!DataGridViewUtil.CheckPerrmisson(this, sender, e)) { return; } if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } List <PfAccountRecordSummaryInfo> list = DataGridViewUtil.BindingListToList <PfAccountRecordSummaryInfo>(dataGridView1.DataSource); PfAccountRecordSummaryInfo item = (PfAccountRecordSummaryInfo)list[e.RowIndex]; if (e.ColumnIndex == shouldPayDataGridViewTextBoxColumn.Index) { WholesaleAccountSummaryShouldPayForm form = new WholesaleAccountSummaryShouldPayForm(); PfAccountRecord4SummaryPara para = new PfAccountRecord4SummaryPara(); ReflectionHelper.CopyProperty(this.pagePara, para); para.Type = PARSQueryType.ShouldPay; para.PfCustomerID = item.SupplierID; form.ShowDialog(para); } else if (e.ColumnIndex == otherMoneyDataGridViewTextBoxColumn.Index) { WholesaleAccountSummaryShouldPayForm form = new WholesaleAccountSummaryShouldPayForm(); PfAccountRecord4SummaryPara para = new PfAccountRecord4SummaryPara(); ReflectionHelper.CopyProperty(this.pagePara, para); para.Type = PARSQueryType.OtherMoney; para.PfCustomerID = item.SupplierID; form.ShowDialog(para); } else if (e.ColumnIndex == payMoneyDataGridViewTextBoxColumn.Index) { WholesaleAccountSummaryShouldPayForm form = new WholesaleAccountSummaryShouldPayForm(); PfAccountRecord4SummaryPara para = new PfAccountRecord4SummaryPara(); ReflectionHelper.CopyProperty(this.pagePara, para); para.Type = PARSQueryType.PayMoney; para.PfCustomerID = item.SupplierID; form.ShowDialog(para); } } catch (Exception ee) { GlobalUtil.ShowError(ee); } finally { GlobalUtil.UnLockPage(this); } }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (!DataGridViewUtil.CheckPerrmisson(this, sender, e)) { return; } if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } try { if (GlobalUtil.EngineUnconnectioned(this)) { return; } // List<PfAccountContrastInfo> list = DataGridViewUtil.BindingListToList<PfAccountContrastInfo>(dataGridView1.DataSource); List <PfAccountContrastInfo> list = dataGridView1.DataSource as List <PfAccountContrastInfo>; PfAccountContrastInfo item = (PfAccountContrastInfo)list[e.RowIndex]; DataGridViewCell cell = this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex]; if (cell.Value != null && String.IsNullOrEmpty(cell.Value.ToString()) || cell.Value.ToString() == "0") { return; } if (e.ColumnIndex == inCountDataGridViewTextBoxColumn.Index || e.ColumnIndex == inMoneyDataGridViewTextBoxColumn.Index) { CostumeStoreTrackSearchTurnOutDetailWholeSaleForm form = new CostumeStoreTrackSearchTurnOutDetailWholeSaleForm(); AllocateOrder order = new AllocateOrder() { ID = item.OrderID }; form.ShowDialog(order); } else if (e.ColumnIndex == outCountDataGridViewTextBoxColumn.Index || e.ColumnIndex == outMoneyDataGridViewTextBoxColumn.Index) { CostumeStoreTrackSearchIntoDetailWholeSaleForm form = new CostumeStoreTrackSearchIntoDetailWholeSaleForm(); AllocateOrder order = new AllocateOrder() { ID = item.OrderID }; form.ShowDialog(order); } else if (e.ColumnIndex == otherMoneyDataGridViewTextBoxColumn.Index) { WholesaleAccountSummaryShouldPayForm form = new WholesaleAccountSummaryShouldPayForm(); PfAccountRecord4SummaryPara para = new PfAccountRecord4SummaryPara(); ReflectionHelper.CopyProperty(this.pagePara, para); para.Type = PARSQueryType.OtherMoney; form.ShowDialog(para, item.OrderID); } else if (e.ColumnIndex == payMoneyDataGridViewTextBoxColumn.Index) { WholesaleAccountSummaryShouldPayForm form = new WholesaleAccountSummaryShouldPayForm(); PfAccountRecord4SummaryPara para = new PfAccountRecord4SummaryPara(); ReflectionHelper.CopyProperty(this.pagePara, para); para.Type = PARSQueryType.PayMoney; form.ShowDialog(para, item.OrderID); } } catch (Exception ee) { GlobalUtil.ShowError(ee); } finally { GlobalUtil.UnLockPage(this); } }