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 btnIzmjena_Click(object sender, EventArgs e) { using (PoslovniKlubBL temp = new PoslovniKlubBL()) { string jmbg = Request.QueryString["JMBG"]; korisnici user = new korisnici(); user = temp.GetKorisnik(jmbg); string prezime = user.Prezime; string ime = user.Ime; string adresa = user.Adresa; int mjesto = user.gradID.Value; string tel = user.Telefon; string tel2 = user.Telefon2; string mob = user.Mobitel; string email = user.email; string kom = user.KomunikPutem; string sporBr = user.SporazumBroj; //string fili = user.filijala; nema polje filijala u bazi. treba dodati Response.Redirect("../Public/Registracija.aspx?" + "&JMBG=" + Server.UrlEncode(jmbg) + "&Prezime=" + Server.UrlEncode(prezime) + "&Ime=" + Server.UrlEncode(ime) + "&Adresa=" + Server.UrlEncode(adresa) + "&Opstina=" + mjesto + "&Telefon=" + Server.UrlEncode(tel) + "&Telefon2=" + Server.UrlEncode(tel2) + "&Mobitel=" + Server.UrlEncode(mob) + "&Email=" + Server.UrlEncode(email) + "&Komunikacija=" + Server.UrlEncode(kom) + "&Sporazum=" + Server.UrlEncode(sporBr)); } }
public void UpdateUser(korisnici temp) { object original = null; if (context.TryGetObjectByKey(temp.EntityKey, out original)) { context.ApplyCurrentValues(temp.EntityKey.EntitySetName, temp); } else { context.korisnici.AddObject(temp); } context.SaveChanges(); }
public korisnici getKorBySp(string spor) { korisnici temp = new korisnici(); var kor = (from p in getAllKor() where p.SporazumBroj == spor select p); return kor.ToList().SingleOrDefault(); }
public string getRBIndex(string jmb) { korisnici temp = new korisnici(); temp = context.korisnici.Where(x => x.JMBG == jmb).SingleOrDefault(); if (temp.KomunikPutem == "Email") return "Email"; else if (temp.KomunikPutem == "Pošta") return "Pošta"; else if (temp.KomunikPutem == "Email i pošta") return "Email i pošta"; else return "Ne prima oglasnik"; }
public void SaveUser(string SpBroj, string jmbg, string prezime, string ime, string adresa, int grad, int mz, string telefon, string telefon2, string mobitel, string email, int fil, string kom) { korisnici temp = new korisnici(); temp.SporazumBroj = SpBroj; temp.JMBG = jmbg; temp.Prezime = prezime; temp.Ime = ime; temp.Adresa = adresa; temp.gradID = grad; temp.mzCode = getmzCode(mz); temp.Telefon = telefon; temp.Telefon2 = telefon2; temp.Mobitel = mobitel; temp.email = email; temp.FilID = fil; temp.KomunikPutem = kom; temp.Dodan = DateTime.Now; context.korisnici.AddObject(temp); context.SaveChanges(); }
public int GetKorisnikID(string JMBG) { korisnici temp = new korisnici(); temp = context.korisnici.Where(x => x.JMBG == JMBG).SingleOrDefault(); return temp.KorisnikID; }
public string GetMZId(string jmbg) { korisnici temp = new korisnici(); temp = context.korisnici.Where(x => x.JMBG == jmbg).SingleOrDefault(); return temp.mzCode; }
public int GetUserBySpBr(string spor) // Ovu funkciju treba doraditi jer nešto ne radi kako treba !!!!!!!! { korisnici temp = new korisnici(); temp = context.korisnici.Where(x => x.SporazumBroj == spor).SingleOrDefault(); return temp.KorisnikID; }
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; } }
/// <summary> /// Deprecated Method for adding a new object to the korisnici EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTokorisnici(korisnici korisnici) { base.AddObject("korisnici", korisnici); }
/// <summary> /// Create a new korisnici object. /// </summary> /// <param name="korisnikID">Initial value of the KorisnikID property.</param> /// <param name="sporazumBroj">Initial value of the SporazumBroj property.</param> /// <param name="jMBG">Initial value of the JMBG property.</param> public static korisnici Createkorisnici(global::System.Int32 korisnikID, global::System.String sporazumBroj, global::System.String jMBG) { korisnici korisnici = new korisnici(); korisnici.KorisnikID = korisnikID; korisnici.SporazumBroj = sporazumBroj; korisnici.JMBG = jMBG; return korisnici; }
// Ovu funkciju treba doraditi jer nešto ne radi kako treba !!!!!!!! public int GetUserBySpBr(string spor) { korisnici temp = new korisnici(); temp = context.korisnici.Where(x => x.SporazumBroj == spor).SingleOrDefault(); return temp.KorisnikID; }