コード例 #1
0
ファイル: FormReckoning.cs プロジェクト: xyt2008/Restaurant
        private void btRepayment_Click(object sender, EventArgs e)
        {
            if (m_OnCredit == null)
            {
                return;
            }
            FormRepayment dlg = new FormRepayment();

            dlg.ClientName = m_OnCredit.ClientName;
            dlg.Company    = m_OnCredit.Company;

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                string Employee = "";//有待修改
                string Remark   = dlg.Remark;

                if (CGlobalInstance.Instance.DbAdaHelper.OnCreditRepayment(m_OnCredit.OnCreditID, m_OnCredit.OnCreditSum, -dlg.Value, Employee, Remark))
                {
                    MessageBox.Show("还款成功!");
                }
                else
                {
                    MessageBox.Show("还款失败!");
                }
                int OnCreditID = m_OnCredit.OnCreditID;

                SetOnCreditDataSource();

                GetOnCreditItemInfo(OnCreditID);
            }
        }
コード例 #2
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            if (dgvMain.CurrentRow != null)
            {
                int    OnCreditID  = Convert.ToInt32(dgvMain.CurrentRow.Cells["ColumnOnCreditID"].Value);
                double OnCreditSum = Convert.ToDouble(dgvMain.CurrentRow.Cells["ColumnOnCreditSum"].Value);


                FormRepayment dlg = new FormRepayment();

                dlg.ClientName = dgvMain.CurrentRow.Cells["ColumnClientName"].Value.ToString();
                dlg.Company    = dgvMain.CurrentRow.Cells["ColumnCompany"].Value.ToString();

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    string Employee = "";//有待修改
                    string Remark   = dlg.Remark;

                    if (CGlobalInstance.Instance.DbAdaHelper.OnCreditRepayment(OnCreditID, OnCreditSum, -dlg.Value, Employee, Remark))
                    {
                        MessageBox.Show("还款成功!");
                    }
                    else
                    {
                        MessageBox.Show("还款失败!");
                    }
                }
            }
        }