示例#1
0
        public void Exe()
        {
            EmpRepo         repo = new EmpRepo();
            List <Employee> emps = repo.GetAll();

            Console.Clear();
            Console.WriteLine("Employee List");

            foreach (var items in emps)
            {
                Console.WriteLine(items.EmpId + " " + items.Name + " " + items.PhoneNumber);
            }

            Console.ReadKey();
        }
示例#2
0
        //public const int emp_rate_per_hr = 20;
        //public const int no_work_days = 2;
        //public const int max_hrs_in_mon = 100;

        static void Main(string[] args)
        {
            /*Console.WriteLine("Employee Wage Prob");
             * List<Company> Emp = new List<Company>();
             * Console.WriteLine("Enter no of companies: ");
             * int n = Convert.ToInt32(Console.ReadLine());
             * for (int i = 1; i <= n; i++)
             * {
             *  List<String> b = new List<String>();
             *  Console.WriteLine("Comp Name");
             *  String compName1 = Console.ReadLine();
             *  //b.Add(compName1);
             *  Console.WriteLine("Emp Rate");
             *  String emp_rate_per_hr = Console.ReadLine();
             *  //b.Add(emp_rate_per_hr);
             *  Console.WriteLine("No. of working hrs");
             *  String no_of_work_days = Console.ReadLine();
             *  //b.Add(no_of_work_days);
             *  Console.WriteLine("Max work hrs in a month");
             *  String max_hrs_in_mon = Console.ReadLine();
             *  //b.Add(max_hrs_in_mon);
             *  int cw1 = CalEmpWage(compName1, Convert.ToInt32(emp_rate_per_hr),Convert.ToInt32(no_of_work_days),Convert.ToInt32(max_hrs_in_mon));
             *  Console.WriteLine("Total wage for " + compName1 + " is " + cw1);
             *  //b.Add(cw1.ToString());
             *  //new Company { Name = "Mahesh Chand", Book = "ADO.NET Programming", Price = 49.95 };
             *  Emp.Add( new Company { compName = compName1, emp_rate_perHr = Convert.ToInt32(emp_rate_per_hr), no_work_days = Convert.ToInt32(no_of_work_days),
             *      max_hrs_in_mon = Convert.ToInt32(max_hrs_in_mon), cal_wage = cw1 });
             *  //Emp.Add(new company);
             *  //Emp.AddRange(b);
             * }
             * foreach (Company i in Emp)
             * {
             *  Console.WriteLine($"Company Details: {i.compName}:{i.emp_rate_perHr}:{i.no_work_days}:{i.max_hrs_in_mon}:{i.cal_wage}");
             * }*/

            Console.WriteLine("Welcome to Employee Payroll");
            EmpRepo  repo = new EmpRepo();
            Employee emp  = new Employee();

            /*emp.empId = 1;
             * emp.compId = "C1";
             * emp.empName = "AR";
             * emp.gender = "F";
             * emp.phNo = "568798089";
             * emp.addr = "Mumbai";
             */
            repo.GetAllEmployee();
        }
 public HomeController(EmpRepo empRepo)
 {
     _empRepo = empRepo;
 }
示例#4
0
 public EmpsController(EmpRepo emp)
 {
     repo = emp;
 }