/// <summary> /// 导入按钮的操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnImport_Click(object sender, EventArgs e) { if (button1.Enabled == true) { OutUncompared(); //导出未匹配 } if (this.dgvHisSend.RowCount < 1) { XtraMessageBox.Show("无可操作记录!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } IList <ImputPurchaseModel> result = new List <ImputPurchaseModel>(); foreach (DataRow dgvr in dtRequestSend.Rows) { if (dgvr["ProductCode"] == null || dgvr["ProductCode"].ToString() == "") { continue; } if ("0".Equals(dgvr["type"].ToString())) { ImputPurchaseModel model = new ImputPurchaseModel(); model.EmedProductId = dgvr["emedProductId"].ToString(); model.EmedSpecId = dgvr["emedSpecId"].ToString(); model.EmedModelId = dgvr["emedModelId"].ToString(); model.EmedSenderId = dgvr["emedSenderId"].ToString(); model.Psqymc = dgvr["emedSenderName"].ToString(); model.Psqyjc = dgvr["emedSenderEasy"].ToString(); model.Cgsl = dgvr["RequestQty"].ToString(); model.Cpmc = dgvr["ProductName"].ToString(); model.Scqymc = dgvr["FactoryName"].ToString(); model.Scqyjc = dgvr["factoryeasy"].ToString(); model.Bzdw = dgvr["SpecUnit"].ToString(); model.Price = dgvr["Price"].ToString(); model.Hcmc = dgvr["InstruName"].ToString(); model.Zdbz = dgvr["selfpackage"].ToString(); model.Brand = dgvr["Brand"].ToString(); result.Add(model); } } if (result.Count < 1) { XtraMessageBox.Show("无可导入数据!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } //转到制定采购单 FormPurchaseCreate frm = new FormPurchaseCreate("新建采购单", null, result); frm.ShowDialog();; frm.Dispose(); }
//审核采购单 private void btnSend_Click(object sender, EventArgs e) { if (this.gridView3.RowCount == 0) { XtraMessageBox.Show("无可操作记录!", Constant.MsgTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } DataTable dr = purchasedt.DefaultView.Table.DefaultView.ToTable(); FormPurchaseCreate frm = new FormPurchaseCreate("审核采购单", (DataRow)dr.Rows[this.gridView3.FocusedRowHandle]); frm.ShowDialog(); frm.Dispose(); this.cmbState.SelectedItem = "准备"; this.FormPurchaseBuild_Load(sender, e); }