private PrefferedRoomForGroupEntity CreatePrefferedRoomForGroupEntity()
        {
            int    id;
            int    Group    = int.Parse(group_combobx.Text);
            int    SubGroup = int.Parse(subgroup_combobx.Text);
            string RoomName = roomname_txtbx.Text;

            id = prefferedRoomForGroups.Last().id + 1;

            prefferedRoomForGroupEntity = new PrefferedRoomForGroupEntity(id, Group, SubGroup, RoomName);
            return(prefferedRoomForGroupEntity);
        }
 private void add_btn__Click(object sender, RoutedEventArgs e)
 {
     try
     {
         prefferedRoomForGroupEntity = CreatePrefferedRoomForGroupEntity();
         _prefferedRoomForGroupViewModel.SavePrefferedRoomForGroupData(prefferedRoomForGroupEntity);
         MessageBoxResult result = MessageBox.Show("Successfully Added!", "BBTG");
         ClearAll();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 3
0
 public void SaveData(PrefferedRoomForGroupEntity prefferedRoomForGroup)
 {
     using (IDbConnection con = new SQLiteConnection(AppData.ConnectionString))
     {
         try
         {
             con.Execute("INSERT INTO PrefferedRoomForGroup (id,GroupNumber,SubGroupNumber,RoomName) values (@id,@GroupNumber,@SubGroupNumber, @RoomName)", prefferedRoomForGroup);
         }
         catch (Exception e)
         {
             MessageBox.Show(e.Message);
         }
     }
 }
Exemplo n.º 4
0
 public void SavePrefferedRoomForGroupData(PrefferedRoomForGroupEntity prefferedRoomForGroup)
 {
     _prefferedRoomForGroupData.SaveData(prefferedRoomForGroup);
 }