static void Main(string[] args) { Console.WriteLine("Enter an integer"); int number = ISSConsole.ReadInt(); double sqrtInt = Math.Sqrt(number); Console.WriteLine("The square root of {0} is {1}", number, sqrtInt); ISSConsole.Pause(); }
static void Main() { // Write the Main Program for RequistionBrokerTest here... RequisitionBroker reqBroker = new RequisitionBroker(); Requisition req = new Requisition(); RequisitionDetail reqDetail = new RequisitionDetail(); Department dept = new Department(); Item item = new Item(); Employee emp = new Employee(); dept.Id = "COMM"; emp.Id = 1; emp.Department = dept; emp.Role = new Role(); emp.Role.Id = 1; emp.User = new User(); emp.User.Employee = emp; emp.User1 = new User(); emp.User1.Employee = emp; req.Department = dept; // req.Employee = emp; //req.Employee.Id=1; req.Remarks = "Insert Test"; //req.ApprovedDate=new DateTime(23-01-2012); //req.CreatedDate=new DateTime(23-01-2012); req.Status = 1; req.Employee = emp; req.Employee1 = emp; // reqDetail.Requisition.Id // reqDetail.Item.Id="1"; item.Id = "1"; reqDetail.Item = item; reqDetail.Qty = 10; reqDetail.DeliveredQty = 20; req.RequisitionDetails.Add(reqDetail); reqDetail.Item.Employee = reqDetail.Requisition.Employee; if (reqBroker.Insert(req).Equals("FAILED")) { Console.WriteLine("Successful"); } else { Console.WriteLine("Error"); } /* req.Id = "1"; * * if (reqBroker.GetRequisition(req) != null) * { * Console.WriteLine(reqBroker.GetRequisition(req).Remarks); * foreach(RequisitionDetail reqDetial in reqBroker.GetRequisition(req).RequisitionDetails) * Console.WriteLine(reqDetial.DeliveredQty); * } * * if (reqBroker.GetAllRequisition().Count > 0) * { * Console.WriteLine("Retrieve all requisitions"); * foreach (Requisition r in reqBroker.GetAllRequisition()) * { * Console.WriteLine(r.Id + " " + r.Remarks); * foreach (RequisitionDetail rd in r.RequisitionDetails) * { * Console.WriteLine(rd.Id + " " + rd.Item.Description); * } * } * } * else * { * Console.WriteLine("Cannot read all requisitions"); * } * * Console.WriteLine(SystemStoreInventorySystemUtil.Converter.objToInt(SystemStoreInventorySystemUtil.Constants.VISIBILITY_STATUS.SHOW)); * Console.WriteLine(SystemStoreInventorySystemUtil.Constants.VISIBILITY_STATUS.SHOW); */ #region /* Do not remove this or write codes after this */ ISSConsole.Pause(); #endregion }
static void Main() { Console.Write("Please choose an exercise 15-48: "); int choose = ISSConsole.ReadInt(); switch (choose) { case 15: Exercise.Ex15(); break; case 16: Exercise.Ex16(); break; case 17: Exercise.Ex17(); break; case 18: Exercise.Ex18(); break; case 19: Exercise.Ex19(); break; case 20: Exercise.Ex20(); break; case 21: Exercise.Ex21(); break; case 22: Exercise.Ex22(); break; case 23: Exercise.Ex23(); break; case 24: Exercise.Ex24(); break; case 25: Exercise.Ex25(); break; case 26: Exercise.Ex26(); break; case 27: Exercise.Ex27(); break; case 28: Exercise.Ex28(); break; case 29: Exercise.Ex29(); break; case 30: Exercise.Ex30(); break; case 31: Exercise.Ex31(); break; case 32: Exercise.Ex32(); break; case 33: Exercise.Ex33(); break; case 34: Exercise.Ex34(); break; case 35: Exercise.Ex35(); break; case 36: Exercise.Ex36(); break; case 37: Exercise.Ex37(); break; case 38: Exercise.Ex38(); break; case 40: Exercise.Ex40(); break; case 41: Exercise.Ex41(); break; case 42: Exercise.Ex42(); break; case 43: Exercise.Ex43(); break; case 44: Exercise.Ex44(); break; #region /* Do not remove this or write codes after this */ ISSConsole.Pause(); #endregion } }