Skip to content

Commit

Permalink
Melhorando tela de Cadastrado
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheusNCarvalho committed Jul 8, 2017
1 parent e3471cb commit 203a309
Show file tree
Hide file tree
Showing 1,474 changed files with 199,539 additions and 44 deletions.
Binary file modified ProjetoFlavio/.vs/ProjetoFlavio/v15/.suo
Binary file not shown.
2 changes: 1 addition & 1 deletion ProjetoFlavio/.vs/config/applicationhost.config
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
</site>
<site name="ProjetoFlavio" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="c:\users\kaido\documents\visual studio 2017\Projects\ProjetoFlavio\ProjetoFlavio" />
<virtualDirectory path="/" physicalPath="C:\Users\kaido\Documents\GitHub\ControleGerencial\ProjetoFlavio\ProjetoFlavio" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:50921:localhost" />
Expand Down
18 changes: 18 additions & 0 deletions ProjetoFlavio/ProjetoFlavio/App_Start/FilterConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ProjetoFlavio.App_Start
{
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}


}
}
25 changes: 22 additions & 3 deletions ProjetoFlavio/ProjetoFlavio/Controllers/ClientesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@

namespace ProjetoFlavio.Controllers
{



[HandleError(View = "../Error")]
public class ClientesController : Controller
{
private readonly ClienteDao _clienteDao = new ClienteDao();
private readonly ClienteEnderecoDao _clienteEnderecoDao = new ClienteEnderecoDao();
// GET: Clientes
public ActionResult Index()
{
Expand All @@ -23,13 +24,31 @@ public ActionResult Index()
[Route("clientes/novo", Name ="NovosClientes")]
public ActionResult Novo()
{

return View();

}

public ActionResult Salvar(Cliente cliente)
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Salvar(ViewModelClienteEndereco viewCadastrado)
{
return RedirectToAction("Index");
try {
//ClientesId = cliente.ClienteId
if (ModelState.IsValid)
{
_clienteDao.Salva(viewCadastrado.Clientes);
viewCadastrado.ClientesEnderecos.ClientesId = viewCadastrado.Clientes.ClienteId;
_clienteEnderecoDao.Salva(viewCadastrado.ClientesEnderecos);
}

return View("Novo", viewCadastrado);
}
catch (Exception ex)
{
return View("Error", new HandleErrorInfo(ex, "Cadastrado", "Salvar"));
}

}

[Route("clientes", Name ="ListarClientes")]
Expand Down
22 changes: 9 additions & 13 deletions ProjetoFlavio/ProjetoFlavio/Controllers/TesteController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public class TesteController : Controller
public ActionResult Index()
{

DataSetImagem ds = new DataSetImagem();
DataSet2 d3 = new DataSet2();
DataSetImagem dataSetImagem = new DataSetImagem();
DataSet2 dataSetDadosClientes = new DataSet2();
var id = 11;


Expand All @@ -28,32 +28,28 @@ public ActionResult Index()

SqlDataAdapter adp = new SqlDataAdapter("SELECT * FROM clientes as c Join clientes_enderecos as ce on c.ClienteId = ce.EnderecoId where ClienteId =" + id+"", conx);
// SqlDataAdapter adp = new SqlDataAdapter("SELECT * FROM imagens ", conx);
adp.Fill(d3, d3.clientes.TableName);
adp.Fill(dataSetDadosClientes, dataSetDadosClientes.clientes.TableName);

adp.Dispose();
//SqlDataAdapter adp3 = new SqlDataAdapter("SELECT * FROM clientes as c Join clientes_enderecos as ce on c.ClienteId = ce.EnderecoId where ClienteId =" + id + "", conx);
SqlDataAdapter adp3 = new SqlDataAdapter("SELECT * FROM imagens ", conx);
adp3.Fill(ds, ds.imagens.TableName);
adp3.Fill(dataSetImagem, dataSetImagem.imagens.TableName);
adp3.Dispose();


var viewer = new Microsoft.Reporting.WebForms.ReportViewer();
viewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
viewer.LocalReport.EnableExternalImages = true;

//var stringParametro = "MatheusFoda";


//
// ReportParameter[] param = new ReportParameter[1];
// param[0] = new ReportParameter("teste", stringParametro);
// viewer.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter("ReportParameter1", "Matheus"));

//viewer.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter("ReportParameter1", "Matheus"));


viewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Reports\Report2.rdlc";
viewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Reports\teste.rdlc";
//viewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DataSet1", ds.Tables[0])); ds.relatorio.Where(m => m.ClienteId == id).FirstOrDefault())
viewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DataSet1", ds.Tables[0]));
viewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DataSetDados", d3.Tables[0]));
viewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DataSet1", dataSetImagem.Tables[0]));
viewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DataSetDados", dataSetDadosClientes.Tables[0]));
//viewer.ReportRefresh();

viewer.SizeToReportContent = true;
Expand Down
2 changes: 1 addition & 1 deletion ProjetoFlavio/ProjetoFlavio/DAO/Cliente.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void Salva(Cliente cliente)
public IList<Cliente> Lista()
{

return contexto.Clientes.ToList();
return contexto.Clientes.Where(m => m.Status == true).ToList();

}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<parameters>
<setParameter name="IIS Web Application Name" value="goodlife" />
<setParameter name="projetoConnectionString-Web.config Connection String" value="Data Source=DRAGON\Sqlexpress;Initial Catalog=goodlife;Integrated Security=True" />
<setParameter name="projetoConnectionString-Deployment Connection String" value="Data Source=DRAGON\Sqlexpress;Initial Catalog=goodlife;Integrated Security=True" />
</parameters>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<sitemanifest>
<DbDacFx path="C:\Users\kaido\Documents\GitHub\ControleGerencial\ProjetoFlavio\ProjetoFlavio\obj\Release\AutoScripts\projetoConnectionString_IncrementalSchemaOnly.dacpac" dacpacAction="Deploy" />
<IisApp path="C:\Users\kaido\Documents\GitHub\ControleGerencial\ProjetoFlavio\ProjetoFlavio\obj\Release\Package\PackageTmp" />
<setAcl path="C:\Users\kaido\Documents\GitHub\ControleGerencial\ProjetoFlavio\ProjetoFlavio\obj\Release\Package\PackageTmp" setAclResourceType="Directory" />
<setAcl path="C:\Users\kaido\Documents\GitHub\ControleGerencial\ProjetoFlavio\ProjetoFlavio\obj\Release\Package\PackageTmp" setAclUser="anonymousAuthenticationUser" setAclResourceType="Directory" />
<setAcl path="C:\Users\kaido\Documents\GitHub\ControleGerencial\ProjetoFlavio\ProjetoFlavio\obj\Release\Package\PackageTmp\App_Data" setAclResourceType="Directory" setAclAccess="Write" />
</sitemanifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

===========================
Prerequisites :
--------------------------
To deploy this Web package, Web Deploy (msdeploy.exe) must be installed on the computer that runs the .cmd file. For information about how to install Web Deploy, see the following URL:
https://go.microsoft.com/?linkid=9278654
This batch file requires that the package file "ProjetoFlavio.zip" and optionally provided the parameters file "ProjetoFlavio.SetParameters.xml" in the same folder or destination folder by environment variable.

===========================
Usage:
--------------------------
ProjetoFlavio.deploy.cmd [/T|/Y] [/M:ComputerName] [/U:UserName] [/P:Password] [/G:UseTempAgent] [Additional msdeploy.exe flags ...]


===========================
Required Flags:
--------------------------
/T:
Calls msdeploy.exe with the "-whatif" flag, which simulates deployment. This does not deploy the package. Instead, it creates a report of what will happen when you actually deploy the package.
/Y:
Calls msdeploy.exe without the "-whatif" flag, which deploys the package to the current machine or a destination server. Use /Y after you have verified the output that was generated by using the /T flag.

Note: Do not use /T and /Y in the same command.

===========================
Optional Flags:
--------------------------
By Default, this script deploy on the current machine where this script is called with current user credential without agent service. Only pass the following value for advance scenario.

/M:<Destination server name or Service URL>
If this flag is not specified, the package is installed on the computer where the command is run. The Service URL can be in the following format:
https://<DestinationServer>:8172/MSDeploy.axd
This format requires that IIS 7 be installed on the destination server and that IIS 7 Web Management Service(WMSvc) and Web Deployment Handler be set up.
The service URL can also be in the following format:
http://<DestinationServer>/MSDeployAgentService
This format requires administrative rights on the destination server, and it requires that Web Deploy Remote Service (MsDepSvc) be installed on the destination server. IIS 7 does not have to be installed on the destination server.

/U:<UserName>
/P:<Password>
/G:<True | False>
Specifies that the package is deployed by creating a temporary listener on the destination server. This requires no special installation on the destination server, but it requires you to be an administrator on that server. The default value of this flag is False.

/A:<Basic | NTLM>
Specifies the type of authentication to be used. The possible values are NTLM and Basic. If the wmsvc provider setting is specified, the default authentication type is Basic; otherwise, the default authentication type is NTLM.

/L
Specifies that the package is deployed to local IISExpress user instance.

[Additional msdeploy.exe flags]
The msdeploy.exe command supports additional flags. You can include any of these additional flags in the "$(ProjectName).Deploy.cmd" file, and the flags are passed through to msdeploy.exe during execution.
Alternatively, you can specify additional flags by setting the "_MsDeployAdditionalFlags" environment variable. These settings are used by this batch file.
Note: Any flag value that includes an equal sign (=) must be enclosed in double quotation marks, as shown in the following example, which will skip deploying the databases that are included in the package:
"-skip:objectName=dbFullSql"

===========================
Environment-Specific Settings:
--------------------------

To customize application-specific settings for each deployment environment (for example, the IIS application name, the physical path, and any connection strings), edit the settings in the following file:
"ProjetoFlavio.SetParameters.xml"
===========================
For more information on this deploy script visit: https://go.microsoft.com/fwlink/?LinkID=183544

Loading

0 comments on commit 203a309

Please sign in to comment.