public EditMensurationResultWindow(DailyServer authorisation, DailyWindow dailyWindow, Mensuration mensuration) { InitializeComponent(); this._authorisation = authorisation; this._dailyWindow = dailyWindow; this._mensuration = mensuration; this.EditMensurationResultW_MensurationName_Label.Content = _mensuration.MName; this.EditMensurationResultW_ResultKind_Label.Content = _mensuration.MResultKind; this.EditMensurationResultW_MensurationResult_TBox.Text = _mensuration.MResultValue.ToString(); }
static void Main(string[] args) { string chc; Timetable t = new Timetable(); Headmaster h = new Headmaster(); Mensuration m = new Mensuration(); Console.WriteLine("Welcome to HK Primary School!!"); Console.WriteLine("The 5 subjects which the Students are supposed to learn!!"); h.DisplayTT(); do { Console.WriteLine(" Select the Subject by entering S.no"); int ch = int.Parse(Console.ReadLine()); switch (ch) { case 1: Console.WriteLine("----------We are Learning Maths----------"); Console.WriteLine("Enter two integers to calculate the area of a Reactangle!"); int x = int.Parse(Console.ReadLine()); int y = int.Parse(Console.ReadLine()); m.Calculate(x, y); Console.WriteLine("Enter three integers to calculate the volume of cuboid!"); int a = int.Parse(Console.ReadLine()); int b = int.Parse(Console.ReadLine()); int c = int.Parse(Console.ReadLine()); m.Calculate(a, b, c); Console.WriteLine("Enter a denominator to do division"); int d = int.Parse(Console.ReadLine()); try { m.Calculate(d); } catch (Exception e) { Console.WriteLine("----------ERROR----------"); Console.WriteLine("Method: {0}", e.TargetSite); Console.WriteLine("Message: {0}", e.Message); Console.WriteLine("Source: {0}", e.Source); Console.WriteLine("Class defining member: {0}", e.TargetSite.DeclaringType); } Console.WriteLine("The Maths hour is Over!!!! Class Disperse"); break; case 2: Console.WriteLine("----------We are Learning English----------"); Console.WriteLine("Enter a 5 letter string to reverse "); English eng = new English(); eng.Name = Console.ReadLine(); try { eng.Reverse(eng.Name); } catch (Exception o) { Console.WriteLine("----------ERROR----------"); Console.WriteLine("Method: {0}", o.TargetSite); Console.WriteLine("Message: {0}", o.Message); Console.WriteLine("Source: {0}", o.Source); Console.WriteLine("Class defining member: {0}", o.TargetSite.DeclaringType); } eng = new Derived(); Console.WriteLine("The alphabets in LoweCase!!"); Console.WriteLine(); Derived der = new Derived(); der.Recite(); Console.WriteLine(); Console.WriteLine("The English hour is Over!!!! Class Disperse"); break; case 3: Console.WriteLine("----------We are Learning Science----------"); Science sci = new Science(); sci.Quiz(); sci.Mquiz(); break; case 4: Console.WriteLine("----------We are Doing Arts now!! Have Fun!!----------"); Art.Shapes(); Console.WriteLine("Enter number of rows"); int rs = int.Parse(Console.ReadLine()); Art ar = new Art(); ar.Pattern(rs); break; default: Console.WriteLine("Go Home"); Console.WriteLine(); break; } Console.WriteLine(); Console.WriteLine("Do you want to learn more Subjects?(y/n)"); chc = Console.ReadLine(); } while (chc == "y"); Console.WriteLine("Now that we are done with The learning! Enter the performance details of students"); int m1, m2, m3, m4, m5; string n1, n2, n3, n4, n5; Console.WriteLine("----------Enter the FIVE Student Names and their Corresponding Marks!-----"); n1 = Console.ReadLine(); m1 = int.Parse(Console.ReadLine()); n2 = Console.ReadLine(); m2 = int.Parse(Console.ReadLine()); n3 = Console.ReadLine(); m3 = int.Parse(Console.ReadLine()); n4 = Console.ReadLine(); m4 = int.Parse(Console.ReadLine()); n5 = Console.ReadLine(); m5 = int.Parse(Console.ReadLine()); Results res = new Results(); res.Addname(n1, n2, n3, n4, n5); res.Addmarks(m1, m2, m3, m4, m5); res.Ranklist(); Console.ReadLine(); Console.WriteLine("--------------------THANKYOU AND GOODBYE!!! GO HOME SAFE!!!-------------------"); Console.ReadLine(); }
public void LoadDailyMensurationToListView() { LView_MensurationList.Clear(); var myDailyMensuration = _authorisation.GetMensurationTypes(); var myDailyMensurationValues = _authorisation.GetDailyMensurationInscription(DailyWindow.Me.UserId, DailyW_DailyCalendar_Calendar.SelectedDate.Value); foreach (var myMensuration in myDailyMensuration) { var LView_Mensuration = new Mensuration { MTypeId = myMensuration.MTypeId, MName = myMensuration.MName }; foreach (var myMensuratonValue in myDailyMensurationValues) { if (myMensuratonValue.MTypeId == myMensuration.MTypeId) { LView_Mensuration.MResultValue = myMensuratonValue.MResultValue; LView_Mensuration.MResultId = myMensuratonValue.MResultId; if (myMensuratonValue.MTypeId == 1 || myMensuratonValue.MTypeId == 10 || myMensuratonValue.MTypeId == 11 || myMensuratonValue.MTypeId == 12 || myMensuratonValue.MTypeId == 14) { LView_Mensuration.MResultKind = "kg"; } else if (myMensuratonValue.MTypeId == 13) { LView_Mensuration.MResultKind = "x"; } else if (myMensuratonValue.MTypeId == 2) { LView_Mensuration.MResultKind = "%"; } else { LView_Mensuration.MResultKind = "cm"; } } } LView_MensurationList.Add(LView_Mensuration); } }