Пример #1
0
        private void txtUnitPrice_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            beforeValueDlg = "";
            if (_entityListD.Count >= DataForm.CurrentIndex)
            {
                beforeValueDlg = ExCast.zCStr(_entityListD[DataForm.CurrentIndex]._unit_price);
            }

            if (_txtUnitPrice == null)
            {
                _txtUnitPrice = ExVisualTreeHelper.FindTextBox(this.DataForm, "txtUnitPrice");
            }

            Dlg_UnitPriceSetting unitPriceDlg = new Dlg_UnitPriceSetting();

            // 税転換が内税で明細課税有りの場合
            if ((_entityH._tax_change_id == 4 || _entityH._tax_change_id == 5 || _entityH._tax_change_id == 6) && _entityListD[DataForm.CurrentIndex]._tax_division_id == 1)
            {
                unitPriceDlg.retail_price     = _entityListD[DataForm.CurrentIndex]._retail_price_before_tax;
                unitPriceDlg.sales_unit_price = _entityListD[DataForm.CurrentIndex]._sales_unit_price_before_tax;
                unitPriceDlg.sales_cost_price = _entityListD[DataForm.CurrentIndex]._sales_cost_price_before_tax;
            }
            else
            {
                unitPriceDlg.retail_price     = _entityListD[DataForm.CurrentIndex]._retail_price_skip_tax;
                unitPriceDlg.sales_unit_price = _entityListD[DataForm.CurrentIndex]._sales_unit_price_skip_tax;
                unitPriceDlg.sales_cost_price = _entityListD[DataForm.CurrentIndex]._sales_cost_price_skip_tax;
            }
            unitPriceDlg.unit_decimal_digit = _entityListD[DataForm.CurrentIndex]._unit_decimal_digit;
            unitPriceDlg.credit_rate        = _entityH._credit_rate;
            unitPriceDlg.Closed            += unitPriceDlg_Closed;
            unitPriceDlg.Show();
        }
Пример #2
0
        private void unitPriceDlg_Closed(object sender, EventArgs e)
        {
            Dlg_UnitPriceSetting unitPriceDlg = (Dlg_UnitPriceSetting)sender;

            if (unitPriceDlg.DialogResult == true)
            {
                if (_entityListD.Count > DataForm.CurrentIndex && DataForm.CurrentIndex != -1)
                {
                    _entityListD[DataForm.CurrentIndex]._unit_price = unitPriceDlg.return_unit_price;
                }
            }
            if (beforeValue != ExCast.zCStr(_entityListD[DataForm.CurrentIndex]._unit_price))
            {
                DataDetail.CalcDetail(DataForm.CurrentIndex, _entityH, _entityListD);
                this.Focus();
                _txtUnitPrice.Focus();
                _txtUnitPrice = null;
            }
        }