示例#1
0
        private void btnSelectCommodity_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var frmShow = new Goodies.FrmShow();
                frmShow.ShowDialog();

                var        goodyId = frmShow.Result;
                Data.Goody goody   = null;
                if (goodyId != Guid.Empty)
                {
                    goody             = Business.GetGoodiesBusiness().GetById(goodyId);
                    txtCommodity.Text = goody.CName;
                }
                else
                {
                    txtCommodity.Text = string.Empty;
                }


                SetUnitCountComboBox(goodyId);
            }
            catch (Exception ex)
            {
                AccountingKernel.Forms.Base.BaseWindow.ShowError(ex);
            }
        }
示例#2
0
        /// <summary>
        /// commodity selection event click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSelectCommodity_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var frmShow = new Goodies.FrmShow();
                frmShow.ShowDialog();

                var        goodyId = frmShow.Result;
                Data.Goody goody   = null;
                if (goodyId == Guid.Empty)
                {
                    txtCommodityCode.Text = string.Empty;
                    return;
                }
                goody = Business.GetGoodiesBusiness().GetById(goodyId);
                txtCommodityCode.Text = goody.CName;


                SetUnitCountComboBox(goodyId);
                var company = Business.GetComBusiness().GetByName(txtCompany.Text.Trim());

                txtUnitPrice.Text = Business.GetGoodiesBusiness().SetPrice(cmbUnitCount.SelectedValue.ToGUID(), goody, company).ToString(Localize.DoubleMaskType);
            }
            catch (Exception ex)
            {
                AccountingKernel.Forms.Base.BaseWindow.ShowError(ex);
            }
        }