示例#1
0
        private void btnCancelVoidRequest_Click(object sender, EventArgs e)
        {
            if (
                XtraMessageBox.Show(UserLookAndFeel.Default, "Are you sure, you want to request void for this Document?",
                                    "Are you sure:", MessageBoxButtons.YesNo, MessageBoxIcon.Information) ==
                DialogResult.Yes)
            {
                int receiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"].ToString());

                var grv = new ReceiptConfirmationPrintout();
                grv.Where.ReceiptID.Value = receiptID;
                grv.Query.Load();

                while (!grv.EOF)
                {
                    grv.VoidRequest = false;
                    grv.MoveNext();
                }

                grv.Save();
                this.LogActivity("Cancel-Void-Request", ReceiptID);
                XtraMessageBox.Show("Void request cancelled.", "Success");
            }
        }
        private void btnCancelVoidRequest_Click(object sender, EventArgs e)
        {
            if (XtraMessageBox.Show(DevExpress.LookAndFeel.UserLookAndFeel.Default, "Are you sure, you want to request void for this Document?", "Are you sure:", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.Yes)
            {
                int receiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"].ToString());

                ReceiptConfirmationPrintout grv = new ReceiptConfirmationPrintout();
                grv.Where.ReceiptID.Value = receiptID;
                grv.Query.Load();

                while (!grv.EOF)
                {
                    grv.SetColumnNull("VoidRequestUserID");
                    grv.VoidRequest = true;
                    grv.SetColumnNull("VoidRequestDateTime");
                    grv.MoveNext();
                }

                grv.Save();
                XtraMessageBox.Show("Void request cancelled.", "Success");
            }
        }
        private void btnVoid_Click(object sender, EventArgs e)
        {
            int receiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"].ToString());

            if(BLL.Receipt.AreThereIssues(receiptID))
            {
                if (CurrentContext.LoggedInUser.UserType == UserType.Constants.FINANCE) //Allow only the manager to void the GRV.
                {
                    if(XtraMessageBox.Show("There are issues with this GRV. Are you sure you want to void it anyway?","Confirmation",MessageBoxButtons.YesNo,MessageBoxIcon.Warning)==DialogResult.No)
                    {
                        return;
                    }
                }
                else
                {
                    XtraMessageBox.Show("There are issues with this GRV.  You can't void it.");
                    return;
                }
            }

            ReceiptConfirmationPrintout grv = new ReceiptConfirmationPrintout();
            grv.Where.ReceiptID.Value = receiptID;
            grv.Query.Load();

            if (!grv.VoidRequest)
            {
                XtraMessageBox.Show("Void needs to be first requested.", "Error", MessageBoxButtons.OK,
                                    MessageBoxIcon.Warning);
                return;
            }

            if (XtraMessageBox.Show(DevExpress.LookAndFeel.UserLookAndFeel.Default, "Are you sure, you want to Void the Document?", "Are you sure:", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.Yes)
            {
                while (!grv.EOF)
                {
                    grv.IsVoided = true;
                    grv.VoidApprovedByUserID = CurrentContext.UserId;
                    grv.VoidApprovalDateTime = DateTimeHelper.ServerDateTime;
                    grv.MoveNext();
                }

                grv.Save();

                ReturnToStoreForQuantityEdit();
            }
        }
        private void btnCancelVoidRequest_Click(object sender, EventArgs e)
        {
            if (
                XtraMessageBox.Show(UserLookAndFeel.Default, "Are you sure, you want to request void for this Document?",
                                    "Are you sure:", MessageBoxButtons.YesNo, MessageBoxIcon.Information) ==
                DialogResult.Yes)
            {
                int receiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"].ToString());

                var grv = new ReceiptConfirmationPrintout();
                grv.Where.ReceiptID.Value = receiptID;
                grv.Query.Load();

                while (!grv.EOF)
                {
                    grv.VoidRequest = false;
                    grv.MoveNext();
                }

                grv.Save();
                this.LogActivity("Cancel-Void-Request", ReceiptID);
                XtraMessageBox.Show("Void request cancelled.", "Success");
            }
        }
        private void btnVoid_Click(object sender, EventArgs e)
        {
            int receiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"].ToString());

            if (BLL.Receipt.AreThereIssues(receiptID))
            {
                XtraMessageBox.Show("There are issues with this GRV.  You can't void it.");
                return;
            }

            var grv = new ReceiptConfirmationPrintout();
            grv.Where.ReceiptID.Value = receiptID;
            grv.Query.Load();

            if (grv.IsColumnNull("VoidRequest") || !grv.VoidRequest)
            {
                XtraMessageBox.Show("Void needs to be first requested.", "Error", MessageBoxButtons.OK,
                                    MessageBoxIcon.Warning);
                return;
            }

            if (
                XtraMessageBox.Show(UserLookAndFeel.Default, "Are you sure, you want to Void the Document?",
                                    "Are you sure:", MessageBoxButtons.YesNo, MessageBoxIcon.Information) ==
                DialogResult.Yes)
            {
                while (!grv.EOF)
                {
                    grv.IsVoided = true;
                    grv.VoidApprovedByUserID = CurrentContext.UserId;
                    grv.VoidApprovalDateTime = DateTimeHelper.ServerDateTime;
                    grv.MoveNext();
                }

                grv.Save();
                ReturnToStoreForQuantityEdit();
                BLL.Receipt receiptStatus = new BLL.Receipt();
                receiptStatus.LoadByPrimaryKey(ReceiptID);
                receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.DRAFT_RECEIPT, null, this.GetFormIdentifier(), CurrentContext.UserId, "GRV Voided");

                this.LogActivity("Approve-Receipt-Void", ReceiptID);
            }
        }