Skip to content

Commit

Permalink
Remove commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
sghosalkar committed Mar 8, 2017
1 parent ce01ab8 commit 12b2130
Show file tree
Hide file tree
Showing 26 changed files with 133 additions and 322 deletions.
Binary file modified .vs/Class Management/v14/.suo
Binary file not shown.
1 change: 1 addition & 0 deletions Class Management/Class Management.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
<ItemGroup>
<Resource Include="Resources\Entypo-license.txt" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\System.Data.SQLite.Core.1.0.101.0\build\net45\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.101.0\build\net45\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand Down
39 changes: 0 additions & 39 deletions Class Management/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@
<TextBlock>Class Management Software</TextBlock>
<TextBlock>Version 1.0.0</TextBlock>
<TextBlock>Copyright © 2016 StudyLeague Education Services</TextBlock>
<TextBlock>All Rights Reserved</TextBlock>
<TextBlock>Developer: Shubham Ghosalkar</TextBlock>
<TextBlock>
Visit us at:
<Hyperlink NavigateUri="http://www.studyleague.com"
Expand Down Expand Up @@ -234,19 +232,6 @@
<!--<Button x:Name="ManualTimetable" Content="Manual Timetable" Style="{StaticResource SubFlyoutBtn}" />-->
</StackPanel>
</Controls:Flyout>
<!--
<Controls:Flyout x:Name="SchedulesFlyout" Position="Top" Theme="Accent" CloseButtonVisibility="Hidden" Height="80">
<Controls:Flyout.HeaderTemplate>
<DataTemplate>
<TextBlock Margin="50,25,0,0">Schedules</TextBlock>
</DataTemplate>
</Controls:Flyout.HeaderTemplate>
<StackPanel Orientation="Horizontal" Style="{StaticResource FlyoutStackpanel}">
<Button x:Name="LectureSchedules" Content="Lecture Schedules" Style="{StaticResource SubFlyoutBtn}" />
<Button x:Name="TestSchedules" Content="Test Schedules" Style="{StaticResource SubFlyoutBtn}" />
</StackPanel>
</Controls:Flyout>
-->
<Controls:Flyout x:Name="ToolsFlyout" Header="Tools" Position="Right" Theme="Dark" CloseButtonVisibility="Visible" Width="300" IsModal="True">
<Viewbox>
<Grid Width="300" Height="780">
Expand Down Expand Up @@ -275,15 +260,6 @@
Style="{StaticResource MetroFlatButton}" Click="change_subject_Click">
<Controls:PackIconMaterial x:Name="DeleteSubject" Kind="Delete" Height="15" Width="15" />
</Button>
<!--<ListView x:Name="subject_list" Height="200" Width="250" Margin="10,10,0,0"
Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2"
Style="{StaticResource VirtualisedMetroListView}">
<ListView.View>
<GridView>
<GridViewColumn Header="Subject list" Width="" DisplayMemberBinding="{Binding subject}" />
</GridView>
</ListView.View>
</ListView> -->
<TextBox x:Name="subject_textbox" Width="190" Height="25" Margin="10,10,0,0"
Grid.Column="0" Grid.Row="2" CharacterCasing="Upper"
HorizontalAlignment="Left" VerticalAlignment="Top" />
Expand Down Expand Up @@ -348,22 +324,7 @@

<Viewbox>
<Grid Background="AliceBlue" Height="855" Width="1590">
<!-- <Grid.Background>
<VisualBrush>
<VisualBrush.Visual>
<Image Source="Assets\Class.jpg" />
</VisualBrush.Visual>
</VisualBrush>
</Grid.Background> -->

<Grid Margin="2,3,2,38">
<!--<Grid VerticalAlignment="Top" Background="Teal" Height="35">
<Button x:Name="NotificationButton" HorizontalAlignment="Right" Width="50" Margin="0"
Click="NotificationFlyoutEvent"
Style="{StaticResource TransparentBtn}">
<Controls:PackIconMaterial Kind="MessageAlert" Height="20" Width="30" />
</Button>
</Grid>-->
<Grid Margin="100, 100, 370, 100" Background="White">
<Grid Margin="50">
<Grid.RowDefinitions>
Expand Down
25 changes: 2 additions & 23 deletions Class Management/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ public MainWindow()
this.Width = (System.Windows.SystemParameters.PrimaryScreenWidth * 0.89);
LoginFlyout.Height = (System.Windows.SystemParameters.PrimaryScreenHeight * 0.89);
LoginFlyout.Width = (System.Windows.SystemParameters.PrimaryScreenWidth * 0.89);
//Resources.Add("WindowHeight", SystemParameters.PrimaryScreenHeight);
//Resources.Add("WindowWidth", SystemParameters.PrimaryScreenWidth);
MetroDialogOptions.ColorScheme = MetroDialogColorScheme.Accented;

MetroDialogOptions.ColorScheme = MetroDialogColorScheme.Accented;
}

SQLiteConnection conn = new SQLiteConnection(@"Data Source=Database\MainDatabase.db;Version=3;");
Expand All @@ -46,7 +43,6 @@ private void mainWindow_Loaded(object sender, RoutedEventArgs e)
FillSubjects();
FillNotification();
ReminderCalendar.SelectedDate = DateTime.Today.Date;
//FillReminders(DateTime.Now.ToShortDateString());
}
private void mainWindow_Unloaded(object sender, RoutedEventArgs e)
{
Expand Down Expand Up @@ -185,9 +181,6 @@ private void change_subject_Click(object sender, RoutedEventArgs e)
{
try
{
//MessageBox.Show(date_of_birth.SelectedDate.Value.ToString("dd-MM-yyyy"));
//string sql = "CREATE TABLE subjects ( subject TEXT)";
//string sql = "DROP TABLE sellerinfo";
string sql;
var btn = sender as Button;
if(btn.Name == "add_subject")
Expand Down Expand Up @@ -252,7 +245,6 @@ public async void ErrorDialog(string msg)
await this.ShowMetroDialogAsync(dialog);
var txtblock = dialog.FindChild<TextBlock>("message_text");
txtblock.Text = msg;
//var dialo = (BaseMetroDialog)this.Resources["CustomDialogTest"];
}

private void LoginFlyoutBtn_Click(object sender, RoutedEventArgs e)
Expand Down Expand Up @@ -295,7 +287,7 @@ private void FillNotification()
dr.Read();
try {
temp = dr.GetString(0);
} catch(Exception e) { }
} catch(Exception) { }
if (temp == null)
{
CreateNotification(ele);
Expand Down Expand Up @@ -355,7 +347,6 @@ private void NotiBtn_Click(object sender, RoutedEventArgs e)
mainContent.Children.Add(res);
NotificationFlyout.IsOpen = false;
}
//MessageBox.Show(msg);
}

private void ReminderCalendar_SelectedDatesChanged(object sender, SelectionChangedEventArgs e)
Expand All @@ -364,11 +355,6 @@ private void ReminderCalendar_SelectedDatesChanged(object sender, SelectionChang
FillReminders(CurrentDate);
}

public class Reminder
{
string currentDate, title, text;
}

public void FillReminders(string Rdate)
{
string sql = "SELECT * FROM reminder WHERE remin_date='" + Rdate + "';";
Expand Down Expand Up @@ -424,13 +410,6 @@ private void red_Click(object sender, RoutedEventArgs e)
var app = App.Current as App;
string accentUrl = "pack://application:,,,/MahApps.Metro;component/Styles/Accents/" + (sender as Button).Name + ".xaml";
app.ChangeAccent(accentUrl);
//MainFlyout.Theme = FlyoutTheme.Accent;
}

private void Button_Click(object sender, RoutedEventArgs e)
{
string currentDate = ReminderCalendar.SelectedDate.Value.ToShortDateString();
OpenReminderDialog(currentDate, null, null);
}
}
}
1 change: 0 additions & 1 deletion Class Management/ReminderDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public void SetUpdateParameters(object context, string reminderDate, string titl
old_title = title;
old_text = text;
old_date = reminderDate;
//ReminderCalendar.SelectedDate = DateTime.Parse(reminderDate);
reminderDatePicker.SelectedDate = DateTime.Parse(reminderDate);
if(title != null || text != null)
{
Expand Down
7 changes: 0 additions & 7 deletions Class Management/Views/AddBatch.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ private void save_Click(object sender, System.Windows.RoutedEventArgs e)
SQLiteConnection conn;
conn = new SQLiteConnection(@"Data Source=Database\MainDatabase.db;Version=3;");
conn.Open();
//string sql = "CREATE TABLE batch ( batch_name TEXT UNIQUE, general_timing_from TEXT, general_timing_to TEXT, selected_subjects TEXT, batch_type TEXT)";
string general_timing_from = from_h.Text + ":" + from_m.Text + ":" + from_ampm.Text;
string general_timing_to = to_h.Text + ":" + to_m.Text + ":" + to_ampm.Text;
if (batch_name.Text == "" || general_timing_from == "::" || general_timing_to == "::")
Expand Down Expand Up @@ -149,11 +148,8 @@ internal void stringcmode(string batchnam)
SQLiteConnection conn;
conn = new SQLiteConnection(@"Data Source=Database\MainDatabase.db;Version=3;");
conn.Open();
//MessageBox.Show("Connected");

string sql = ("select * from batch where batch_name='" + igotbatch + "'; ");
SQLiteCommand command = new SQLiteCommand(sql, conn);
// command.ExecuteNonQuery();
SQLiteDataReader dr = command.ExecuteReader();
while (dr.Read())
{
Expand Down Expand Up @@ -295,8 +291,5 @@ private void FillDataGrid()
ErrorDialog(msg);
}
}


}

}
8 changes: 0 additions & 8 deletions Class Management/Views/AddStudent.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,11 @@ private void closeUC_Click(object sender, RoutedEventArgs e)

private void save_Click(object sender, RoutedEventArgs e)
{
//SQLiteConnection.CreateFile("MainDatabase.db");
try
{
SQLiteConnection conn;
conn = new SQLiteConnection(@"Data Source=Database\MainDatabase.db;Version=3;");
conn.Open();
//MessageBox.Show(date_of_birth.SelectedDate.Value.ToString("dd-MM-yyyy"));
//string sql = "CREATE TABLE student ( student_name TEXT, contact_no1 TEXT, studying_at TEXT, studying_at_name TEXT, address TEXT, student_email TEXT, parent_name TEXT, contact_no2 TEXT, reg_no TEXT PRIMARY KEY, batch TEXT, subjects TEXT, other_details TEXT, balance_fees TEXT)";
//string sql = "DROP TABLE sellerinfo";
if (student_name.Text == "" || contact_no1.Text == "" || reg_no.Text == "" || batch.Text == "")
{
ErrorDialog("Student Name, Contact number, Registration Number and Batch are mandatory.");
Expand Down Expand Up @@ -139,10 +135,8 @@ internal void stringaccmode(string studcod)
SQLiteConnection conn;
conn = new SQLiteConnection(@"Data Source=Database\MainDatabase.db;Version=3;");
conn.Open();
//MessageBox.Show("Connected");
string sql = ("select * from student where reg_no='" + updateStudent + "'; ");
SQLiteCommand command = new SQLiteCommand(sql, conn);
// command.ExecuteNonQuery();
SQLiteDataReader dr = command.ExecuteReader();
while (dr.Read())
{
Expand Down Expand Up @@ -182,7 +176,6 @@ private void FillBatch()
SQLiteConnection conn;
conn = new SQLiteConnection(@"Data Source=Database\MainDatabase.db;Version=3;");
conn.Open();
//MessageBox.Show("Connected");
string sql = "SELECT batch_name FROM batch;";
SQLiteCommand command = new SQLiteCommand(sql, conn);
command.ExecuteNonQuery();
Expand All @@ -207,7 +200,6 @@ private void FillDataGrid()
SQLiteConnection conn;
conn = new SQLiteConnection(@"Data Source=Database\MainDatabase.db;Version=3;");
conn.Open();
//MessageBox.Show("Connected");
string sql = "SELECT student_name, reg_no FROM student;";
SQLiteCommand command = new SQLiteCommand(sql, conn);
command.ExecuteNonQuery();
Expand Down
4 changes: 0 additions & 4 deletions Class Management/Views/AddTeacher.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ private void save_Click(object sender, RoutedEventArgs e)
SQLiteConnection conn;
conn = new SQLiteConnection(@"Data Source=Database\MainDatabase.db;Version=3;");
conn.Open();
//string sql = "CREATE TABLE teacher ( teacher_name TEXT, teacher_contact_no TEXT, qualification TEXT, other_details TEXT, teacher_email TEXT, teacher_code TEXT UNIQUE, teacher_subject TEXT, timing_optional TEXT )";
if (teacher_name.Text == "" || teacher_contact_no.Text == "" || teacher_subject.Text == "" || teacher_code.Text == "")
{
string msg = "Enter Teacher Name, Contact Number, Subject and Teacher Code (Mandatory)";
Expand Down Expand Up @@ -115,7 +114,6 @@ private void save_Click(object sender, RoutedEventArgs e)
}
catch (SQLiteException eg)
{
//string msg = "Please check input again(This teacher code might already be in use)";
ErrorDialog(eg.Message);
}
catch (Exception ex)
Expand All @@ -133,10 +131,8 @@ public void stringandmode(string trcode)
SQLiteConnection conn;
conn = new SQLiteConnection(@"Data Source=Database\MainDatabase.db;Version=3;");
conn.Open();
//MessageBox.Show("Connected");
string sql = ("select * from teacher where teacher_code='" + updateTeacher + "'; ");
SQLiteCommand command = new SQLiteCommand(sql, conn);
// command.ExecuteNonQuery();
SQLiteDataReader dr = command.ExecuteReader();
while (dr.Read())
{
Expand Down
48 changes: 0 additions & 48 deletions Class Management/Views/DailyTimetable.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ private void Cell_Drop(object sender, DragEventArgs e)
DataGridRow dgr = tuple.Item2 as DataGridRow;
DataRowView drv = dgr.Item as DataRowView;
string row = drv["batch_name"].ToString();
//string col = sdr.Column.Header.ToString().ToLower();
string AllLecs = "";
string sql;
try
Expand Down Expand Up @@ -192,7 +191,6 @@ private void Cell_Drop(object sender, DragEventArgs e)
{
ErrorDialog(ex.GetType().Name + " " + ex.Message + "celldrop");
}
//MessageBox.Show(row + " " + col);
SetLecDuration(AllLecs, row);
txtblock.Text = AllLecs;
txtblock.VerticalAlignment = VerticalAlignment.Center;
Expand Down Expand Up @@ -293,7 +291,6 @@ private void table_Click(object sender, RoutedEventArgs e)
Button btn = sender as Button;
ActiveTable = btn.Name;
FillDataGrid(ActiveTable);
//MessageBox.Show(ActiveTable);
}

public void ClearTableBtn()
Expand Down Expand Up @@ -343,7 +340,6 @@ private string SetTimetableDay(int index)

private void SetSelectedDay_Click(object sender, RoutedEventArgs e)
{
//MessageBox.Show(DayComboBox.Text);
try
{
string sql;
Expand Down Expand Up @@ -436,8 +432,6 @@ private void Eraser_Click(object sender, RoutedEventArgs e)
public void FillSuggestions(string CurrentDay)
{
List<string> tchrs = new List<string>();
//List<Tuple<string, string>> tr = new List<Tuple<string, string>>();
//MessageBox.Show(CurrentDay);
string sql = "SELECT batch_name, batch_time FROM " + ActiveTable;
using (SQLiteCommand command = new SQLiteCommand(sql, conn))
{
Expand All @@ -454,7 +448,6 @@ public void FillSuggestions(string CurrentDay)
{
ttl += " " + ele;
}
//MessageBox.Show(ttl);
DisplayInDataGridCell(batch, ttl);
}
dr.Close();
Expand All @@ -471,44 +464,7 @@ private void DisplayInDataGridCell(string batch, string ttl)
if (batch == bth)
{
((TextBlock)(GetCell(i, 5).Content)).Text = ttl;

/*
var row = dailyTimetable.ItemContainerGenerator.ContainerFromItem(item) as DataGridRow;
DataGridCellInfo dgci = new DataGridCellInfo(dailyTimetable.Items[i], dailyTimetable.Columns[5]);
dailyTimetable.SelectedCells.Clear();
dailyTimetable.SelectedCells.Add(dgci);
dailyTimetable.CurrentCell = dgci;
DataGridCell dcell = dailyTimetable.SelectedItem as DataGridCell;
DataTemplate dttem = dcell.ContentTemplate;
dttem.DataType = typeof(TextBlock);
TextBlock txt = dcell.Content as TextBlock;
txt.Text = ttl;
/*
var cellContent = dgci.Column.GetCellContent(dgci.Item);
if(cellContent != null)
{
DataGridCell dcell = cellContent.Parent as DataGridCell;
TextBlock txt = dcell.Content as TextBlock;
txt.Text = ttl;
}
/*TextBlock cellContent = dailyTimetable.Columns[0].GetCellContent(row) as TextBlock;
cellContent.Text = ttl;*/
}
/*DataRowView drv = dailyTimetable.Items[i] as DataRowView;
string str = drv["batch_name"].ToString();
MessageBox.Show(str);*/
/*DataGridRow row = (DataGridRow)dailyTimetable.ItemContainerGenerator.ContainerFromIndex(i);
TextBlock cellContent = dailyTimetable.Columns[0].GetCellContent(row) as TextBlock;
if (cellContent != null)
{
//MessageBox.Show(cellContent.Text + "here bro");
object item = dailyTimetable.Items[i];
dailyTimetable.SelectedItem = item;
dailyTimetable.ScrollIntoView(item);
row.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
break;
}*/
}
}

Expand Down Expand Up @@ -564,7 +520,6 @@ public static T GetVisualChild<T>(Visual parent) where T : Visual

private List<string> GetMatchingTeachers(string batch, string timing, string CurrentDay)
{
//MessageBox.Show(batch + timing + CurrentDay);
List<string> tchrs = new List<string>();
int[] bTime = new int[2];
int[] tTime = new int[2];
Expand Down Expand Up @@ -608,8 +563,5 @@ private int MinuteSpan(string timeBlock)
}
return minConv;
}


}

}
2 changes: 0 additions & 2 deletions Class Management/Views/SetBatchTiming.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ public void FillBatch()
SQLiteConnection conn;
conn = new SQLiteConnection(@"Data Source=Database\MainDatabase.db;Version=3;");
conn.Open();
//MessageBox.Show("Connected");

string sql = "SELECT batch_name, timing_from, timing_to FROM batchtiming;";
string sql1 = "SELECT batch_name, general_timing_from, general_timing_to FROM batch;";
SQLiteCommand command = new SQLiteCommand(sql, conn);
Expand Down
Loading

0 comments on commit 12b2130

Please sign in to comment.