private void btnRollBack_Click(object sender, EventArgs e)
        {
            List <RollBackDocument> lstDocument = null;

            try
            {
                if (this.picSelect.SelectedCount > 0)
                {
                    DialogResult isAuthen = DialogResult.None;

                    using (frmCOFAuthen fAuthen = new frmCOFAuthen())
                    {
                        isAuthen = UiUtility.ShowPopupForm(fAuthen, this, true);
                    }

                    if (isAuthen == DialogResult.OK)
                    {
                        DialogResult result = XtraMessageBox.Show(this, "Do you wnat to Roll Back Document?", "Please Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
                        if (result == DialogResult.Yes)
                        {
                            lstDocument = new List <RollBackDocument>(this.picSelect.SelectedCount);
                            for (int i = 0; i < this.picSelect.SelectedCount; i++)
                            {
                                DataRowView row = this.picSelect.GetSelectedRow(i) as DataRowView;
                                lstDocument.Add(new RollBackDocument()
                                {
                                    DOC_NO    = (this._TYPE.Equals("L") ? row["LOADING_NO"].ToString() : row["PICK_NO"].ToString()),
                                    SERIAL_NO = row["SERIAL_NO"].ToString()
                                });
                            }

                            this.RollBackDocument(lstDocument);
                        }
                    }
                    else
                    {
                        XtraMessageBox.Show(this, "You not priviledge for rollback items.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                    }
                }
                else
                {
                    XtraMessageBox.Show(this, "Please Select Record to Rollback!!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Пример #2
0
        private void btnAddNew_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult isAuthen = DialogResult.None;

                using (frmCOFAuthen fAuthen = new frmCOFAuthen())
                {
                    isAuthen = UiUtility.ShowPopupForm(fAuthen, this, true);
                }

                if (isAuthen == DialogResult.OK)
                {
                    DialogResult result = XtraMessageBox.Show(this, "Do you want to add new material?", "Please Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);

                    if (result == DialogResult.Yes)
                    {
                        this.FormState = eFormState.Add;
                        this.ClearDataOnScreen();

                        this.xtpMaterialDetail.PageVisible = true;
                        this.xtcMaterial.SelectedTabPage   = this.xtpMaterialDetail;

                        this.btnAddNew.Visible = false;
                        this.btnExit.Visible   = false;

                        this.txtMTL_CODE.Focus();
                    }
                }
                else
                {
                    XtraMessageBox.Show(this, "You do not have the right to add new material.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }