private void ozellikleriGetir_Click(object sender, EventArgs e) { telefonmodeli = comboBoxTel.Text; Telefon telefon = fabrika.TelefonOlustur(telefonmodeli); listBoxTel.Items.Add(telefon.BilgiGoster()); }
public PartialViewResult PhoneEkle(PhoneModel phoneModels) { Telefon Tel = KY.TelEkle(phoneModels.Phone, phoneModels.KisiId); ViewBag.TelID = Tel.Id; return(PartialView("_TelefonEklePartial", Tel)); }
public List <Telefon> GetPersonTelefon(ref Person person) { var sqlcmd = @"SELECT TOP * FROM [Telefon] WHERE ([Person] = @PID)"; using (var cmd = new SqlCommand(sqlcmd, OpenConnection)) { cmd.Parameters.AddWithValue("@PID", person.PersonID); SqlDataReader rdr = null; rdr = cmd.ExecuteReader(); var listTlf = new List <Telefon>(); while (rdr.Read()) { var tlf = new Telefon { TelefonID = (int)rdr["TlfID"], Number = (long)rdr["TlfNumber"], TelefonType = (string)rdr["TlfType"], TelefonProvider = (Provider)rdr["TlfProvider"] }; listTlf.Add(tlf); } return(listTlf); } }
public static Telefon getTelefon(string model, string batarya, int en, int boy) { Telefon telefon = null; if (model == "S7") { telefon = new S7(model, batarya, en, boy); System.Console.WriteLine("Model: " + model); System.Console.WriteLine("Barty: " + batarya); System.Console.WriteLine("En : " + en); System.Console.WriteLine("Boy : " + boy); System.Console.WriteLine("================="); } else if (model == "Note3") { telefon = new Note3(model, batarya, en, boy); System.Console.WriteLine("Model: " + model); System.Console.WriteLine("Barty: " + batarya); System.Console.WriteLine("En : " + en); System.Console.WriteLine("Boy : " + boy); } else { System.Console.WriteLine("Olmadı hacı abi bu iş olmaz... "); } return(telefon); }
// To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync(string[] selectedCategories) { var newTelefon = new Telefon(); if (selectedCategories != null) { newTelefon.TelefonCategories = new List <TelefonCategory>(); foreach (var cat in selectedCategories) { var catToAdd = new TelefonCategory { CategoryID = int.Parse(cat) }; newTelefon.TelefonCategories.Add(catToAdd); } } if (await TryUpdateModelAsync <Telefon>( newTelefon, "Telefon", i => i.Model, i => i.ProducatorID, i => i.Memorie, i => i.Pret)) { _context.Telefon.Add(newTelefon); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); } PopulateAssignedCategoryData(_context, newTelefon); return(Page()); }
//public void InsertNewPerson(Person person) //{ // try // { // _conn.Open(); // string insertString = @"INSERT INTO Person(Fornavn, Mellemnavn, Efternavn, PersonType, AdresseID) // OUTPUT INSERTED.PersonID // VALUES (@Data1, @Data2, @Data3, @Data4, @Data5)"; // using (SqlCommand cmd = new SqlCommand(insertString, _conn)) // { // cmd.Parameters.Add(cmd.CreateParameter()).ParameterName = "@Data1"; // cmd.Parameters.Add(cmd.CreateParameter()).ParameterName = "@Data2"; // cmd.Parameters.Add(cmd.CreateParameter()).ParameterName = "@Data3"; // cmd.Parameters.Add(cmd.CreateParameter()).ParameterName = "@Data4"; // cmd.Parameters["@Data1"].Value = person.Fornavn; // cmd.Parameters["@Data2"].Value = person.Mellemnavn; // cmd.Parameters["@Data3"].Value = person.Efternavn; // cmd.Parameters["@Data4"].Value = person.PersonType; // cmd.Parameters["@Data5"].Value = 1; // person.PersonId = (long)cmd.ExecuteScalar(); // _locPerson = person; // } // } // finally // { // if (_conn != null) // { // _conn.Close(); // } // } //} public void InsertNewTelefon(Telefon telefon) { try { _conn.Open(); string insertString = @"INSERT INTO Telefon(Telefonnummer, TelefonType, PersonID) OUTPUT INSERTED.TelefonID VALUES (@Data1, @Data2, @Data3)"; using (SqlCommand cmd = new SqlCommand(insertString, _conn)) { cmd.Parameters.Add(cmd.CreateParameter()).ParameterName = "@Data1"; cmd.Parameters.Add(cmd.CreateParameter()).ParameterName = "@Data2"; cmd.Parameters.Add(cmd.CreateParameter()).ParameterName = "@Data3"; cmd.Parameters["@Data1"].Value = telefon.Telefonnummer; cmd.Parameters["@Data2"].Value = telefon.TelefonType; cmd.Parameters["@Data3"].Value = telefon.Person.PersonId; telefon.TelefonId = (long)cmd.ExecuteScalar(); _locPerson.Telefon.Add(telefon); } } finally { if (_conn != null) { _conn.Close(); } } }
public void UpdateTelefon(Telefon telefon) { try { _conn.Open(); string updateString = @"UPDATE Telefon SET Telefonnummer = @Telefonnummer, TelefonType = @TelefonType, PersonID = @PersonID WHERE TelefonID = @TelefonID"; using (SqlCommand cmd = new SqlCommand(updateString, _conn)) { cmd.Parameters.AddWithValue("@Telefonnummer", telefon.Telefonnummer); cmd.Parameters.AddWithValue("@TelefonType", telefon.TelefonType); cmd.Parameters.AddWithValue("@PersonID", telefon.Person.PersonId); cmd.Parameters.AddWithValue("@TelefonID", telefon.TelefonId); cmd.ExecuteNonQuery(); } } finally { if (_conn != null) { _conn.Close(); } } }
public Provider GetTelefonProvider(ref Telefon tlfProvider) { var sqlcmd = @"SELECT TOP * FROM [Provider] WHERE ([Telefon] = @TlfId)"; using (var cmd = new SqlCommand(sqlcmd, OpenConnection)) { cmd.Parameters.AddWithValue("@tlfId", tlfProvider.TelefonID); SqlDataReader rdr = null; rdr = cmd.ExecuteReader(); var teleProvider = new Provider(); while (rdr.Read()) { var providerInfo = new Provider { ProviderID = (int)rdr["ProviderId"], ProviderName = (string)rdr["ProviderName"] }; teleProvider = providerInfo; } return(teleProvider); } }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (this.GetType() != obj.GetType()) { return(false); } if (ReferenceEquals(this, obj)) { return(true); } if (this.GetHashCode() != obj.GetHashCode()) { return(false); } Persoana persoana = obj as Persoana; return(Nume.Equals(persoana.Nume) && Prenume.Equals(persoana.Prenume) && Email.Equals(persoana.Email) && Cetatenie.Equals(persoana.Cetatenie) && DataNastere.Equals(persoana.DataNastere) && NumarPasaport.Equals(persoana.NumarPasaport) && Telefon.Equals(persoana.Telefon) && CNP.Equals(persoana.CNP) && Sex.Equals(persoana.Sex)); }
public IHttpActionResult PutTelefon(long id, Telefon telefon) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != telefon.TelefonID) { return(BadRequest()); } db.Entry(telefon).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!TelefonExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public void InsertTelefonTilPerson(Telefon telefon) { try { _conn.Open(); string insertString = @"INSERT INTO Telefon(Telefonnummer, TelefonType, PersonID) OUTPUT INSERTED.TelefonID VALUES (@Telefonnummer, @TelefonType, @PersonID)"; using (SqlCommand cmd = new SqlCommand(insertString, _conn)) { cmd.Parameters.AddWithValue("@Telefonnummer", telefon.Telefonnummer); cmd.Parameters.AddWithValue("@TelefonType", telefon.TelefonType); cmd.Parameters.AddWithValue("@PersonID", telefon.Person.PersonId); telefon.TelefonId = (long)cmd.ExecuteScalar(); telefon.Person.Telefon.Add(telefon); } } finally { if (_conn != null) { _conn.Close(); } } }
public Telefon Telgetir(int id) { Telefonbll telbll = new Telefonbll(); Telefon t = telbll.TelefonGetir(id); return(t); }
private void button1_Click(object sender, EventArgs e) { if (update == true) { //UPDATE kisiler SET Ad=@ad,Soyad=@soyad,Yas=@yas,Tarih=@tarih,Onay=@onay WHERE ID=@id var t = new Telefon(); t.ID = int.Parse(ID); t.Isim = txtIsim.Text; t.Meslek = txtMeslegi.Text; t.EvTelefonu = txtEvTelefonu.Text; t.CepTelefonu = txtCepTelefonu.Text; Telefon.Update(t); MessageBox.Show("Başarılı"); ttbool = true; this.Close(); } else { Telefon t = new Telefon(); t.Isim = txtIsim.Text; t.CepTelefonu = txtCepTelefonu.Text; t.EvTelefonu = txtEvTelefonu.Text; t.Meslek = txtMeslegi.Text; Telefon.Insert(t); Form1.Rehber = Telefon.Select(); ttbool = true; this.Close(); } }
static void Main() { KartotekDataUtil personkartotek = new KartotekDataUtil(); Console.WriteLine("PRE DATABASE INDHOLD"); personkartotek.PrintAllPerson(); personkartotek.PrintAllPAdresser(); personkartotek.PrintAllTelefon(); Console.WriteLine(); Adresse n1Adresse = new Adresse() { Vejnavn = "Strandvejen", Husnummer = "30B", Postnummer = "8000", Bynavn = "Aarhus C" }; Person n1Person = new Person() { Fornavn = "Jeppe", Mellemnavn = "", Efternavn = "Stærk", PersonType = "Chef", FolkeregisterAdresse = n1Adresse, AlternativAdresse = new List<Adresse>(), Telefon = new List<Telefon>() }; Telefon n1Telefon = new Telefon() { Person = n1Person, Telefonnummer = "61656585", TelefonType = "work" };
private bool ProvjeriFormu() { foreach (var entry in entries) { if (string.IsNullOrWhiteSpace(entry.Text)) { entry.PlaceholderColor = Color.Red; entry.Focus(); return(false); } entry.StyleClass = new[] { "" }; } if (!ValidateDigits(Jmbg.Text)) { this.DisplayAlert("JMBG", "Molimo unesite samo brojeve", "OK"); Jmbg.Focus(); return(false); } if (!ValidateDigits(Telefon.Text)) { this.DisplayAlert("Telefon", "Molimo unesite samo brojeve", "OK"); Telefon.Focus(); return(false); } if (!ValidateEmail(Email.Text)) { this.DisplayAlert("Email", "Niste unijeli pravilan email", "OK"); Email.Focus(); return(false); } if (!ValidateDigits(Plata.Text)) { this.DisplayAlert("Plata", "Molimo unesite samo brojeve (. - delimitor)", "OK"); Plata.Focus(); return(false); } if (NovaLozinka.Text != PonovljenaLozinka.Text) { this.DisplayAlert("Lozinka", "Ponovljena lozinka nije ista", "OK"); PonovljenaLozinka.Focus(); return(false); } if (Uloga.SelectedIndex == 0) { Uloga.Focus(); return(false); } return(true); }
public void TheApp() { DBUtil utilitiy = new DBUtil(); City city1 = new City("8200", "Aarhus N", "Danmark"); utilitiy.AddCityDB(ref city1); // Tilføjer city1 til databasen Adresse adresse1 = new Adresse("Gyldenløvesgade", "6, 2 sal th", city1); utilitiy.AddAdresseDB(ref adresse1); // Tilføjer adresse1 til databasen Emailadresse email1 = new Emailadresse() { Email = "*****@*****.**", EmailID = 7 }; Operatoer operatør1 = new Operatoer() { Selskab = "TDC" }; Telefon telefon1 = new Telefon(20668161, operatør1); Note note1 = new Note() { Noten = "Studerende på AU", NoteID = 2 }; Person person1 = new Person("Simon", "Møller", "Hindkaer", "Mand", adresse1); utilitiy.AddPersonDB(ref person1); // Tilføjer person1 til databasen //utilitiy.AddEmailDB(ref email1); // Tilføjer email1 til databasen //utilitiy.AddTelefonDB(ref telefon1); // Tilføjer telefon1 til databasen //utilitiy.AddNoteDB(ref note1); // Tilføjer note1 til databasen //utilitiy.AddOperatoerDB(ref operatør1); // Tilføjer operatør1 til databasen //email1.Email = "*****@*****.**"; //utilitiy.UpdateEmailDB(ref email1); //Opdaterer email1 //utilitiy.DeleteAdresseDB(ref adresse1); // Sletter adresse1 //utilitiy.DeleteCityDB(ref city1); // Sletter city1 //utilitiy.DeleteEmailDB(ref email1); // Sletter email1 //utilitiy.DeleteTelefonDB(ref telefon1); // Sletter telefon1 //utilitiy.DeleteNoteDB(ref note1); // Sletter note1 //utilitiy.DeleteOperatoerDB(ref operatør1); // Sletter operatør1 //utilitiy.GetPerson(); // Viser alle personer i databasen //utilitiy.GetAdresse(); // Viser alle adresser i databasen //utilitiy.GetCity(); // Viser alle byer i databasen //utilitiy.GetEmail(); // Viser alle emails i databasen //utilitiy.GetTelefon(); // Viser alle telefoner i databasen //utilitiy.GetNoter(); // Viser alle noter i databasen //utilitiy.GetOperatoer(); // Viser alle operatører i databasen }
public ActionResult BrisanjePotvrdjenoTel(int?id) { Telefon telefon = db.Telefoni.Find(id); db.Telefoni.Remove(telefon); db.SaveChanges(); return(RedirectToAction("Index", "Skole")); }
public Cumparator(CumparatorDTO cumparatorDTO) { NumeCumparator = cumparatorDTO.NumeCumparator; PrenumeCumparator = cumparatorDTO.PrenumeCumparator; AdresaEmail = cumparatorDTO.AdresaEmail; NumarTelefon = cumparatorDTO.NumarTelefon; PublicaEveniment(new EvenimentGeneric <CumparatorDTO>(cumparatorDTO)); }
private void J_Telefon() { lastsec = DateTime.Now.Second; counter = true; pictureBoxBackground.Refresh(); labelCounter.Show(); Telefon.Start(); }
public void TelefonEkle(string tel, int id) { Telefon t = new Telefon(); t.Telefon1 = tel; t.MusteriID = id; tm.Add(t); }
public void Update(Telefon model) { Telefonbll telbll = new Telefonbll(); Telefon tel = telbll.TelefonGetir(model.TelefonId); tel.TelefonNumarası = model.TelefonNumarası; telbll.UpdateTelefon(tel); }
public IActionResult OnGet() { ViewData["ProducatorID"] = new SelectList(_context.Set <Producator>(), "ID", "NumeProducator"); var telefon = new Telefon(); telefon.TelefonCategories = new List <TelefonCategory>(); PopulateAssignedCategoryData(_context, telefon); return(Page()); }
public Anunt(Agent.Locuinta locuinta, string nume, float pretul, string locatia, Email email, Telefon telefon) { Locuinta = locuinta; this.nume = nume; this.pretul = pretul; this.locatia = locatia; this.email = email; this.telefon = telefon; }
private void controlMenuTelefon_EkleClick(object sender, EventArgs e) { _telefonEntity = new Telefon(); _telefonEntity.MusteriId = _musteriEntity.Id; controlMenuTelefon.KayitAc = true; groupTelefonBilgi.Visible = true; groupAltMenu.Enabled = false; TelefonBinding(); }
public Telefon GetPhoneNumber(long id) { Telefon phoneDb = new Telefon(); phoneDb = (from p in db.Telefon where p.Id == id select p).FirstOrDefault(); return(phoneDb); }
private void button1_Click(object sender, EventArgs e) { if (txtIme.Text != "" && txtPrezime.Text != "" && txtUlica.Text != "" && numUDBroj.Value != 0 && txtGrad.Text != "" && txtDrzava.Text != "") { try { ISession s = DataLayer.GetSession(); ITransaction t = s.BeginTransaction(); Osoba o = new Osoba() { Ime = txtIme.Text, Prezime = txtPrezime.Text, Ulica = txtUlica.Text, Broj = (int)numUDBroj.Value, Grad = txtGrad.Text, Drzava = txtDrzava.Text }; s.Save(o); foreach (var email in Emailovi) { Email em = new Email() { EmailKontakt = email, OsobaKontakt = o }; s.Save(em); o.Emailovi.Add(em); } foreach (var telefon in Telefoni) { Telefon tel = new Telefon() { OsobaKontakt = o, TelefonKontakt = telefon }; s.Save(tel); o.Telefoni.Add(tel); } broj = o.Id; t.Commit(); s.Close(); MessageBox.Show("kraj"); } catch (Exception ec) { MessageBox.Show(ec.Message); } DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show("Unesite sve podatke!"); } }
public void UpdateTelefona(TelefonBO telefonBO) { Telefon telefon = pDC.Telefons.FirstOrDefault(t => t.TelefonID == telefonBO.TelefonID); telefon.BrojTelefona = telefonBO.BrojTelefona; telefon.OznakaTipa = telefonBO.OznakaTipa; telefon.Lokal = telefonBO.Lokal; pDC.SubmitChanges(); }
public ActionResult Silme(Musteri _musteri, Telefon _telefon) { var model = new EntityModel { musteri = _musteri, telefon = _telefon }; return(View(model)); }
private void btnTelefonSil_Click(object sender, EventArgs e) { Telefon Silinecek = (Telefon)layoutViewTelefon.GetFocusedRow(); if (MessageBox.Show("Seçili olan veriyi silmek istediğinize emin misiniz?", "Uyarı", MessageBoxButtons.YesNo) == DialogResult.Yes) { telefonService.Sil(Silinecek); } }
public Anunt(Locuinta Locuinta, string Descriere, DateTime Data, float pretul, string locatia, Email AdresaEmail, Telefon NumarTelefon) { Locuinta = Locuinta; Descriere = Descriere; Data = Data; pretul = pretul; locatia = locatia; AdresaEmail = AdresaEmail; NumarTelefon = NumarTelefon; }
static void unos(Telefon tel) { Console.WriteLine("Unesite tip telefona"); tel.tip = Console.ReadLine(); Console.WriteLine("Unesite cenu telefona"); tel.cena = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Unesite kolicinu"); tel.kolicina = Convert.ToInt32(Console.ReadLine()); }