//查詢 private void tsbQuery_Click(object sender, EventArgs e) { string Msg = "是否要進行沖銷單[" + txtReversalID.Text + "]查詢動作?\r\n"; DialogResult DR; DR = MessageBox.Show(Msg, "查詢沖銷單", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (DR == DialogResult.Yes) { if (CheckField()) { SIS.DBClass.DBClassReversal DBCR = new DBClass.DBClassReversal(); SIS.Configuration.ClsReversalConfig CRC = new Configuration.ClsReversalConfig(); bool result = DBCR.QueryData(txtReversalID.Text, CRC); if (result) { MessageBox.Show("有找到沖銷單號:[" + txtReversalID.Text + "]資料!\r\n是否將沖銷單資料載入?", "搜尋結果", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (DR == DialogResult.Yes) { txtReversalID.Text = CRC.ReversalID; dtpReversalDate.Text = CRC.ReversalDate; cboReversalStaff.Text = CRC.ReversalStaff; if (CRC.ReversalType == "Customer") { //SIS.DBClass.DBClassCustomerInfo DBCCI = new DBClass.DBClassCustomerInfo(); // string CNAME = DBCCI.QueryData(CRC.CustomerOrManufacturer,"CNAME"); txtCustomerOrManufacturer.Text = CRC.CustomerOrManufacturer; rdoReversalShip.Checked = true; } else { //SIS.DBClass.DBClassManufacturerInfo DBCMI = new DBClass.DBClassManufacturerInfo(); //string CNAME = DBCMI.QueryData(CRC.CustomerOrManufacturer, "CNAME"); txtCustomerOrManufacturer.Text = CRC.CustomerOrManufacturer; rdoReversalStock.Checked = true; } txtStockIDOrShipID.Text = CRC.StockIDOrShipID; txtPaymentAmount.Text = CRC.PaymentAmount.ToString(); mtbReversalAmount.Text = CRC.ReversalAmount.ToString(); cbxIsReversal.Checked = CRC.IsReversal; cboPaymentType.Text = My.MyMethod.SearchComboBoxItems(cboPaymentType, CRC.PaymentType); rtbNotes.Text = CRC.Notes; } } else { MessageBox.Show("沒有找到沖銷單號:[" + txtReversalID.Text + "]資料!", "搜尋結果"); } } } else { MessageBox.Show("取消沖銷單查詢動作!!", "查詢沖銷單"); } }
//列印 private void tsbPrint_Click(object sender, EventArgs e) { if (CheckField()) { SIS.DBClass.DBClassReversal DBCR = new DBClass.DBClassReversal(); bool result = DBCR.QueryData(txtReversalID.Text); if (result) { FrmReportPrint FRP = new FrmReportPrint("ReversalID", txtReversalID.Text, "rptReversal"); FRP.ShowDialog(); } else { MessageBox.Show("沒有找到沖銷單號:[" + txtReversalID.Text + "]資料,無法列印!", "列印結果"); } } }