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 (e.ColumnIndex == deliveryDataGridViewTextBoxColumn.Index) { try { if (CommonGlobalUtil.EngineUnconnectioned(this)) { return; } //发货明细 // GetPfInvoicingPara sendOutGoodDetailForm form = new sendOutGoodDetailForm(); DataTable dt = (DataTable)this.dataGridView1.DataSource; DataRow item = dt.Rows[e.RowIndex]; GetPfInvoicingPara changePara = new GetPfInvoicingPara(); ReflectionHelper.CopyProperty(this.pagePara, changePara); changePara.CostumeID = item["CostumeID"].ToString(); changePara.PfCustomerID = item["PfCustomerID"].ToString(); changePara.SizeName = item["SizeName"].ToString(); changePara.ColorName = item["ColorName"].ToString(); changePara.StartDate = changePara.StartDate; changePara.EndDate = changePara.EndDate; form.ShowDialog(changePara); } catch (Exception ex) { ShowError(ex); } finally { UnLockPage(); } } if (e.ColumnIndex == retailDataGridViewTextBoxColumn.Index) { //销售明细 try { if (CommonGlobalUtil.EngineUnconnectioned(this)) { return; } CustomSaleGoodDetailForm form = new CustomSaleGoodDetailForm(); DataTable dt = (DataTable)this.dataGridView1.DataSource; DataRow item = dt.Rows[e.RowIndex]; GetPfInvoicingPara changePara = new GetPfInvoicingPara(); ReflectionHelper.CopyProperty(this.pagePara, changePara); changePara.CostumeID = item["CostumeID"].ToString(); changePara.PfCustomerID = item["PfCustomerID"].ToString(); changePara.SizeName = item["SizeName"].ToString(); changePara.ColorName = item["ColorName"].ToString(); changePara.StartDate = changePara.StartDate; changePara.EndDate = changePara.EndDate; form.ShowDialog(changePara); } catch (Exception ex) { ShowError(ex); } finally { UnLockPage(); } } } catch (Exception ee) { CommonGlobalUtil.ShowError(ee); } }
private void View1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (!DataGridViewUtil.CheckPerrmisson(this, sender, e)) { return; } foreach (var cItem in curControlList) { DataGridViewColumnCollection ColumnsList = view.Columns; for (int i = 0; i < ColumnsList.Count; i++) { string controlName = "Delivery" + cItem.ToString(); DataGridViewLinkColumn curLink = (DataGridViewLinkColumn)view.Columns[controlName]; DataGridViewColumn curI = ColumnsList[i]; DataTable dt = (DataTable)curI.DataGridView.DataSource; int t = e.ColumnIndex; int p = curI.Index; if (curI.DataPropertyName == controlName && e.ColumnIndex == curI.Index) { if (e.RowIndex >= 0) { sendOutGoodDetailForm form = new sendOutGoodDetailForm(); DataRow item = dt.Rows[e.RowIndex]; GetPfInvoicingPara changePara = new GetPfInvoicingPara(); // ReflectionHelper.CopyProperty(this.pagePara, changePara); // string headList = this.view.MergeColumnNames[0]; //this.view.MergeColumnNames[] changePara.CostumeID = item["CostumeID"].ToString(); changePara.PfCustomerID = item["PfCustomerID" + cItem].ToString(); changePara.SizeName = item["SizeName"].ToString(); changePara.ColorName = item["ColorName"].ToString(); changePara.StartDate = new CJBasic.Date(this.dateTimePicker_Start.Value); changePara.EndDate = new CJBasic.Date(this.dateTimePicker_End.Value); form.ShowDialog(changePara); } } string controlName1 = "Retail" + cItem.ToString(); DataGridViewLinkColumn curLink1 = (DataGridViewLinkColumn)view.Columns[controlName1]; DataGridViewColumn curI1 = ColumnsList[i]; if (curI1.DataPropertyName == controlName1 && e.ColumnIndex == curI1.Index) { if (e.RowIndex >= 0) { CustomSaleGoodDetailForm form = new CustomSaleGoodDetailForm(); DataRow item = dt.Rows[e.RowIndex]; GetPfInvoicingPara changePara = new GetPfInvoicingPara(); // ReflectionHelper.CopyProperty(this.pagePara, changePara); changePara.CostumeID = item["CostumeID"].ToString(); changePara.PfCustomerID = item["PfCustomerID" + cItem].ToString(); changePara.SizeName = item["SizeName"].ToString(); changePara.ColorName = item["ColorName"].ToString(); changePara.StartDate = new CJBasic.Date(this.dateTimePicker_Start.Value); changePara.EndDate = new CJBasic.Date(this.dateTimePicker_End.Value); form.ShowDialog(changePara); } } /* string controlName2 = "PfCustomerStore" + cItem.ToString(); * DataGridViewLinkColumn curLink2 = (DataGridViewLinkColumn)view.Columns[controlName2]; * DataGridViewColumn curI2 = ColumnsList[i]; * if (curI1.DataPropertyName == controlName2 && e.ColumnIndex == curI2.Index) * { * * int j = 0; * }*/ } //if (e.ColumnIndex == curLink.Index) //{ //} //DataGridViewLinkColumn curLink1 = (DataGridViewLinkColumn)view.Columns[controlName]; //if (e.ColumnIndex == curLink1.Index) //{ //} //string controlName2 = "PfCustomerStore" + cItem.ToString(); //DataGridViewLinkColumn curLink2 = (DataGridViewLinkColumn)view.Columns[controlName]; //if (e.ColumnIndex == curLink2.Index) //{ //} } }