Esempio n. 1
0
 private void gridCoachPay_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.RowIndex != -1)
     {
         CoachPayForm cpf = new CoachPayForm(this, manager);
         cpf.Show();
         int      currentCoachPayID = Convert.ToInt32(gridCoachPay.Rows[e.RowIndex].Cells[0].Value);
         CoachPay pay = pays.Where(x => x.ID == currentCoachPayID).ToList <CoachPay>()[0];
         cpf.Populate(pay, e.RowIndex);
     }
 }
Esempio n. 2
0
        public CoachPayForm(MainForm parentForm, AcademyMgr.AcademyMgr manager)
        {
            InitializeComponent();
            AcademyMgr          = manager;
            mainform            = parentForm;
            currentCoachPayment = new CoachPay();
            //On remplit la combo des coachs:
            List <Member> coachs = AcademyMgr.getMembers(true);

            cbCoachs.Items.AddRange(coachs.ToArray());
            cbCoachs.DisplayMember = "Lastname";
        }
Esempio n. 3
0
 public void Populate(CoachPay pay, int index)
 {
     rowIndex               = index;
     currentCoachPayment    = pay;
     cbCoachs.SelectedIndex = cbCoachs.FindStringExact(pay.Coach.Lastname);
     txtMonth.Text          = pay.Month;
     txtLessons.Text        = pay.Lessons.ToString();
     txtLessonPrice.Text    = pay.Pay.ToString();
     txtAmount.Text         = pay.Amount.ToString();
     txtComment.Text        = pay.Comment.ToString();
     if (pay.Date != DateTime.MinValue)
     {
         dateTimePickerReception.Value = pay.Date;
     }
 }