Example #1
0
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.Button != System.Windows.Forms.MouseButtons.Left)
            {
                return;
            }
            if (e.RowIndex < 0 || e.ColumnIndex < 0)
            {
                return;
            }
            if (ListSalesTaxRate == null || ListSalesTaxRate.Count <= 0)
            {
                return;
            }
            int rdx = e.RowIndex;

            this.dataGridView1.Rows[rdx].Selected = true;
            Guid uid = (Guid)ListSalesTaxRate[rdx].UserId;
            Guid pid = (Guid)ListSalesTaxRate[rdx].PurchaseUnitId;

            this.comboBox2.SelectedValue = uid;
            this.comboBox1.ValueMember   = "Id";
            this.comboBox1.DisplayMember = "Name";
            this.comboBox1.DataSource    = this.ListPurchaseUnit;
            this.comboBox1.SelectedValue = pid;
            this.textBox1.Text           = ListSalesTaxRate[rdx].MRate.ToString();
            this.textBox2.Text           = ListSalesTaxRate[rdx].IRate.ToString();

            this.CurrentTaxRate           = ListSalesTaxRate[rdx];
            this.toolStripButton5.Visible = true;
            this.label11.Text             = "修改";
        }
Example #2
0
        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            Guid Gid = this.ListSalesTaxRate[this.dataGridView1.CurrentCell.RowIndex].Id;

            Business.Models.SalesTaxRate str = this.ListSalesTaxRate[this.dataGridView1.CurrentCell.RowIndex];

            if (MessageBox.Show("确定要删除该条记录吗? " + str.EmployeeName + " : " + str.PurchaseUnitName, "提示", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel)
            {
                return;
            }
            if (this.PharmacyDatabaseService.DeleteTaxRate(out msg, Gid))
            {
                MessageBox.Show("删除该条记录成功!");
            }
            else
            {
                MessageBox.Show("删除该条记录失败,请联系管理员!");
            }
            this.toolStripButton5.Visible = false;
            this.search();
        }