protected void btnProcess_Click(object sender, EventArgs e) { // Response.Redirect("MenuBackend.aspx"); string data = txtCodeView.Text + '|' + ddlPersons.SelectedItem.ToString() + '|' + ddlDiscount.SelectedValue + '|' + txtUsability.Text + '|' + ddlPromotion.SelectedValue; brCode = new BrCode(); string req = brCode.RegisterCode(data); if (!string.IsNullOrEmpty(req)) { SmtpClient server = new SmtpClient("cieneguillariberadelrio.com", 587); // Crea el mensaje estableciendo quién lo manda y quién lo recibe //Envía el mensaje. server.Credentials = new System.Net.NetworkCredential("*****@*****.**", "Sistemas1"); server.EnableSsl = true; //Añade credenciales si el servidor lo requiere. MailMessage mnsj = new MailMessage(); mnsj.Subject = "[InResorts_CODE]"; mnsj.IsBodyHtml = true; mnsj.To.Add(new MailAddress(txtCorreo.Text)); mnsj.From = new MailAddress("*****@*****.**", "Kevin Nava"); /* Si deseamos Adjuntar algún archivo*/ mnsj.Body = "Tu Codigo es:" + txtCodeView.Text; server.Send(mnsj); txtCodeView.Text = ""; txtCorreo.Text = ""; txtDni.Text = ""; txtUsability.Text = ""; } else { //alert negativo } }
protected void Page_Load(object sender, EventArgs e) { string option = Request["option"]; if (!string.IsNullOrEmpty(option)) { if (option == "codSecreto") { string valueCod = Request["valueCod"]; if (!string.IsNullOrEmpty(valueCod)) { BrCode brCode = new BrCode(); string responseCode = brCode.GetCodeSecreto(valueCod); if (string.Compare(valueCod, responseCode, false) == 0) { Response.Write("true"); } else { Response.Write("false"); } } else { Response.Write("false"); } } } }
protected void CodeGenerator_Click(object sender, EventArgs e) { // Response.Redirect("MenuBackend.aspx"); brCode = new BrCode(); string code = brCode.sha256_hash(txtDni.Text + DateTime.Now.ToString("h:mm:ss tt")); txtCodeView.Text = code; }
protected void Page_Load(object sender, EventArgs e) { BrCode bcode = new BrCode(); string code = Request["code"].ToString().Trim(); if (string.IsNullOrEmpty(code)) { Response.Write("false¬false"); return; } string anwser = bcode.GetCodeExist(code); if (anwser == "error") { Response.Write("false¬false"); return; } Session["codeDiscount"] = anwser; Response.Write("true¬" + anwser); return; }