void butReturn_Click(object sender, EventArgs e)
        {
            string[] VoucherIDs = _SerchPlanView.VoucherIDs;
            if (VoucherIDs.Length <= 0)
            {
                return;
            }

            if (DialogResult.OK == MessageBox.Show("WILL DELETE,CONTINUE?", "ITEM DELETE", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button2))
            {
                string msg   = "";
                int    count = 0;
                foreach (string item in VoucherIDs)
                {
                    DOCBiz _docBiz = new DOCBiz();
                    if (!_docBiz.DocDelete(item))
                    {
                        msg += "[" + item + "]";
                    }
                    else
                    {
                        count++;
                    }
                }
                if (count != VoucherIDs.Length)
                {
                    MessageBox.Show("ITEM " + msg + "DELETE FAILED!");
                }

                Query();
            }
        }
        private void DeletePlan()
        {
            string VoucherID = _QC21View.SelectVoucherID;

            if (VoucherID == "")
            {
                return;
            }

            _QC21Dialog.Reason = string.Format("Do you want to delete VoucherID: {0} ?", VoucherID);
            _QC21Dialog.ShowDialog();
            if (_QC21Dialog.rValue)
            {
                string msg    = "";
                DOCBiz docBiz = new DOCBiz();
                if (docBiz.DocDelete(VoucherID))
                {
                    WriteTips(8, "Delete successfull, VoucherID: " + VoucherID, false);

                    _QC21View.dtGrid = GetPlan();
                }
                else
                {
                    WriteTips(5, "Delete fail", false);
                }

                //WriteTips(5, CultureLanuage.Translator(this.Name, 9, "Delete VoucherID : {0} Fail. Error : {1}", VoucherID, msg));
            }
        }
Example #3
0
        /// <summary>
        /// 单据删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btVouRelease_Click(object sender, EventArgs e)
        {
            int rowCount = gridView1.SelectedRowsCount;

            if (rowCount <= 0)
            {
                MessageBox.Show("Please Choose Item!");
                return;
            }

            if (VoucherIDs.Length <= 0)
            {
                return;
            }

            if (DialogResult.OK == MessageBox.Show("WILL DELETE,CONTINUE?", "ITEM DELETE", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button2))
            {
                string msg   = "";
                int    count = 0;
                foreach (string item in VoucherIDs)
                {
                    if (!_docBiz.DocDelete(item))
                    {
                        msg += "[" + item + "]";
                    }
                    else
                    {
                        count++;
                    }
                }
                if (count != VoucherIDs.Length)
                {
                    MessageBox.Show("ITEM " + msg + "DELETE FAILED!");
                }
                SearchConfirm();
            }
        }