private void btn_Done_Click(object sender, EventArgs e)
        {
            if (gridView1.RowCount != 0)
            {
                //DataTable dt_tick = new DataTable();
                //dt_tick = dt_grid.Clone();//dari import
                foreach (DataRow dr in dt_grid.Rows)
                {
                    //dt_tick.ImportRow(dr);
                    ModelsCollection.Add(new model(dr["counter"].ToString(), dr["memberName"].ToString(), dr["memberStart"].ToString()));
                }
                //if (dt_tick.Rows.Count == 0)
                //{
                //    MessageBox.Show("Please scan student card", "Axioma Agent", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //    return;
                //}


                if (_isFinger)
                {
                    PT_fingerMultiEnd_Alt pt_fingerMultiStart = new PT_fingerMultiEnd_Alt(_dt_finger_employees, lb_ClubName.Text, dt_grid);
                    if (pt_fingerMultiStart.ShowDialog() == DialogResult.OK)
                    {
                        this.DialogResult = DialogResult.OK;
                        this.Close();
                    }
                    else
                    {
                        this.DialogResult = DialogResult.Cancel;
                        this.Close();
                    }
                }
                //else
                //{
                //    PT_cardMultiEnd pt_cardMultiEnd = new PT_cardMultiEnd(lb_ClubName.Text, _dt_student);
                //    if (pt_cardMultiEnd.ShowDialog() == DialogResult.OK)
                //    {
                //        this.DialogResult = DialogResult.OK;
                //        this.Close();
                //    }
                //    else
                //    {
                //        this.DialogResult = DialogResult.Cancel;
                //        this.Close();
                //    }
                //}
            }
        }
Esempio n. 2
0
    public ViewModel()
    {
        var modelCollection = new ModelsCollection();

        for (var i = 0; i < 10; i++)
        {
            var testBook = new Book
            {
                Name = "Test Book " + i
            };
            testBook.Authors.Add(new Author
            {
                Name = "Test Author " + i
            });

            modelCollection.Add(testBook);;
        }

        Books = modelCollection.GetAll();
    }
Esempio n. 3
0
        private void btn_Done_Click(object sender, EventArgs e)
        {
            if (gridView1.RowCount != 0)
            {
                #region all card must be scan
                //int i = 0;
                //while (i < gridView1.RowCount)
                //{
                //    if (Convert.ToBoolean(gridView1.GetRowCellValue(i, "Check")) == false)
                //    {
                //        return;
                //    }
                //    i++;
                //}
                #endregion

                DataTable dt_tick = new DataTable();
                dt_tick = _dt_student.Clone();
                foreach (DataRow dr in _dt_student.Rows)
                {
                    if (Convert.ToBoolean(dr["Check"]) == true)
                    {
                        dt_tick.ImportRow(dr);
                        ModelsCollection.Add(new model(dr["counter"].ToString(), dr["memberName"].ToString(), dr["memberStart"].ToString()));
                    }
                }

                if (dt_tick.Rows.Count == 0)
                {
                    MessageBox.Show("Please scan student card", "Axioma Agent", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }


                if (_isFinger)
                {
                    PT_fingerMultiEnd pt_fingerMultiStart = new PT_fingerMultiEnd(_dt_finger_employees, _code_UserClubName, str_room, dt_tick);
                    if (pt_fingerMultiStart.ShowDialog() == DialogResult.OK)
                    {
                        this.DialogResult = DialogResult.OK;
                        this.Close();
                    }
                    else
                    {
                        this.DialogResult = DialogResult.Cancel;
                        this.Close();
                    }
                }
                else
                {
                    PT_cardMultiEnd pt_cardMultiEnd = new PT_cardMultiEnd(_code_UserClubName, str_room, dt_tick);
                    if (pt_cardMultiEnd.ShowDialog() == DialogResult.OK)
                    {
                        this.DialogResult = DialogResult.OK;
                        this.Close();
                    }
                    else
                    {
                        this.DialogResult = DialogResult.Cancel;
                        this.Close();
                    }
                }
            }
        }