public static void Main() { String depart_Name; Console.WriteLine("Enter the department name"); depart_Name = Console.ReadLine(); depart_Name = depart_Name.ToLower(); if (depart_Name.Equals("d1")) { Department1 d1 = new Department1(); dpartment1_get_data(d1); } else if (depart_Name.Equals("d2")) { Department2 d2 = new Department2(); dpartment2_get_data(d2); } else if (depart_Name.Equals("d3")) { Department3 d3 = new Department3(); dpartment3_get_data(d3); } else { System.Diagnostics.Debug.WriteLine("Department not found"); } }
public static void Main() { CheckSchedule ch1; String depart_Name; Console.WriteLine("Enter the department name as department1 , department2, or department3"); depart_Name = Console.ReadLine().ToLower(); switch (depart_Name) { case "department1": ch1 = new Department1(); getClassUse(ch1); break; case "department2": ch1 = new Department2(); getClassUse(ch1); break; case "department3": ch1 = new Department3(); getClassUse(ch1); break; default: Console.WriteLine("Not having the class named"); break; } }
public void Expression_With_Translation() { Department2 dept = null; IAlias alias = sql.Alias(() => dept); QueryResult result = engine.Compile(alias); Assert.Equal("\"dbo\".\"Dept\"", result.Sql); }
public void Expression_Method_Column() { Person2 person = null; Department2 dept = null; IOperator op = sql.Op(() => SqlExp.Like(person.Department.Guid, dept.Guid)); QueryResult result = engine.Compile(op); Assert.Equal("\"person\".\"DepartmentGuid\" LIKE \"dept\".\"Guid\"", result.Sql); Assert.Equal(new Dictionary <string, object>(), result.Parameters); }
public void Extension_Expression_Column() { IAlias person = sql.Alias("person"); Department2 dept = null; IOperator op = person["DepartmentGuid"].Like(() => dept.Guid); QueryResult result = engine.Compile(op); Assert.Equal("\"person\".\"DepartmentGuid\" LIKE \"dept\".\"Guid\"", result.Sql); Assert.Equal(new Dictionary <string, object>(), result.Parameters); }
public void Builder_Two_Expressions_Column() { Person2 person = null; Department2 dept = null; IOperator op = sql.NotLike(() => person.Department.Guid, () => dept.Guid); QueryResult result = engine.Compile(op); Assert.Equal("\"person\".\"DepartmentGuid\" NOT LIKE \"dept\".\"Guid\"", result.Sql); Assert.Equal(new Dictionary <string, object>(), result.Parameters); }
public static void dpartment2_get_data(Department2 objc) { if (room_Type.Equals("general")) { System.Diagnostics.Debug.WriteLine("Enter the duration in only hours"); duration = Convert.ToInt32(Console.ReadLine()); objc.total = (objc.total + 30) * duration; System.Diagnostics.Debug.WriteLine("Enter the proced name as p1 or p2 can select only one"); proced_Name = Console.ReadLine().ToLower(); if (proced_Name.Equals("p1")) { objc.total = objc.total + objc.procedure1(); objc.calculate(objc.total); } else if (proced_Name.Equals("p2")) { objc.total = objc.total + objc.procedure2(); objc.calculate(objc.total); } else { System.Diagnostics.Debug.WriteLine("No Procdure"); } } else if (room_Type.Equals("icu")) { Console.WriteLine("Enter the duration in only hours"); duration = Convert.ToInt32(Console.ReadLine()); objc.total = (objc.total + 50) * duration; System.Diagnostics.Debug.WriteLine("Enter the proced name as p1 or p2 can select only one"); proced_Name = Console.ReadLine().ToLower(); if (proced_Name.Equals("p1")) { objc.total = objc.total + objc.procedure1(); objc.calculate(objc.total); } else if (proced_Name.Equals("p2")) { objc.total = objc.total + objc.procedure2(); objc.calculate(objc.total); } else { System.Diagnostics.Debug.WriteLine("No Procdure"); } } else { System.Diagnostics.Debug.WriteLine("Not a room Type"); } }
public static void getData(String dept_name) { Hospital h1; if (dept_name.Equals("d1")) { h1 = new Department1(); System.Diagnostics.Debug.WriteLine("Enter the room type as general or icu: " + room_Type); room_Type = Console.ReadLine().ToLower(); if (room_Type.Equals("general")) { System.Diagnostics.Debug.WriteLine("Enter the duration in only hours: " + duration); duration = Convert.ToInt32(Console.ReadLine()); total = (total + 30) * duration; System.Diagnostics.Debug.WriteLine("Enter the proced name as p1 or p2 can select only one: " + proced_Name); proced_Name = Console.ReadLine().ToLower(); if (proced_Name.Equals("p1")) { total = total + h1.proced1(); h1.Calculate(total); } else if (proced_Name.Equals("p2")) { total = total + h1.proced2(); h1.Calculate(total); } else { System.Diagnostics.Debug.WriteLine("No Procdure"); } } else if (room_Type.Equals("icu")) { System.Diagnostics.Debug.WriteLine("Enter the duration in only hours: " + duration); duration = Convert.ToInt32(Console.ReadLine()); total = (total + 50) * duration; System.Diagnostics.Debug.WriteLine("Enter the proced name as p1 or p2 can select only one: " + proced_Name); proced_Name = Console.ReadLine().ToLower(); if (proced_Name.Equals("p1")) { total = total + h1.proced1(); h1.Calculate(total); } else if (proced_Name.Equals("p2")) { total = total + h1.proced2(); h1.Calculate(total); } else { System.Diagnostics.Debug.WriteLine("No Procdure"); } } else { System.Diagnostics.Debug.WriteLine("Not a room Type"); } } else if (dept_name.Equals("d2")) { h1 = new Department2(); System.Diagnostics.Debug.WriteLine("Enter the room type as general or icu: " + room_Type); room_Type = Console.ReadLine().ToLower(); if (room_Type.Equals("general")) { System.Diagnostics.Debug.WriteLine("Enter the duration in only hours: " + duration); duration = Convert.ToInt32(Console.ReadLine()); total = (total + 30) * duration; System.Diagnostics.Debug.WriteLine("Enter the proced name as p1 or p2 can select only one: " + proced_Name); proced_Name = Console.ReadLine().ToLower(); if (proced_Name.Equals("p1")) { total = total + h1.proced1(); h1.Calculate(total); } else if (proced_Name.Equals("p2")) { total = total + h1.proced2(); h1.Calculate(total); } else { System.Diagnostics.Debug.WriteLine("No Procdure"); } } else if (room_Type.Equals("icu")) { System.Diagnostics.Debug.WriteLine("Enter the duration in only hours: " + duration); duration = Convert.ToInt32(Console.ReadLine()); total = (total + 50) * duration; System.Diagnostics.Debug.WriteLine("Enter the proced name as p1 or p2 can select only one: " + proced_Name); proced_Name = Console.ReadLine().ToLower(); if (proced_Name.Equals("p1")) { total = total + h1.proced1(); h1.Calculate(total); } else if (proced_Name.Equals("p2")) { total = total + h1.proced2(); h1.Calculate(total); } else { System.Diagnostics.Debug.WriteLine("No Procdure"); } } else { System.Diagnostics.Debug.WriteLine("Not a room Type"); } } else if (dept_name.Equals("d3")) { h1 = new Department3(); System.Diagnostics.Debug.WriteLine("Enter the room type as general or icu: " + room_Type); room_Type = Console.ReadLine().ToLower(); if (room_Type.Equals("general")) { System.Diagnostics.Debug.WriteLine("Enter the duration in only hours :" + room_Type); duration = Convert.ToInt32(Console.ReadLine()); total = (total + 30) * duration; System.Diagnostics.Debug.WriteLine("Enter the proced name as p1 or p2 can select only one: " + proced_Name); proced_Name = Console.ReadLine().ToLower(); if (proced_Name.Equals("p1")) { total = total + h1.proced1(); h1.Calculate(total); } else if (proced_Name.Equals("p2")) { total = total + h1.proced2(); h1.Calculate(total); } else { System.Diagnostics.Debug.WriteLine("No Procdure"); } } else if (room_Type.Equals("icu")) { System.Diagnostics.Debug.WriteLine("Enter the duration in only hours: " + duration); duration = Convert.ToInt32(Console.ReadLine()); total = (total + 50) * duration; System.Diagnostics.Debug.WriteLine("Enter the proced name as p1 or p2 can select only one: " + proced_Name); proced_Name = Console.ReadLine().ToLower(); if (proced_Name.Equals("p1")) { total = total + h1.proced1(); h1.Calculate(total); } else if (proced_Name.Equals("p2")) { total = total + h1.proced2(); h1.Calculate(total); } else { System.Diagnostics.Debug.WriteLine("No Procdure"); } } else { System.Diagnostics.Debug.WriteLine("Not a room Type"); } } else { System.Diagnostics.Debug.WriteLine("Department noit found"); } }
// an instructor must belong to a department: public Instructor2(Department2 department) { Department = department; }