static void Main(string[] args) { //Salary.EmployeesBetweenDateRange(DateTime.Parse("10-14-2019"), DateTime.Parse("10-15-2019")); //Salary.EmployeesGroupData(); EmployeeRepo repo = new EmployeeRepo(); EmployeePayroll employee = new EmployeePayroll(); employee.EmployeeName = "rao"; employee.CompanyId = 420; employee.PhoneNumber = "1234567890"; employee.Address = "1-106,sunnada"; employee.Department = ".Net"; employee.Gender = 'M'; employee.StartDate = DateTime.Parse("10-24-2009"); employee.City = "srikakulam"; employee.Country = "India"; if (repo.AddEmployee(employee)) { Console.WriteLine("Added data to the database"); } repo.AddEmployeeWithThread(employee); //repo.GetAllEmployee(); }
static void Main(string[] args) { Console.WriteLine("Welcome to Employee Payroll Service!"); EmployeeModel model = new EmployeeModel(); model.EmployeeName = "Akash"; model.PhoneNumber = "9875241630"; model.Address = "Mumbai"; model.Department = "SD"; model.Gender = 'M'; model.BasicPay = 53000; model.Deductions = 2000; model.TaxablePay = 500; model.Tax = 1000; model.NetPay = 50000; model.StartDate = DateTime.Now; model.City = "Mulund"; model.Country = "In"; EmployeeRepo repo = new EmployeeRepo(); Console.WriteLine("Displaying All Data"); repo.GetAllEmployee(); bool res = repo.AddEmployee(model); if (res) { Console.WriteLine("Employee Added Successfully"); repo.GetAllEmployee(); } else { Console.WriteLine("Employee isn't Added"); } Console.WriteLine("Retrieving Employee from StartDate"); EmployeeModel model1 = new EmployeeModel() { StartDate = DateTime.Parse("2018-06-26") }; repo.RetrieveEmployeeBasedOnStartDate(model1); Console.WriteLine("Retrieving Sum Avg Min Max from Employee"); EmployeeModel model2 = new EmployeeModel() { Gender = 'M' }; repo.FindSumAvgMinMaxSalaryOfEmployee(model2); }
private static void AddNewEmployee(EmployeeRepo employeeRepo) { EmployeeModel employee = new EmployeeModel(); employee.EmployeeName = "Dibya"; employee.Department = "Tech"; employee.PhoneNumber = "6309807918"; employee.Address = "02-Khajauli"; employee.Gender = 'M'; employee.BasicPay = 110000.00M; employee.Deductions = (SqlMoney)1500.00; employee.StartDate = employee.StartDate = Convert.ToDateTime("2020-11-03"); if (employeeRepo.AddEmployee(employee)) { Console.WriteLine("Records added successfully"); } employeeRepo.RemoveEmployee("Satyam", 6); }
static void Main(string[] args) { //Console.WriteLine("Hello World!"); Console.WriteLine("Welcome to Employee Payroll!"); EmployeeRepo repo = new EmployeeRepo(); EmployeeModel employee = new EmployeeModel(); //employee.EmployeeName = "Indal1"; //employee.Department = "Tech1"; //employee.PhoneNumber = "6302907918"; //employee.Address = "02-Khajauli1"; //employee.Gender = 'M'; //employee.BasicPay = 10000.00M; //employee.Deductions = 1500.00; //employee.StartDate = employee.StartDate = Convert.ToDateTime("2020-11-03"); if (repo.AddEmployee(employee)) { Console.WriteLine("Records added successfully"); } repo.GetAllEmployee(); Console.ReadKey(); }
static void Main(string[] args) { Console.WriteLine("Welcome to Employee Payroll Service!"); EmployeeRepo employeeRepo = new EmployeeRepo(); EmployeeModel employeeModel = new EmployeeModel(); SalaryUpdateModel updateModel = new SalaryUpdateModel(); ///Get All Employee present in Employee_Payroll table employeeRepo.GetAllEmployee(); ///Update Employee Salary employeeModel.SalaryId = 1; employeeModel.SalaryMonth = "Jan"; employeeModel.Salary = 500000.00; employeeModel.EmpId = 2; employeeRepo.UpdateEmployeeSalary(updateModel); ///Get All Employee in a particular data range employeeRepo.GetAllEmployeeInADataRange(); ///Get data by Gender employeeRepo.GetDataByGroupByGender(); ///Add Employee Details employeeModel.EmpName = "Appu"; employeeModel.Salary = 500000.00; employeeModel.Start_Date = Convert.ToDateTime("12/05/2020"); employeeModel.Gender = 'F'; employeeModel.Phone_Number = "9877553212"; employeeModel.Employee_Address = "Kharadi"; employeeModel.Department = "Tetsing"; employeeModel.Basic_Pay = 8765.00; employeeModel.Deductions = 9876.00; employeeModel.Taxable_Pay = 97765.00; employeeModel.Income_Tax = 7654.00; employeeModel.Net_Pay = 6543.00; employeeModel.EmpId = 6; employeeModel.DeptId = 7; employeeModel.DeptName = "Development"; employeeModel.DeptLocation = "Pune"; employeeModel.SalaryMonth = "Jan"; ///Add Employee in Employee_Payroll table employeeRepo.AddEmployee(employeeModel); ///Remove particular employee entry using EmpId employeeRepo.RemoveEmployee(); ///Get Employee Details present in Employee table employeeRepo.GetAllEmployeeDetails(); ///Get Department details from Department table employeeRepo.GetAllDepartment(); ///Get Salary of Employee from Salary table employeeRepo.GetEmployeeSalary(); ///Get Data by Gender using joins employeeRepo.GetDataByGroupByGenderER(); Console.WriteLine("Employee Payroll using Threads"); ///retrieve url string[] words = CreateWordArray(@"http://www.gutenberg.org/files/54700/54700-0.txt"); #region ParallelTasks Parallel.Invoke (() => { Console.WriteLine("Begin First Task..."); GetLongestWord(words); }, () => { Console.WriteLine("Begin Second Task..."); GetMostCommonWords(words); }, //close second action () => { Console.WriteLine("Begin Third Task..."); GetCountForWord(words, "Sleep"); } //close third action ); //close parallel.invoke #endregion }