//修改 public void BillEdit(string billguid, IWin32Window ifrm) { txtGuid.Text = billguid; //加载选择项 CboBind(); //得到主表数据 DataTable dtl = rbm.GetRemoveBillData(txtGuid.Text); txtGuid.Text = dtl.Rows[0]["removebillGuid"].ToString(); dateTimePicker1.Text = dtl.Rows[0]["BillDate"].ToString(); txtBillID.Text = dtl.Rows[0]["BillDate"].ToString(); cboDepotOut.Text = dtl.Rows[0]["DepotOut"].ToString(); cboDepotIn.Text = dtl.Rows[0]["DepotIn"].ToString(); txtRemark.Text = dtl.Rows[0]["Remark"].ToString(); cboHandlePerson.Text = dtl.Rows[0]["HandlePerson"].ToString(); txtAutoBillID.Text = dtl.Rows[0]["BillAutoID"].ToString(); txtBillID.Text = dtl.Rows[0]["BillID"].ToString(); txtCreateDate.Text = dtl.Rows[0]["CreateDate"].ToString(); txtCreatePerson.Text = dtl.Rows[0]["CreatePerson"].ToString(); if (dtl.Rows[0]["CheckDate"].ToString().Contains("1900-01-01") == false) { txtCheckDate.Text = dtl.Rows[0]["CheckDate"].ToString(); } else { txtCheckDate.Text = ""; } txtCheckPerson.Text = dtl.Rows[0]["CheckPerson"].ToString(); if (dtl.Rows[0]["CheckPerson"].ToString() != "") { //设置为:已审核 SetControlEnable(1); } else { //设置为:没有审核 SetControlEnable(0); } //得到明细表数据 DataTable dtlDetail = rbm.GetRemoveBillDetailData(txtGuid.Text); this.gridControl1.DataSource = dtlDetail; gridMaterialGuid.Visible = false; gridMaterialId.Visible = false; //存放dataset供打印用数据集 ds.Tables.Add(dtl.Copy()); ds.Tables[0].TableName = "dtlRemoveBill"; ds.Tables.Add(dtlDetail.Copy()); ds.Tables[1].TableName = "dtlRemoveBillDetail"; this.Show(ifrm); }
private void gridControl1_Click(object sender, EventArgs e) { //显示出明细数据 if (gridView1.RowCount > 0) { //int intRow = gridView1.GetSelectedRows()[0]; string guid = ((DataRowView)(gridView1.GetFocusedRow())).Row[0].ToString(); //得到明细表数据 DataTable dtlDetail = RemoveBillManage.GetRemoveBillDetailData(guid); this.gridControl2.DataSource = dtlDetail; gridMaterialGuid.Visible = false; gridMaterialId.Visible = false; } }