private void OpenMemberForm(String state)
        {
            String golfId = (string)members_dataGridView.SelectedRows[0].Cells[0].Value;
            NpgsqlCommand command = new NpgsqlCommand("SELECT * FROM \"Medlem\" WHERE \"Golf-ID\" = '" + golfId + "';", MainWindow.dbConnection);
            NpgsqlDataReader ndr = command.ExecuteReader();

            ndr.Read();
            Member m = new Member();
            m.GolfId = (string)ndr["Golf-ID"];
            m.FirstName = (string)ndr["Förnamn"];
            m.LastName = (string)ndr["Efternamn"];
            m.Adress = (string)ndr["Adress"];
            m.Zipcode = (string)ndr["Postnr"];
            m.City = (string)ndr["Stad"];
            m.Phone = (string)ndr["Telefonnummer"];
            m.Email = (string)ndr["Epost"];
            int status_id = (int)ndr["Status_id"];
            m.Membership = status_id.ToString();
            int betalatår = (int)ndr["BetalatÅr"];
            m.Paid = betalatår.ToString();
            double handi = (double)ndr["Handicap"];
            m.Handicap = handi.ToString();

            ndr.Close();
            var mf = new MemberForm(ref m, state);
            mf.ShowDialog();
            MainWindow.UpdateMember(m);
            SetDataTable(MainWindow.GetMemberTable());
        }
Ejemplo n.º 2
0
        private void OpenMemberForm(String state)
        {
            String           golfId  = (string)members_dataGridView.SelectedRows[0].Cells[0].Value;
            NpgsqlCommand    command = new NpgsqlCommand("SELECT * FROM \"Medlem\" WHERE \"Golf-ID\" = '" + golfId + "';", MainWindow.dbConnection);
            NpgsqlDataReader ndr     = command.ExecuteReader();

            ndr.Read();
            Member m = new Member();

            m.GolfId    = (string)ndr["Golf-ID"];
            m.FirstName = (string)ndr["Förnamn"];
            m.LastName  = (string)ndr["Efternamn"];
            m.Adress    = (string)ndr["Adress"];
            m.Zipcode   = (string)ndr["Postnr"];
            m.City      = (string)ndr["Stad"];
            m.Phone     = (string)ndr["Telefonnummer"];
            m.Email     = (string)ndr["Epost"];
            int status_id = (int)ndr["Status_id"];

            m.Membership = status_id.ToString();
            int betalatår = (int)ndr["BetalatÅr"];

            m.Paid = betalatår.ToString();
            double handi = (double)ndr["Handicap"];

            m.Handicap = handi.ToString();

            ndr.Close();
            var mf = new MemberForm(ref m, state);

            mf.ShowDialog();
            MainWindow.UpdateMember(m);
            SetDataTable(MainWindow.GetMemberTable());
        }
Ejemplo n.º 3
0
        private void nyMedlemToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Member m  = new Member();
            var    mf = new MemberForm(ref m, "NEW");

            mf.ShowDialog();
            if (!m.IsEmpty)
            {
                InsertMember(m);
            }
        }
 private void new_toolStripButton_Click(object sender, EventArgs e)
 {
     Member m = new Member();
     var mf = new MemberForm(ref m, "NEW");
     mf.ShowDialog();
     if (!m.IsEmpty)
     {
         MainWindow.InsertMember(m);
     }
     SetDataTable(MainWindow.GetMemberTable());
 }
Ejemplo n.º 5
0
        private void new_toolStripButton_Click(object sender, EventArgs e)
        {
            Member m  = new Member();
            var    mf = new MemberForm(ref m, "NEW");

            mf.ShowDialog();
            if (!m.IsEmpty)
            {
                MainWindow.InsertMember(m);
            }
            SetDataTable(MainWindow.GetMemberTable());
        }
Ejemplo n.º 6
0
 private void nyMedlemToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Member m = new Member();
     var mf = new MemberForm(ref m, "NEW");
     mf.ShowDialog();
     if (!m.IsEmpty)
     {
         InsertMember(m);
     }
 }