Пример #1
0
        static EmployeeEntityService()
        {
            SAPSystemConnectMy sapCfg = new SAPSystemConnectMy();

            RfcDestinationManager.RegisterDestinationConfiguration(sapCfg);
            rfcDest = RfcDestinationManager.GetDestination("K47");
        }
Пример #2
0
        public static IEnumerable <EmployeeEntity> ReadList()
        {
            List <EmployeeEntity> ret = new List <EmployeeEntity>();
            // get all Basic employee information from SAP
            SAPSystemConnectMy sapCfg = new SAPSystemConnectMy();

            RfcDestinationManager.RegisterDestinationConfiguration(sapCfg);
            RfcDestination rfcDest = RfcDestinationManager.GetDestination("K47");


            List <Employee> emps = Employee.getAllEmployees(rfcDest);

            foreach (Employee emp in emps)
            {
                ret.Add(new EmployeeEntity(emp));
            }
            return(ret);
        }
Пример #3
0
        public static EmployeeEntity ReadItem(string id)
        {
            EmployeeEntity ret = null;
            // get all Basic employee information from SAP
            SAPSystemConnectMy sapCfg = new SAPSystemConnectMy();

            RfcDestinationManager.RegisterDestinationConfiguration(sapCfg);
            RfcDestination rfcDest = RfcDestinationManager.GetDestination("K47");


            List <Employee> emps = Employee.getAllEmployees(rfcDest);

            foreach (Employee emp in emps)
            {
                if (emp.PeronalNr.Equals(id))
                {
                    ret = new EmployeeEntity(emp);
                }
            }
            return(ret);
        }
Пример #4
0
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("Start");

                SQLHelper.deleteTables();

                SAPSystemConnectMy sapCfg = new SAPSystemConnectMy();

                RfcDestinationManager.RegisterDestinationConfiguration(sapCfg);
                RfcDestination rfcDest = RfcDestinationManager.GetDestination("K47");

                // fill and save controlling areas
                List <ControllingArea> controllingAreas = ControllingArea.getAllControllingAreas(rfcDest);
                SQLHelper.saveControllingAreas(controllingAreas);

                // fill and save CostCenters
                List <CostCenter> costCSum = new List <CostCenter>();
                foreach (ControllingArea area in controllingAreas)
                {
                    List <CostCenter> css = CostCenter.getAllCostCenters(rfcDest, area);
                    foreach (CostCenter cs in css)
                    {
                        cs.fillDetailInformation(rfcDest);
                    }

                    SQLHelper.saveCostCenrters(css);
                    //costCSum.AddRange(css);
                }


                // fill activity types
                List <ActivityType> acttcpyesSum = new List <ActivityType>();
                foreach (ControllingArea area in controllingAreas)
                {
                    List <ActivityType> acttcpyes = ActivityType.getAllActivityTypes(rfcDest, area);
                    SQLHelper.saveActivityTypes(acttcpyes);
                    //acttcpyesSum.AddRange(acttcpyes);
                }

                // fill activities
                foreach (ControllingArea area in controllingAreas)
                {
                    for (int year = 1990; year < 2010; year++)
                    {
                        List <Activity> actt = Activity.getAllActivies(rfcDest, area, year);
                        SQLHelper.saveActivies(actt);
                    }
                }



                //ControllingArea ca = new ControllingArea() { ControllingAreaCode = "1000", ControllingAreaName = "" };

                //List<ActivityType> acttcpyes = ActivityType.getAllActivityTypes(rfcDest, ca);

                //List<Activity> acts = Activity.getAllActivies(rfcDest, ca, 1999);

                int i = 0;
                i++;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                Console.ReadLine();
            }

            Console.WriteLine("End of import");
            Console.ReadLine();
        }