protected void Page_Load(object sender, EventArgs e) { using (PoslovniKlubBL temp = new PoslovniKlubBL()) { string jmbg = Request.QueryString["JMBG"]; korisnici user = new korisnici(); user = temp.GetKorisnik(jmbg); int id = user.gradID.Value; string mjesto = temp.GetGradByID(id); string adresa=user.Adresa + ", " + mjesto; string telefoni = user.Telefon + "; " + user.Telefon2 + "; " + user.Mobitel; txtKorisnik.Text = user.Prezime + " " + user.Ime + "; " + user.JMBG + "; " + adresa + "; " + telefoni + "; " + user.email + "; " + user.KomunikPutem; } }
protected void btnEmailKS_Click(object sender, EventArgs e) { using (PoslovniKlubBL temp = new PoslovniKlubBL()) { string grad = temp.GetGradByID(ddlOpstina.SelectedIndex+1); int filijala = temp.getFilijalaByKS(Request.QueryString["emailKS"]); string bm = temp.getBM(filijala); //if (filijala == "1300") // bm = "*****@*****.**"; //else if (filijala == "1500") // bm = "*****@*****.**"; //else if (filijala == "1800") // bm = "*****@*****.**"; //else // ClientScript.RegisterStartupScript(this.GetType(), "Greška!", "alert('Nešto nije u redu!');", true); string poruka = "Poštovani/Poštovana,<br/><br/>" + "Na sporazumu " + txtSporazum.Text + " su upisani sledeći podaci:<br/>" + "JMBG: " + txtJMBG.Text + ";<br/>Adresa: " + txtAdresa.Text + ";<br/>Opština: " + grad + ";<br/>Telefon: " + txtTelefon.Text + ";<br/>Telefon2: " + txtTelefon2.Text + ";<br/>Mobitel: " + txtMobitel.Text + "<br/><br/>Molim Vas da izvršite izmjenu u registru lica."; //MessageBox.Show(poruka); MailMessage msg = new MailMessage(); System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient(); try { msg.Subject = "Izmijenjeni podaci klijenta " + txtPrezime.Text + " " + txtIme.Text; msg.Body = poruka; // "Add Email Body Part"; msg.From = new MailAddress("*****@*****.**"); msg.To.Add(Request.QueryString["EmailKS"]); msg.CC.Add(bm); msg.IsBodyHtml = true; client.Host = "smtp-relay.gmail.com"; //System.Net.NetworkCredential basicauthenticationinfo = new System.Net.NetworkCredential("*****@*****.**",""); client.Port = int.Parse("587"); client.EnableSsl = true; client.UseDefaultCredentials = false; //client.Credentials = basicauthenticationinfo; client.DeliveryMethod = SmtpDeliveryMethod.Network; client.Send(msg); } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "Greška!", "alert('Email nije otišao KS!' + ex.ToString());", true); //System.Windows.Forms.MessageBox.Show("Exception caught in CreateCopyMessage(): " + ex.ToString()); } } }
protected void Page_Load(object sender, EventArgs e) { using (PoslovniKlubBL temp = new PoslovniKlubBL()) { //MessageBox.Show(Request.QueryString["SporazumBroj"]); string SpBr = Request.QueryString["SporazumBroj"]; //int userid = temp.getKorBySp(SpBr); korisnici user = new korisnici(); user = temp.getKorBySp(SpBr); //user = temp.GetUser(userid); txtSporazum.Text = Request.QueryString["SporazumBroj"]; txtJMBG.Text = user.JMBG; txtPrezime.Text = user.Prezime; txtIme.Text = user.Ime; txtAdresa.Text = user.Adresa; int id = Convert.ToInt32(user.gradID); txtOpština.Text = temp.GetGradByID(id); txtMZ.Text = temp.GetMZByCode(user.mzCode); txtTelefon.Text = user.Telefon; txtTelefon2.Text = user.Telefon2; txtMobitel.Text = user.Mobitel; int fid = Convert.ToInt32(user.FilID); if(fid == 0) { txtFilijala.Text = ""; } else { txtFilijala.Text = temp.GetFilijalaByID(fid); } txtEmail.Text = user.email; txtKomunikacija.Text = user.KomunikPutem; } }