Beispiel #1
0
        public void NewEmployeeEntry(string filePath)
        {
            DataTable temEmployees = filereader.GetCsvData(filePath);

            Console.WriteLine("Enter Name of new Employee: ");
            string name = Console.ReadLine();

            Console.WriteLine("Enter Lastname: ");
            string lastname = Console.ReadLine();

            Console.WriteLine("Enter age : ");
            string age = Console.ReadLine();

            Console.WriteLine("Enter Position: ");
            string position = Console.ReadLine();

            Console.WriteLine("Enter Employee Id: ");
            string employeeId = Console.ReadLine();

            DataRow newrow = temEmployees.Rows.Add();

            newrow[0] = name;
            newrow[1] = lastname;
            newrow[2] = age;
            newrow[3] = position;
            newrow[4] = employeeId;
            temEmployees.Rows.Add(newrow);
            filewriter.CSVFileWriter(temEmployees, filePath);
        }
        public void AddToInventory()
        {
            DataTable tempInventory = freader.GetCsvData(InventoryMonth);

            Console.WriteLine("Enter food Item: ");
            string foodItem = Console.ReadLine();

            Console.WriteLine("Enter category: ");
            string category = Console.ReadLine();

            Console.WriteLine("Enter size Description: ");
            string sizedescription = Console.ReadLine();

            Console.WriteLine("Enter Purchase Unit Cost: ");
            int purchaseUnitCost = int.Parse(Console.ReadLine());

            Console.WriteLine("Enter units : ");
            int units = int.Parse(Console.ReadLine());

            Console.WriteLine("Enter cost: ");
            int     cost   = int.Parse(Console.ReadLine());
            DataRow newrow = tempInventory.NewRow();

            newrow[0] = foodItem;
            newrow[1] = category;
            newrow[2] = sizedescription;
            newrow[3] = purchaseUnitCost;
            newrow[4] = units;
            newrow[5] = cost;
            tempInventory.Rows.Add(newrow);
            fwriter.CSVFileWriter(tempInventory, InventoryMonth);
        }
Beispiel #3
0
        public void FireEmployee()
        {
            Console.WriteLine("Enter Employee Id");
            string employeeId = Console.ReadLine();

            Console.WriteLine("Enter reason to fire employee: ");
            string reason = Console.ReadLine();

            enreport.MakeFinalReaport(reason);

            DataTable employeesData = filereader.GetCsvData(filepath);

            DataRow[] rows;
            rows = employeesData.Select(employeeId);
            foreach (DataRow row in rows)
            {
                employeesData.Rows.Remove(row);
            }

            filewriter.CSVFileWriter(employeesData, filepath);
        }