Beispiel #1
0
        private void RefreshDG()
        {
            var source = new BindingSource();

            source.DataSource            = _obj.Invoice_Detail;
            dgResult.DataSource          = source;
            dgResult                     = AddFunc.HideSpecificColoum(dgResult, "ID", "INVOICE_ID");
            dgResult.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            Amount = _obj.Invoice_Detail.Sum(item => item.Price);
            if (Amount > 1000000)
            {
                _obj.Discount = Amount * 10 / 100;
                Amount        = Amount * 90 / 100;
                AddFunc.MsgInfo("You Got a discount");
            }
            else
            {
                _obj.Discount = 0;
                Amount        = _obj.Invoice_Detail.Sum(item => item.Price);
            }
            lblPrice.Text = Amount.ToString();
            Dto           = new Invoice_DetailDTO();
        }