SQLiteCommand command = new SQLiteCommand("SELECT * FROM billdata WHERE Party LIKE ) / datagrid named 'dg' which also resides in the 3rd tabitem of the mainwindow / of the combobox 'cmb2' which resides in the 3rd tabitem of the mainwindow and shows them in the / It basically chooses those rows whose "Party" column value is equal to the text / UpdateFilteredDG() method filters data from the 'billdata' table in the database Using(SQLiteDataReader reader = cmd.ExecuteReader())ĭictionary.Add(reader.ToString(),reader.ToString()) Using(SQLiteCommand cmd = new SQLiteCommand(sqlQuery, conn)) / GetSuppData() method adds the data from the 'supps' table in the database SQLiteCommand command = new SQLiteCommand("SELECT * FROM billdata WHERE DueDt >= date('now','-100 days') AND DueDt Using(SQLiteConnection conn= new Source="+Path.GetFullPath("./Bills.db"))) / datagrid named 'realized' that resides in the 1st tabitem of the mainwindow / between 100 days in the past from today and 100 days in the future and display them in the / It basically chooses those rows whose "PaidOn" column value is empty and "DueDt" columns values are / FillRealizedDG() method filters data from the 'billdata' table in the database Using (var cmd = new SQLiteCommand(query, con))Ĭmd.Parameters.AddWithValue(pair.Key, pair.Value) Using (var con = new Source="+Path.GetFullPath("./Bills.db "))) Public void ExecuteWrite(string query, Dictionary args) / a simple method that executes a SQL query having 2 parameters FirstOrDefault(window => window is billWindow) as billWindow FirstOrDefault(window => window is editWindow) as editWindow īillWindow bwindow = FirstOrDefault(window => window is Window1) as Window1 ĮditWindow ewindow = Public class BillsViewModel : ViewModelBaseĭictionary dictionary = new Dictionary() Private ObservableCollection _billsRecords I have not added code for the button in the 3rd tabitem but it just further filters the data in the dg datagrid using the Textbox's data.īillsRecord.cs using The date and amount columns of each of the Datagrid's view have the formats dd-MM-yyyy and en-IN respectively. The MenuItem Edit Selected Record opens a new window editWindow which contains some Textbox's, DatePicker's and a Save button but the Textbox's and DatePicker's are filled with the selected row data on load.įurthermore, the Combobox's in both Tabitem 2 and 3 should get populated with unique data from the database table called billdata. The MenuItem Add New Record opens a new window billWindow which contains some Textbox's, DatePicker's and a Save button. When a valid text is typed into the Combobox the Datagrid dg should display some filtered data using Combobox text from database table billdata.Īlso, this Datagrid dg has 3 MenuItem's to Add, Edit and Deleted selected row from the Datagrid. The third Tabitem has a Datagrid named dg, a Combobox, few Label's, few Radiobutton's and a Button. The button named button4 just updates/adds some data to the last columns of rows which are selected (if any) of database table's billdata and cndndata. The button named button3 filteres data of database table's billdata and cndndata by taking the Combobox named cmb text and matching with the 2nd columns of both the database tables and shows them in both IMPGrid and EXPGrid. The button named billselection simply inverts selection of IMPGrid rows and the button cndnselection does the same for EXPGrid. The second Tabitem has 2 Datagrid's IMPGrid and EXPGrid,a Combobox, few TextBlock's and Button's. When the app launches this Datagrid should display some filtered data from a database table called billdata and also when any changes happens in the said table the Datagrid should update accordingly. The first Tabitem has a Datagrid named realized and couple of TextBlock's. The main app window consists of 3 Tabitem's. Net 4.5 and Sharpdevelop IDE (which is a discontinued 6 years ago) to build this app and yeah, please don't judge me on this.Īnyways, here are some details about this app. I'm building this on a decade old laptop with only 2 GB RAM, 20 GB of free storage in it and Windows7. I'm trying to develop a SQLite based WPF app (c#) utilizing the MVVM pattern.
0 Comments
Leave a Reply. |