Ejemplo n.º 1
0
        public ActionResult Export <TEntity>(string selectedIds, string storeName, ConfigExport config) where TEntity : class
        {
            selectedIds = Common.DotNetToOracle(selectedIds);
            var service    = new BaseService();
            var status     = string.Empty;
            var listEntity = service.GetData <TEntity>(selectedIds, storeName, UserLogin, ref status);

            if (listEntity != null && listEntity.Any())
            {
                config.DataSource = listEntity;
                if (string.IsNullOrEmpty(config.VariableName))
                {
                    var str = listEntity[0].GetType().Name;
                    str = str.Substring(0, str.Length - 6) + "Model";
                    config.VariableName = str;
                }
                status = ExportService.ExportByGenCode(config);
            }

            return(Json(status));
        }