Package ivasoft.mainwindow.musteri

Source Code of ivasoft.mainwindow.musteri.NewMusteriUi

package ivasoft.mainwindow.musteri;


import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.ui.AbsoluteLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Form;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;


@SuppressWarnings("serial")
public class NewMusteriUi extends VerticalLayout implements Button.ClickListener{
 
  int index=1;
  Button telefonEkleButton;
  Button kaydetButton;
  AbsoluteLayout musteriIletisimBilgilerLayout;
  VerticalLayout telefonAlaniLayout;
  ComboBox musteriIl;
  ComboBox musteriIlce;
   Object firmaIlId;
  Object firmaIlceId;
 
  public NewMusteriUi() {
    AbsoluteLayout musteriTemelBilgilerLayout = new AbsoluteLayout();
    AbsoluteLayout musteriAdresBilgilerLayout = new AbsoluteLayout();
    musteriIletisimBilgilerLayout = new AbsoluteLayout();
    telefonAlaniLayout = new VerticalLayout();

    final TabSheet tabSheet = new TabSheet();
    final TextField musteriVdn = new TextField("Vergi Dairesi No");
    final TextField musteriVd = new TextField("Vergi Dairesi");
    final TextField musteriAdi = new TextField("Firma Adi");
    final TextField musteriTuru = new TextField("Firma Türü");
    final TextField musteriTipi = new TextField("Firma Tipi");
    final TextField musteriSektor = new TextField("Firma Sektörü");
    final TextField musteriAdres = new TextField("Firma Adresi");
    final TextField musteriSemt = new TextField("Semt");
    musteriIlce = new ComboBox("İlçe");
    musteriIl = new ComboBox("İl");
    final ComboBox musteriUlke = new ComboBox("Ülke");
    final TextField musteriMail = new TextField("Mail Adresi");
    final TextField musteriWeb = new TextField("Firma Web Sayfasi");
    final TextArea musteriNot = new TextArea("Not");
    telefonEkleButton = new Button("+",this);

    final TextField musteriTelefon = new TextField("Telefon");
    final TextField musteriTelefonTuru = new TextField("Telefon Türü");
    kaydetButton = new Button("Kaydet",this);

    Form musteriTemelBilgilerForm = new Form();
    Form musteriAdresBilgilerForm = new Form();
    Form musteriIletisimBilgilerForm = new Form();

    musteriTemelBilgilerForm.setImmediate(true);
    musteriAdresBilgilerForm.setImmediate(true);
    musteriIletisimBilgilerForm.setImmediate(true);

    musteriTemelBilgilerLayout.setWidth("100%");
    musteriTemelBilgilerLayout.setHeight("460px");
    musteriAdresBilgilerLayout.setWidth("100%");
    musteriAdresBilgilerLayout.setHeight("460px");
    musteriIletisimBilgilerLayout.setWidth("100%");
    musteriIletisimBilgilerLayout.setHeight("360px");

    musteriVdn.setWidth("200px");
    musteriVd.setWidth("200px");
    musteriAdi.setWidth("200px");
    musteriTuru.setWidth("200px");
    musteriTipi.setWidth("200px");
    musteriSektor.setWidth("200px");
    musteriAdres.setWidth("200px");
    musteriSemt.setWidth("200px");
    musteriIlce.setWidth("200px");
    musteriIl.setWidth("200px");
    musteriUlke.setWidth("200px");
    musteriMail.setWidth("200px");
    musteriWeb.setWidth("200px");
    musteriNot.setWidth("200px");
    // musteriTelefon.setWidth("200px");
    musteriTelefonTuru.setWidth("200px");

    // temelbilgiler
    musteriTemelBilgilerLayout.addComponent(musteriVdn, "left : 30px ; top : 50px");
    musteriTemelBilgilerLayout.addComponent(musteriVd, "left : 30px ; top : 100px");
    musteriTemelBilgilerLayout.addComponent(musteriAdi, "left : 30px ; top : 150px");
    musteriTemelBilgilerLayout.addComponent(musteriTuru, "left : 30px ; top : 200px");
    musteriTemelBilgilerLayout.addComponent(musteriTipi, "left : 30px ; top : 250px");
    musteriTemelBilgilerLayout.addComponent(musteriSektor, "left : 30px ; top : 300px");
    musteriTemelBilgilerLayout.addComponent(musteriNot, "left : 30px ; top : 350px");

    // AdresBilgiler
    musteriAdresBilgilerLayout.addComponent(musteriAdres, "left : 30px ; top : 50px");
    musteriAdresBilgilerLayout.addComponent(musteriSemt, "left : 30px ; top : 100px");
    musteriAdresBilgilerLayout.addComponent(musteriIlce, "left : 30px ; top : 150px");
    musteriAdresBilgilerLayout.addComponent(musteriIl, "left : 30px ; top : 200px");
    musteriAdresBilgilerLayout.addComponent(musteriUlke, "left : 30px ; top : 250px");

    // iletişimbilgileri

    musteriIletisimBilgilerLayout.addComponent(musteriMail, "left : 30px ; top : 50px");
    musteriIletisimBilgilerLayout.addComponent(musteriWeb, "left : 30px ; top : 100px");
    musteriIletisimBilgilerLayout.addComponent(musteriTelefon, "left : 30px ; top : 150px");
    musteriIletisimBilgilerLayout.addComponent(musteriTelefonTuru, "left : 30px ; top : 200px");
    musteriIletisimBilgilerLayout.addComponent(telefonAlaniLayout, "left : 330px ; top : 35px");
    musteriIletisimBilgilerLayout.addComponent(telefonEkleButton, "left : 535px ; top : 48px");
    telefonAlaniLayout.addComponent(musteriTelefon);

    musteriTemelBilgilerForm.setLayout(musteriTemelBilgilerLayout);
    musteriAdresBilgilerForm.setLayout(musteriAdresBilgilerLayout);
    musteriIletisimBilgilerForm.setLayout(musteriIletisimBilgilerLayout);

    // layoutlar
    tabSheet.addTab(musteriTemelBilgilerForm, "Müşteri Temel Bilgiler");
    tabSheet.addTab(musteriAdresBilgilerForm, "Müşteri Adres Bilgiler");
    tabSheet.addTab(musteriIletisimBilgilerForm, "Müşteri İletişim Bilgiler");

   
   
   
    //  ------------------------------------------------
    musteriIl.addItem("Ankara");
    musteriIl.addItem("İzmir");
    musteriIlce.addItem("Mamak");
    musteriIlce.addItem("Çankaya");
    musteriIlce.addItem("Konak");
    musteriIlce.addItem("Tire");
   
    musteriUlke.addItem("Türkiye");
   
    musteriIl.setImmediate(true);
    musteriIlce.setImmediate(true);
    musteriUlke.setImmediate(true);
    musteriIl.setNullSelectionAllowed(false);

    musteriIl.addListener(new Property.ValueChangeListener() {

      public void valueChange(ValueChangeEvent event) {
   
    
      }
    });
    musteriIlce.addListener(new Property.ValueChangeListener() {
     
      public void valueChange(ValueChangeEvent event) {
      }
    });

   
    // actions
   
 
    kaydetButton.addListener(new ClickListener() {

      private static final long serialVersionUID = -3603517503977202161L;

      public void buttonClick(ClickEvent event) {
       
            }
    });

    telefonEkleButton.addListener(new ClickListener() {
      private static final long serialVersionUID = -1402790398015741757L;

      public void buttonClick(ClickEvent event) {
       
      }
    });

    addComponent(tabSheet);
    addComponent(kaydetButton);

  }

  public void buttonClick(ClickEvent event) {
    if (event.getSource().equals(kaydetButton)) {
      if(musteriIl.getValue().equals("Ankara")){firmaIlId=6;}
      else{firmaIlId=35;}
      if(musteriIlce.getValue().equals("Konak")){firmaIlId=1424;}
      else if (musteriIlce.getValue().equals("Tire")){firmaIlceId=1442;}
      else if (musteriIlce.getValue().equals("Mamak")){firmaIlceId=1026;}
      else{firmaIlceId=1017;}
      Object firmaUlkeId = 219;
   
//      Object id = FirmalarAnaMetot.firmaEkle(musteriVdn.getValue(),musteriVd.getValue() , musteriAdi.getValue(), musteriTuru.getValue(),
//          musteriTipi.getValue(), musteriSektor.getValue(), musteriAdres.getValue(), musteriSemt.getValue(), firmaIlceId, firmaIlId,
//          firmaUlkeId, musteriMail.getValue(), musteriNot.getValue(), musteriWeb.getValue());
//      FirmalarTelefonMetot.telefonEkle(musteriTelefon.getValue().toString(), musteriTelefonTuru.getValue().toString(), id);

    }if (event.getSource().equals(telefonEkleButton)) {
      index++;
      TextField field = new TextField("Telefon " + index);
      field.setWidth("200px");
      telefonAlaniLayout.addComponent(field);
      musteriIletisimBilgilerLayout.removeComponent(telefonAlaniLayout);
      musteriIletisimBilgilerLayout.addComponent(telefonAlaniLayout, "left : 330px ; top : 35px");

    }
   
  }
 
}
TOP

Related Classes of ivasoft.mainwindow.musteri.NewMusteriUi

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.