public ActionResult Index()
        {
            ReportStockInputDto model = new ReportStockInputDto();

            try
            {
                model.Query       = "";
                model.CompanyName = _currentUser.CompanyName;
                _erpConnectionService.ConnectErp(_user, _password, "");
                model.StocksList = _erpConnectionService.GetAllStocksByCompanyReport(model.CompanyName);
                _erpConnectionService.DisconnectErp();
                //model.Stocks = _reportStocksAppService.SearchStocks(model);

                model.Cellars          = _reportStocksAppService.GetAllCellars(_currentUser.CompanyName);
                model.UserName         = _currentUser.UserName;
                model.CurrentDateTime  = _date.Now;
                model.Control          = "ReportStocks";
                model.Action           = "Search";
                model.ErrorCode        = ErrorCodeHelper.Ok;
                model.ErrorDescription = "";
            }
            catch (Exception e)
            {
                model.ErrorCode        = ErrorCodeHelper.Error;
                model.ErrorDescription = "Error al buscar las Existencias";
            }
            return(View(model));
        }
Exemple #2
0
        // GET: Account
        public ActionResult Index()
        {
            if (HttpContext.User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Index", "OutRequests"));
            }
            AccountViewModel model = new AccountViewModel();

            _erpConnection.ConnectErp(_user, _password, "");
            model.Companies = _erpConnection.GetErpCompanies();
            _erpConnection.DisconnectErp();

            model.ErrorCode        = 0;
            model.ErrorDescription = "";
            return(View(model));
        }
 public ActionResult ChangeProcessedStatus(Guid adjustmentId)
 {
     try
     {
         _erpConnectionService.ConnectErp(_user, _password, "");
         var list = _erpConnectionService.GetAllStocksByCompany(_currentUser.CompanyName);
         _erpConnectionService.DisconnectErp();
         _adjustmentsService.ChangeProcessedStatus(adjustmentId, _currentUser.CurrentUserId, _currentUser.CompanyName, list);
         return(Json(new { ErrorCode = 0, ErrorDescription = "Ajuste aplicado correctamente." }));
     }
     catch (Exception e)
     {
         return(Json(new { ErrorCode = -1, ErrorDescription = "Error al cambiar el estado" }));
     }
 }
Exemple #4
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());
        }
        public ActionResult ChangeProcessedStatus(Guid inRequestId)
        {
            var entrada = _inRequestService.GetDetail(inRequestId);

            if (entrada.Status != InRequestStatus.Processed)
            {
                try
                {
                    _erpConnectionService.ConnectErp(_user, _password, "");
                    var list = _erpConnectionService.GetAllStocksByCompany(_currentUser.CompanyName);
                    _erpConnectionService.DisconnectErp();
                    _inRequestService.ChangeProcessedStatus(inRequestId, _currentUser.CurrentUserId, _currentUser.CompanyName, list);
                    return(Json(new { ErrorCode = 0, ErrorDescription = "Entrada aplicada correctamente." }));
                }
                catch (Exception e)
                {
                    return(Json(new { ErrorCode = -1, ErrorDescription = "Error al cambiar el estado" }));
                }
            }
            else
            {
                return(Json(new { ErrorCode = -1, ErrorDescription = "Favor Refrescar la pagina, su entrada ya fue procesada" }));
            }
        }