% For i=1 to Request.Form.Count Session(Request.Form.Key(i))=Request.Form.Item(i) Next For i=1 to Request.Form.Count if Request.Form.Item(i)="" then Response.Redirect "contrato.asp?idpro="&Request.Form("IDPROPOSTA")&"&err=3parcelas" End if Next if Request.Form("GARANTIAS")="Cheques" then For i=1 to cInt(Request.Form("NUMPARCELAS")) if i=1 then valorparcela=Request.Form("VALORPARCELA_PRIMEIRA") else valorparcela=Request.Form("VALORPARCELA") End if q="INSERT INTO T_PARCELA (IDPROPOSTA,NUMPARCELAS,VENCIMENTO,VALOR,BANCO,AGENCIA,CONTA,NUMCHEQUE)VALUES("&Request.Form("IDPROPOSTA")&","&Request.Form("NUMPARCELAS")&",#"&Request.Form("DATA"&i)&"#,"&Replace(Replace(valorparcela,".",""),",",".")&",'"&Request.Form("BANCO"&i)&"','"&Request.Form("AGENCIA"&i)&"','"&Request.Form("CONTA"&i)&"','"&Request.Form("NUMCHEQUE"&i)&"')" Conexao.Execute(q) Next else For i=1 to cInt(Request.Form("NUMPARCELAS")) if i=1 then valorparcela=Request.Form("VALORPARCELA_PRIMEIRA") else valorparcela=Request.Form("VALORPARCELA") End if q="INSERT INTO T_PARCELA (IDPROPOSTA,NUMPARCELAS,VENCIMENTO,VALOR,NUMCHEQUE)VALUES("&Request.Form("IDPROPOSTA")&","&Request.Form("NUMPARCELAS")&",#"&Request.Form("DATA"&i)&"#,"&Replace(Replace(valorparcela,".",""),",",".")&",'"&Request.Form("NUMCHEQUE"&i)&"')" Conexao.Execute(q) Next End if qup="UPDATE T_PROPOSTA SET PARC_PREENCHIDA=true, DTVENCIMENTO=#"&Request.Form("DTVENCIMENTO")&"# WHERE IDPROPOSTA="&Request.Form("IDPROPOSTA") Conexao.Execute(qup) 'ENVIANDO E-MAIL *** INICIO *** qsel="SELECT *,T_VENDEDOR.NOME AS NOMEVENDEDOR, T_REPRESENTANTE.NOME AS NOMEREPRESENTANTE FROM T_PROPOSTA,T_VENDEDOR, T_REPRESENTANTE WHERE T_PROPOSTA.IDVENDEDOR=T_VENDEDOR.IDVENDEDOR AND T_PROPOSTA.IDREPRESENTANTE=T_REPRESENTANTE.IDREPRESENTANTE AND IDPROPOSTA="&Request.Form("IDPROPOSTA") RSsel=Conexao.Execute(qsel) Dim objMailer 'Mailer control Set objMailer = Server.CreateObject("Dundas.Mailer") titulo_email="CONTRATO PREENCHIDO (nº do sistema: "&Request.Form("IDPROPOSTA")&")" descricao_email="O contrato de nº de sistema "&Request.Form("IDPROPOSTA")&" ("&RSsel("NOMEVENDEDOR")&"/"&RSsel("NOMEREPRESENTANTE")&") está preenchido." objMailer.TOs.Add to_email objMailer.FromAddress = from_email objMailer.Priority = 1 objMailer.Subject = ".:CREDILON:. - CONTRATO PREENCHIDO - Nº DO SISTEMA"&Request.Form("IDPROPOSTA") objMailer.SMTPRelayServers.Add smtp_server objMailer.HTMLBody = "
.: CREDILON:. | ||||
|