Ejemplo n.º 1
0
        private void FormDeposit_Load(object sender, EventArgs e)
        {
            List <BankViewModel> list = bank.Read(null);

            if (list != null)
            {
                comboBox1.DisplayMember = "Name";
                comboBox1.ValueMember   = "Id";
                comboBox1.DataSource    = list;
                comboBox1.SelectedItem  = null;
            }
            if (id.HasValue)
            {
                try
                {
                    var view = deposit.Read(new DepositBindingModel {
                        Id = id
                    })?[0];
                    if (view != null)
                    {
                        textBox1.Text         = view.ClientFIO;
                        textBox2.Text         = view.SizeDeposit.ToString();
                        textBox3.Text         = view.Email;
                        dateTimePicker1.Value = view.DateOpened;
                        textBox4.Text         = view.TypeValue;
                    }
                }

                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }
            }
        }
Ejemplo n.º 2
0
 private void LoadData()
 {
     try
     {
         var list = deposit.Read(null);
         if (list != null)
         {
             dataGridView1.DataSource         = list;
             dataGridView1.Columns[0].Visible = false;
             dataGridView1.Columns[1].Visible = false;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 3
0
        public List <DepositViewModel> GetDeposits(ReportBindingModel model)
        {
            var deposits = deposit.Read(new DepositBindingModel
            {
                DateFrom = model.DateFrom,
                DateTo   = model.DateTo
            });
            var list = new List <DepositViewModel>();

            foreach (var serv in deposits)
            {
                var record = new DepositViewModel
                {
                    ClientFIO   = serv.ClientFIO,
                    SizeDeposit = serv.SizeDeposit,
                    Email       = serv.Email,
                    Name        = serv.Name,
                    TypeValue   = serv.TypeValue,
                    DateOpened  = serv.DateOpened
                };
                list.Add(record);
            }
            return(list);
        }