예제 #1
0
        private void _riOperation_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (e.Button.Index == 0)
            {
                var saleBill = GetFocusedSaleBill();
                if (saleBill == null)
                {
                    MessageBoxHelper.Warn("没有找到销售单。");
                    return;
                }

                using (var dlg = new AddSaleBillForm(saleBill.Id))
                {
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        Query();
                    }
                }
            }
            else if (e.Button.Index == 1)
            {
                var saleBill = GetFocusedSaleBill();
                if (saleBill == null)
                {
                    MessageBoxHelper.Warn("没有找到销售单。");
                    return;
                }

                if (MessageBoxHelper.Question(string.Format("您确定要删除销售单“{0}”吗?", saleBill.GetDisplayText())))
                {
                    _service.DeleteSaleBill(saleBill.Id);
                    Query();
                }
            }
        }
예제 #2
0
 private void _btnAdd_Click(object sender, EventArgs e)
 {
     using (var dlg = new AddSaleBillForm())
     {
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             Query();
         }
     }
 }