Example #1
0
        public ActionResult Index()
        {
            //MailSender.OutRequestAprovalEmail("0001", "Bodega1","AuxiliarUca","Solicitante","Supervisor","*****@*****.**", "*****@*****.**", "*****@*****.**","www.google.com",OutRequestStatus.Approved,TypeOutRequest.Asset,true);
            //_erpConnection.ConnectErp("consulta","CLIMA1");
            //_erpConnection.GetErpUsers();
            //var fullUrl = this.Url.Action("Index", "Home", new { id = 5 }, this.Request.Url.Scheme);
            //string action = this.Url.Action("Index", "Home", new { id = 5 });

            _erpConnection.ConnectErp(_user, _password, "");
            IList <Project> listProjects = _erpConnection.GetErpProyects(_currentUser.CompanyName, _currentUser.CurrentUserId);
            IList <Asset>   listAsssets  = _erpConnection.GetErpAssets(_currentUser.CompanyName, _currentUser.CurrentUserId);
            IList <ResponsiblePerson.ResponsiblePerson> listResponsiblePersons =
                _erpConnection.GetResposiblesPersons(_currentUser.CompanyName, _currentUser.CurrentUserId);

            _erpConnection.InsertAssetsDb(listAsssets, _currentUser.CurrentUserId, _currentUser.CompanyName);

            _erpConnection.InsertProjectsDb(listProjects);

            _erpConnection.InsertResponsiblesDb(listResponsiblePersons);

            _erpConnection.DisconnectErp();

            return(View());
        }