NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package tr.com.java.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import tr.com.java.dao.SatisYonetimiImp;

import tr.com.java.entity.Kullanici;
import tr.com.java.entity.MusteriTedarikci;
import tr.com.java.entity.OlcuBirimi;
import tr.com.java.entity.Siparis;
import tr.com.java.entity.SiparisSatir;
import tr.com.java.entity.StokKalemleri;
import tr.com.java.entity.Tenant;

/**
*
* @author cagri
*/
@ManagedBean(name="siparisDuzenleBean1")
@ViewScoped
public class SiparisDuzenleBean1 implements Serializable{

private static final Logger LOG = Logger.getLogger(SiparisDuzenleBean1.class.getName());
private List<SiparisSatir> siparisNoktalariListesi = new ArrayList<>();
private List<SiparisSatir> siparisNoktalariDuzenleListesi = new ArrayList<>();
private List<SiparisSatir> siparisNoktalariSilinenListesi = new ArrayList<>();



private Siparis siparis;
private long id;
private Tenant organizasyonId;
private Kullanici kullanici;
private StokKalemleri stokkalemleri;
private SiparisSatir siparisSatir;


private double miktar;
private double birimfiyat;
private double iskontorani;
private double iskontotutar;
private double kdvorani;
private double kdvtutar;
private double tutar;

@PostConstruct
public void init() {
LOG.info("init");
siparis = new Siparis();
siparisSatir = new SiparisSatir();
organizasyonId = new Tenant();
kullanici = new Kullanici();
}


public SiparisDuzenleBean1(){}


public SiparisDuzenleBean1(Siparis siparis, long id, Tenant organizasyonId, Kullanici kullanici, StokKalemleri stokkalemleri, SiparisSatir siparisSatir, double miktar, double birimfiyat, double iskontorani, double iskontotutar, double kdvorani, double kdvtutar, double tutar) {
this.siparis = siparis;
this.id = id;
this.organizasyonId = organizasyonId;
this.kullanici = kullanici;
this.stokkalemleri = stokkalemleri;
this.siparisSatir = siparisSatir;
this.miktar = miktar;
this.birimfiyat = birimfiyat;
this.iskontorani = iskontorani;
this.iskontotutar = iskontotutar;
this.kdvorani = kdvorani;
this.kdvtutar = kdvtutar;
this.tutar = tutar;
}

public List<SiparisSatir> getSiparisNoktalariListesi() {
if(siparisNoktalariDuzenleListesi.isEmpty()){
SatisYonetimiImp satisyonetimiImp = new SatisYonetimiImp();
siparisNoktalariListesi = satisyonetimiImp.siparisSatirlariListesi(id);
for(int i = 0; i<siparisNoktalariListesi.size();i++){
siparisNoktalariDuzenleListesi.add(siparisNoktalariListesi.get(i));
}

}else{
getSiparisNoktalariDuzenleListesi();

}

return siparisNoktalariListesi;
}

public void setSiparisNoktalariListesi(List<SiparisSatir> siparisNoktalariListesi) {
this.siparisNoktalariListesi = siparisNoktalariListesi;
}

public List<SiparisSatir> getSiparisNoktalariDuzenleListesi() {
return siparisNoktalariDuzenleListesi;
}

public void setSiparisNoktalariDuzenleListesi(List<SiparisSatir> siparisNoktalariDuzenleListesi) {
this.siparisNoktalariDuzenleListesi = siparisNoktalariDuzenleListesi;
}

public List<SiparisSatir> getSiparisNoktalariSilinenListesi() {
return siparisNoktalariSilinenListesi;
}

public void setSiparisNoktalariSilinenListesi(List<SiparisSatir> siparisNoktalariSilinenListesi) {
this.siparisNoktalariSilinenListesi = siparisNoktalariSilinenListesi;
}

public Siparis getSiparis() {
return siparis;
}

public void setSiparis(Siparis siparis) {
this.siparis = siparis;
}

public long getId() {
return id;
}

public void setId(long id) {
this.id = id;
}

public Tenant getOrganizasyonId() {
return organizasyonId;
}

public double getMiktar() {
return miktar;
}

public void setMiktar(double miktar) {
this.miktar = miktar;
}

public double getBirimfiyat() {
return birimfiyat;
}

public void setBirimfiyat(double birimfiyat) {
this.birimfiyat = birimfiyat;
}

public double getIskontorani() {
return iskontorani;
}

public void setIskontorani(double iskontorani) {
this.iskontorani = iskontorani;
}

public double getIskontotutar() {
return iskontotutar;
}

public void setIskontotutar(double iskontotutar) {
this.iskontotutar = iskontotutar;
}

public double getKdvorani() {
return kdvorani;
}

public void setKdvorani(double kdvorani) {
this.kdvorani = kdvorani;
}

public double getKdvtutar() {
return kdvtutar;
}

public void setKdvtutar(double kdvtutar) {
this.kdvtutar = kdvtutar;
}

public double getTutar() {
return tutar;
}

public void setTutar(double tutar) {
this.tutar = tutar;
}

public void setOrganizasyonId(Tenant organizasyonId) {
this.organizasyonId = organizasyonId;
}

public Kullanici getKullanici() {
return kullanici;
}

public void setKullanici(Kullanici kullanici) {
this.kullanici = kullanici;
}

public StokKalemleri getStokkalemleri() {
return stokkalemleri;
}

public void setStokkalemleri(StokKalemleri stokkalemleri) {
this.stokkalemleri = stokkalemleri;
}

public SiparisSatir getSiparisSatir() {
return siparisSatir;
}

public void setSiparisSatir(SiparisSatir siparisSatir) {
this.siparisSatir = siparisSatir;
}

public void itemEkle() {
siparisNoktalariDuzenleListesi.add(new SiparisSatir());
}

public void itemKaldir(SiparisSatir siparisSatir,long id) {
siparisNoktalariDuzenleListesi.remove(siparisSatir);
siparisSatir.setId(id);
siparisNoktalariSilinenListesi.add(siparisSatir);




System.out.println("------*****" + siparisSatir.getId());
System.out.println("List size -------" + siparisNoktalariSilinenListesi.size());
System.out.println("id -------" + id);



}

public List<OlcuBirimi> getOlcuBirimiListesi() {
SatisYonetimiImp satisyonetimiImp = new SatisYonetimiImp();
return satisyonetimiImp.tumOlcuBirimi();
}

public List<StokKalemleri> getStokListesi() {
SatisYonetimiImp satisYonetimiImp = new SatisYonetimiImp();
return satisYonetimiImp.tumStoklar(1);
}

public List<MusteriTedarikci> getMusteriTedarikciListe() {
SatisYonetimiImp satisYonetimiImp = new SatisYonetimiImp();
return satisYonetimiImp.mtGetir(2);
}

public void siparisGetir() {
SatisYonetimiImp satisYonetimiImp = new SatisYonetimiImp();
setSiparis(satisYonetimiImp.siparisGetirOku(id));
getSiparisNoktalariListesi();

}

public String siparisDuzenle() {


FacesContext context = FacesContext.getCurrentInstance();
SatisYonetimiImp satisYonetimiImp = new SatisYonetimiImp();
boolean durum;

durum = satisYonetimiImp.siparisDuzenle(organizasyonId, kullanici, siparis, siparisNoktalariDuzenleListesi, siparisNoktalariSilinenListesi);
if (durum) {

context.addMessage(null, new FacesMessage("Sipariş Bilgileri Guncellendi"));
return "/pages/satis/siparis/GonderilenSiparisIndex.xhtml?faces-redirect=true";
} else {

return "/pages/satis/siparis/SiparisDuzenle1.xhtml?faces-redirect=true";
}

}

@PreDestroy
public void close() {
LOG.info("close");
}
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.