コード例 #1
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if (XtraMessageBox.Show("Are you sure to make re-dim", "Re-dim", MessageBoxButtons.YesNo) ==
                DialogResult.Yes)
            {
                var bl = new BusinessLogic.BlCustomer();
                try
                {
                    _redmipoints = decimal.Parse(txtactualpoints.EditValue.ToString());
                    var _points = bl.GetAvailablePointsInServer(_custno);
                    progressPanel1.Visible = true;
                    if (_points > 0)
                    {
                        txtactualpoints.EditValue = Math.Round(_points/100, 2);
                    }
                    else
                    {
                        txtactualpoints.EditValue = 0;
                    }
                    if (_redmipoints != Math.Round(_points/100, 2))
                    {
                        XtraMessageBox.Show("Customer points has changed", "Re-dim", MessageBoxButtons.OK);
                    }
                    _redmipoints = decimal.Parse(txtactualpoints.EditValue.ToString());
                    bl.UpdateCustomrePointsInServer(_custno,-_points);
                    Close();
                }
                catch (Exception ex)
                {
                    XtraMessageBox.Show("Error checking the available points try again", "Re-dim", MessageBoxButtons.OK);
                    _redmipoints = 0;
                    progressPanel1.Visible = false;
                }
            }

        }