public IActionResult GeneralError(string Signal, string ErrorTitle, string ErrorMessage, string UrlToRedirect, string optionalData, string StringButton) { GeneralErrorViewModel model = new GeneralErrorViewModel(); model.Signal = Signal; model.ErrorTitle = ErrorTitle; model.ErrorMessage = ErrorMessage; model.UrlToRedirect = UrlToRedirect; model.optionalData = optionalData; model.StringButton = StringButton; return(this.PartialView("~/Views/Error/GeneralErrorModel.cshtml", model)); }
public IActionResult Index(string _EmpSage, string _Ano) { //PlanoContasViewModelPath planoContasView int idGabContab = SessionHelper.GetObjectFromJson <int>(HttpContext.Session, "sessionIDGabContab"); int idEmpresaContab = SessionHelper.GetObjectFromJson <int>(HttpContext.Session, "sessionIDEmpresaContab"); string AnoEmpresaContab = SessionHelper.GetObjectFromJson <string>(HttpContext.Session, "sessionIDAnoEmpresaContab"); if (idGabContab == 0) { logger.LogError($"Gabinete de contabilidade não foi selecionado!"); ViewBag.Signal = "notok"; ViewBag.ErrorTitle = "Gabinete de Contabilidade !"; ViewBag.ErrorMessage = "Um gabinete de contabilidade não foi selecionado!" + " Selecione uma empresa de contabilidade para prosseguir com a operação!"; return(this.PartialView("~/Views/Error/GeneralError.cshtml")); } if (idEmpresaContab == 0) { logger.LogError($"Empresa não foi selecionada!"); ViewBag.Signal = "notok"; ViewBag.ErrorTitle = "Empresa não foi selecionada !"; ViewBag.ErrorMessage = "A Empresa não foi selecionada!" + " Selecione uma empresa para prosseguir com a operação!"; return(this.PartialView("~/Views/Error/GeneralError.cshtml")); } if (AnoEmpresaContab == "" || AnoEmpresaContab == null) { logger.LogError($"Ano fiscal não foi selecionado!"); ViewBag.Signal = "notok"; ViewBag.ErrorTitle = "Ano fiscal não foi selecionado!"; ViewBag.ErrorMessage = "Ano fiscal não foi selecionado!" + " Selecione ano fiscal da empresa para prosseguir com a operação!"; return(this.PartialView("~/Views/Error/GeneralError.cshtml")); } List <ConConfigViewModel> conConfigViewModel = conConfig.FindByEmpresaId(idEmpresaContab).ToList(); if (conConfigViewModel.Count == 0) { GeneralErrorViewModel generalErrorViewModel = new GeneralErrorViewModel { Signal = "notok", ErrorTitle = "Conexão nao configurada!", ErrorMessage = "A empresa não tem uma conexão configurada!", StringButton = "Configurar conexão", UrlToRedirect = "/ConConfig/IndexJson/", optionalData = idEmpresaContab.ToString() }; return(this.PartialView("~/Views/Error/GeneralErrorModel.cshtml", generalErrorViewModel)); //ViewBag.Signal = "notok"; //ViewBag.ErrorTitle = "Conexão nao configurada!"; //ViewBag.ErrorMessage = "A empresa não tem uma conexão configurada!"; //return this.PartialView("~/Views/Error/GeneralError.cshtml"); } DadosEmpresaImportada empViewModel = dadosEmpresaViewModel.ReturnModelByEmpresaAno(idEmpresaContab, Int16.Parse(AnoEmpresaContab)); string _servidorSQL = conConfigViewModel[0].NomeServidor; string _instanciaSQL = conConfigViewModel[0].InstanciaSQL; string _path = ""; /* * AGesLocEn _AGesLocEn = empresaAGes.GetAGesLocEn(); * string _path = _AGesLocEn.GesSharedDir + _servidorSQL + "\\" + _instanciaSQL; * */ if (_path == "" || _path == null) { _path = "C:\\Sage Data\\Sage Accountants\\"; } _path += (_path.EndsWith("\\") ? "" : "\\") + empViewModel.CodeEmpresa + _Ano + empViewModel.CodeAplicacao + "\\Sync\\toCLAB"; if (!Directory.Exists(_path)) { Directory.CreateDirectory(_path); } PathViewModel model = new PathViewModel { Path = _path, EmpresaID = idEmpresaContab, Ano = Int16.Parse(AnoEmpresaContab) }; return(this.PartialView("~/Views/ExportDocs/Index.cshtml", model)); }