Пример #1
0
        public void Update(ListView listViewPayment)
        {
            lista = listViewPayment;
            int i = listViewPayment.SelectedIndices[0];

            selectedIndex = i;
            using (var context = new BCEntities())
            {
                List <Button> buttons     = this.Controls.OfType <Button>().Where(a => a.Name.StartsWith("btn")).ToList();
                var           paymentList = context.Payments.ToList();
                comBoxTitle.Text  = paymentList[i].Title;
                txtPrice.Text     = Math.Round(Convert.ToDecimal(paymentList[i].Price), 2).ToString();
                txtBuyerName.Text = paymentList[i].BuyerName;
                txtShopName.Text  = paymentList[i].ShopName;
                richTxtPaymentDescription.Text = paymentList[i].Description;
                lblPaymentDate.Text            = paymentList[i].PaymentDay.ToString();
                lblPurchaseDate.Text           = paymentList[i].PurchaseDate.ToString();
                txtBillNo.Text = paymentList[i].InvoiceNo;
                if (paymentList[i].Scan != null)
                {
                    pbxBillScan.Image = PaymentDetails.ConvertBinaryToImage(paymentList[i].Scan);
                }
                else
                {
                    pbxBillScan.Image = null;
                }
            }
        }