private void tsbtnBalance_Click(object sender, EventArgs e)
 {
     try
     {
         if (MessageBox.Show("确定要提交吗?", "系统提示", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
         {
             GetRetailsOrderInstance();
             _retailsOrder.RetailOrderDetails = _retailOrderDetailList.ToArray();
             string msg = string.Empty;
             msg = PharmacyDatabaseService.AddRetailOrderAndDetails(_retailsOrder);
             if (msg.Length > 0)
             {
                 MessageBox.Show(msg, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Log.Error(ex);
     }
 }
Exemple #2
0
        private void tsbtnBalance_Click(object sender, EventArgs e)
        {
            try
            {
                if (MessageBox.Show("确定要提交吗?", "提示", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                {
                    if (string.IsNullOrEmpty(this.txtGotMoney.Text))
                    {
                        MessageBox.Show("收款值不能为空!!!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                    GetRetailsOrderInstance();
                    //if (_retailOrderDetailList.Select(p => p.ReturnAmount).Sum() <= 0)
                    //{
                    //    MessageBox.Show("退货数量必须大于0!!!", "系统信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    //}
                    _retailsOrder.RetailOrderDetails = _retailOrderDetailList.ToArray();

                    string msg = string.Empty;
                    msg = PharmacyDatabaseService.AddRetailOrderAndDetails(_retailsOrder);
                    if (msg.Length > 0)
                    {
                        MessageBox.Show(msg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        //this.tsbtnBalance.Enabled = false;
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("零售结算操作失败!!!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log.Error(ex);
            }
        }