public void SaveData(GroupNAEntity GroupNA) { using (IDbConnection con = new SQLiteConnection(AppData.ConnectionString)) { try { con.Execute("INSERT INTO GroupNA (GroupId, GroupNumber, Day, STime, ETime) values (@GroupId, @GroupNumber, @Day, @STime, @ETime)", GroupNA); } catch (Exception e) { MessageBox.Show(e.Message); } } }
public void UpdateData(GroupNAEntity GroupNA) { using (IDbConnection con = new SQLiteConnection(AppData.ConnectionString)) { try { con.Execute("UPDATE GroupNA SET GroupNumber=@GroupNumber, Day=@Day, STime=@STime, ETime=@ETime WHERE GroupId=@GroupId", GroupNA); } catch (Exception e) { MessageBox.Show(e.Message); } } }
private GroupNAEntity CreateGroupNAEntity() { int GroupId; GroupId = groupNAs.Last().GroupId + 1; string GroupNumber = group_combobx.Text; string Day = day_combobx.Text; string STime = starttime_combobx.Text; string ETime = endtime_combobx.Text; groupNAEntity = new GroupNAEntity(GroupId, GroupNumber, Day, STime, ETime); return(groupNAEntity); }
private void add_btn__Click(object sender, RoutedEventArgs e) { try { groupNAEntity = CreateGroupNAEntity(); groupNAViewModel.SaveGroupNAData(groupNAEntity); MessageBoxResult result = MessageBox.Show("Successfully Added!", "BBTG"); ClearAll(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void UpdateGroupNAData(GroupNAEntity groupNa) { _groupNAData.UpdateData(groupNa); }
public void SaveGroupNAData(GroupNAEntity groupNa) { _groupNAData.SaveData(groupNa); }