public PriceListCustomer()
        {
            InitializeComponent();

            listPriceDeleteExistsData = new List<Guid>();
            listIndexPriceDeleteExistsData = new List<int>();

            sqlTypeContRepository = new SqlTypeContRepository();
            ListTypeCont = sqlTypeContRepository.GetTypeCont();

            cboType.DataSource = ListTypeCont;
            cboType.DisplayMember = "TypeName";
            cboType.ValueMember = "ID";
            cboType.SelectedIndex = -1;
            cboType.SelectedText = Constant.VisitaJayaPerkasaApplication.cboDefaultText;

            sqlTypeContRepository = null;


            sqlCityRepository = new SqlCityRepository();
            listCity = sqlCityRepository.GetCity();
            if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
                MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                

            cbDestination.DataSource = listCity;
            cbDestination.DisplayMember = "CityName";
            cbDestination.ValueMember = "ID";
            cbDestination.SelectedIndex = -1;
            cbDestination.SelectedText = Constant.VisitaJayaPerkasaApplication.cboDefaultText;

            pickerFrom.Value = DateTime.Now;
            pickerTo.Value = DateTime.Now;
            sqlCityRepository = null;
        }
        public rptSupplyPriceControl()
        {
            InitializeComponent();
            SqlCityRepository sqlCityRepository = new SqlCityRepository();
            SqlTypeContRepository sqlTypeContRepository = new SqlTypeContRepository();


            List<TypeCont> listTypeCont = sqlTypeContRepository.GetTypeCont();
            List<City> listCity = sqlCityRepository.GetCity();
            if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
                MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);


            cboTypeCont.DataSource = listTypeCont;
            cboTypeCont.DisplayMember = "TypeName";
            cboTypeCont.Value = "ID";

            cboDestination.DataSource = listCity;
            cboDestination.DisplayMember = "CityName";
            cboDestination.Value = "ID";

            cboDestination.SelectedIndex = -1;
            cboDestination.Text = Constant.VisitaJayaPerkasaApplication.cboDefaultText;
            cboTypeCont.SelectedIndex = -1;
            cboTypeCont.Text = Constant.VisitaJayaPerkasaApplication.cboDefaultText;

            sqlCityRepository = null;
            sqlTypeContRepository = null;
            listTypeCont = null;
            listCity = null;
        }
示例#3
0
        public rptSIControl()
        {
            InitializeComponent();
            sqlScheduleRepository = new SqlScheduleRepository();
            sqlCityRepository = new SqlCityRepository();
            List<VisitaJayaPerkasa.Entities.Supplier> listSupplier;
            SqlSupplierRepository sqlSupplierRepository = new SqlSupplierRepository();
            listSupplier = sqlSupplierRepository.ListSuppliers();
            if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
                MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            cboSupplier.DataSource = listSupplier;
            cboSupplier.DisplayMember = "SupplierName";
            cboSupplier.SelectedIndex = -1;
            cboSupplier.ValueMember = "Id";
            cboSupplier.Text = "-- Choose --";

            List<VisitaJayaPerkasa.Entities.Schedule> listSchedule = sqlScheduleRepository.ListSchedule();
            cboKapal.DataSource = listSchedule;
            cboKapal.DisplayMember = "namaKapal";
            cboKapal.SelectedIndex = -1;
            cboKapal.Text = "-- Choose --";

            List<VisitaJayaPerkasa.Entities.City> listDestination = sqlCityRepository.GetCity();
            cboCity.DataSource = listDestination;
            cboCity.DisplayMember = "CityName";
            cboCity.ValueMember = "ID";
            cboCity.SelectedIndex = -1;
            cboCity.Text = "-- Choose --";
        }
示例#4
0
        public void LoadDataInBackground()
        {
            sqlCityRepository = new SqlCityRepository();
            cities = null;

            string searchValue = radTextBoxElementSearchWord.Text.ToLower();
            string searchKey = radComboBoxElement.Text;

            cities = sqlCityRepository.GetCity();
            if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
                MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            else if (cities != null)
            {
                if (!string.IsNullOrEmpty(searchValue) && !string.IsNullOrEmpty(searchKey))
                {
                    switch (searchKey)
                    {
                        case "Code":
                            ShowCities = cities.Where(c => c.CityCode.ToLower().Contains(searchValue)).ToList<VisitaJayaPerkasa.Entities.City>();
                            break;
                        case "Name":
                            ShowCities = cities.Where(c => c.CityName.ToLower().Contains(searchValue)).ToList<VisitaJayaPerkasa.Entities.City>();
                            break;
                        case "Days":
                            ShowCities = cities.Where(c => c.Days.ToString().Contains(searchValue)).ToList<VisitaJayaPerkasa.Entities.City>();
                            break;
                    }

                }
                else
                    ShowCities = cities;
            }
            else
                ShowCities = null;

            if (ShowCities != null)
            {
                totalPage = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(ShowCities.Count() / Convert.ToDecimal(pageSize))));
                currentPage = 1;
            }
            else
                totalPage = 0;
        }
示例#5
0
        public PriceList()
        {
            InitializeComponent();
            sqlPriceListRepository = new SqlPriceListRepository();
            sqlCityRepository = new SqlCityRepository();
            sqlCustomerRepository = new SqlCustomerRepository();
            sqlRecipientRepository = new SqlRecipientRepository();
            sqlWareHouseRepository = new SqlWareHouseRepository();

            listPriceDeleteExistsData = new List<Guid>();
            listIndexPriceDeleteExistsData = new List<int>();

            listTypeOfSupplier = sqlPriceListRepository.GetTypeOfSupplier(0);
            if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
                MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

            cboTypeSupplier.SelectedValueChanged -= new EventHandler(cboTypeSupplier_SelectedValueChanged);
            cboTypeSupplier.DataSource = listTypeOfSupplier;
            cboTypeSupplier.DisplayMember = "CategoryName";
            cboTypeSupplier.ValueMember = "ID";
            cboTypeSupplier.SelectedIndex = -1;
            cboTypeSupplier.SelectedText = Constant.VisitaJayaPerkasaApplication.cboDefaultText;
            cboTypeSupplier.SelectedValueChanged += new EventHandler(cboTypeSupplier_SelectedValueChanged);

            listCity = sqlCityRepository.GetCity();
            if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
                MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

            cbDestination.DataSource = listCity;
            cbDestination.DisplayMember = "CityName";
            cbDestination.ValueMember = "ID";
            cbDestination.SelectedIndex = -1;
            cbDestination.SelectedText = Constant.VisitaJayaPerkasaApplication.cboDefaultText;



            listRecipient = sqlRecipientRepository.GetRecipient();
            if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
                MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

            cboRecipient.DataSource = listRecipient;
            cboRecipient.DisplayMember = "Name";
            cboRecipient.ValueMember = "ID";
            cboRecipient.SelectedIndex = -1;
            cboRecipient.SelectedText = Constant.VisitaJayaPerkasaApplication.cboDefaultText;

            listWarehouse = sqlWareHouseRepository.GetWareHouse();
            if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
                MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

            cboStuffingPlace.DataSource = listWarehouse;
            cboStuffingPlace.DisplayMember = "Address";
            cboStuffingPlace.ValueMember = "Id";
            cboStuffingPlace.SelectedIndex = -1;
            cboStuffingPlace.SelectedText = Constant.VisitaJayaPerkasaApplication.cboDefaultText;

            cbSupplier.Enabled = false;
            cboRecipient.Enabled = false;
            cbDislayAll.Visible = false;
            cbDislayAll.Enabled = false;
            sqlPriceListRepository = null;
            PriceListGridView.Enabled = false;
            sqlCityRepository = null;

            pickerFrom.Value = DateTime.Today;
            pickerTo.Value = DateTime.Today;
        }
示例#6
0
        public ScheduleEdit(VisitaJayaPerkasa.Entities.Schedule schedule)
        {
            InitializeComponent();
            sqlCityRepository = new SqlCityRepository();
            sqlPelayaranRepository = new SqlPelayaranRepository();
            this.schedule = schedule;

            List<VisitaJayaPerkasa.Entities.City> listCity = sqlCityRepository.GetCity();
            List<VisitaJayaPerkasa.Entities.PelayaranDetail> listPelayaran = sqlPelayaranRepository.GetVessels();
            if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
                MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

            cboTujuan.DataSource = listCity;
            cboTujuan.DisplayMember = "CityName";
            cboTujuan.ValueMember = "ID";

            cboKapal.DataSource = listPelayaran;
            cboKapal.DisplayMember = "VesselName";
            cboKapal.ValueMember = "VesselCodeAndPelayaranID";

            if (schedule == null)
            {
                wantToCreateVessel = true;

                cboTujuan.SelectedIndex = -1;
                cboTujuan.Text = Constant.VisitaJayaPerkasaApplication.cboDefaultText;
                cboKapal.SelectedIndex = -1;
                cboKapal.Text = Constant.VisitaJayaPerkasaApplication.cboDefaultText;

                lblETA.Visible = false;
                lblTA.Visible = false;
                lblTD.Visible = false;
                lblUnloading.Visible = false;
                pickerETA.Visible = false;
                pickerTA.Visible = false;
                pickerTD.Visible = false;
                pickerUnLoading.Visible = false;

                pickerETD.Value = DateTime.Now;
                pickerUnLoading.Value = DateTime.Now;
                pickerTglClosing.Value = DateTime.Now;
            }
            else {
                wantToCreateVessel = false;
                 
                DialogResult dResult = MessageBox.Show(this, "Are you sure want to edit TD, TA and etc ? ", "Confirmation", MessageBoxButtons.YesNo);
                if (dResult == DialogResult.Yes)
                    wantToEditTdETC = true;
                else
                    wantToEditTdETC = false;


                cboTujuan.SelectedItem = schedule.berangkatTujuan;
                cboKapal.SelectedItem = schedule.namaKapal;

                etVOY.Text = schedule.voy;

                pickerETD.Value = schedule.etd;
                pickerUnLoading.Value = schedule.unLoading.GetValueOrDefault(DateTime.Now);
                pickerTglClosing.Value = schedule.tglclosing;

                etRObegin20.Text = schedule.ro_begin_20.ToString();
                etRObegin40.Text = schedule.ro_begin_40.ToString();
                etKet.Text = schedule.keterangan;

                lblETA.Visible = true;
                lblTA.Visible = true;
                lblTD.Visible = true;
                pickerETA.Visible = true;
                pickerTA.Visible = true;
                pickerTD.Visible = true;
                
                pickerETA.Value = DateTime.Now;
                pickerTA.Value = DateTime.Now;
                pickerTD.Value = DateTime.Now;


                if (wantToEditTdETC)
                {
                    cboTujuan.Enabled = false;
                    cboKapal.Enabled = false;
                    etVOY.Enabled = false;
                    pickerETD.Enabled = false;
                    pickerTglClosing.Enabled = false;
                    pickerUnLoading.Enabled = false;
                    etRObegin20.Enabled = false;
                    etRObegin40.Enabled = false;
                    etKet.Enabled = false;


                    VisitaJayaPerkasa.Entities.City tempCity = sqlCityRepository.GetCityByID(cboTujuan.SelectedValue.ToString());
                    if (tempCity.Deleted == 1)
                        MessageBox.Show(this, "ETA not same like city, because city has already be deleted", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    else
                    {
                        pickerETA.Value = DateTime.Now.AddDays(tempCity.Days);
                        pickerTA.Value = DateTime.Now.AddDays(tempCity.Days);
                    }

                    tempCity = null;
                }
                else {
                    lblETA.Visible = false;
                    lblTA.Visible = false;
                    lblTD.Visible = false;

                    pickerETA.Visible = false;
                    pickerTA.Visible = false;
                    pickerTD.Visible = false;
                }
            }

            listCity = null;
            sqlCityRepository = null;
         }
示例#7
0
        public SupplierEdit(VisitaJayaPerkasa.Entities.Supplier supplier)
        {
            InitializeComponent();
            sqlCategoryRepository = new SqlCategoryRepository();
            sqlPaymentRepository = new SqlPaymentRepository();
            sqlCityRepository = new SqlCityRepository();
            List<Category> listCategory = sqlCategoryRepository.GetCategories();
            List<Payment> listPayment = sqlPaymentRepository.GetListPayment();
            List<Entities.City> listCity = sqlCityRepository.GetCity();

            cboCategory.DataSource = listCategory;
            cboCategory.DisplayMember = "CategoryName";
            cboCategory.ValueMember = "ID";

            cbTypeOfPayment.DataSource = listPayment;
            cbTypeOfPayment.DisplayMember = "Name";
            cbTypeOfPayment.ValueMember = "ID";

            cboDestination.DataSource = listCity;
            cboDestination.DisplayMember = "CityName";
            cboDestination.ValueMember = "ID";
            cboDestination.SelectedIndex = -1;
            cboDestination.Text = Constant.VisitaJayaPerkasaApplication.cboDefaultText;

            this.supplier = supplier;
            this.isSaveMasterSupplierDetail = false;
            sqlCityRepository = null;
            sqlPaymentRepository = null;

            if (supplier == null)
            {
                if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
                    MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                wantToCreateVessel = true;
                listSupplierDetail = new List<Entities.SupplierDetail>();

                cboCategory.SelectedIndex = -1;
                cboCategory.Text = "-- Choose --";

                cbTypeOfPayment.SelectedIndex = -1;
                cbTypeOfPayment.Text = Constant.VisitaJayaPerkasaApplication.cboDefaultText;
            }
            else
            {
                wantToCreateVessel = false;
                etSupplierName.Text = supplier.SupplierName;
                cboCategory.SelectedItem = supplier.CategoryName;

                if (supplier.TypeOfPayment == null)
                {
                    cbTypeOfPayment.SelectedIndex = -1;
                    cbTypeOfPayment.Text = Constant.VisitaJayaPerkasaApplication.cboDefaultText;
                }
                else
                    cbTypeOfPayment.SelectedValue = supplier.TypeOfPayment;

                etTermOfPayment.Text = supplier.TermOfPayment;
                etAddress.Text = supplier.Address;
                etEmail.Text = supplier.Email;
                etPhone.Text = supplier.Phone;
                etFax.Text = supplier.Fax;
                etContactPerson.Text = supplier.ContactPerson;

                SqlSupplierRepository sqlSupplierRepository = new SqlSupplierRepository();
                listSupplierDetail = sqlSupplierRepository.ListSupplierDetail(supplier.Id);

                if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
                {
                    MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else if (listSupplierDetail != null)
                    supplierDetailGridView.DataSource = listSupplierDetail;
                else
                    listSupplierDetail = new List<VisitaJayaPerkasa.Entities.SupplierDetail>();


                if (supplier.CategoryName.Equals("Trucking"))
                { 
                    List<string> listTemp = sqlSupplierRepository.ListTruckingNumber(supplier.Id);

                    if(listTemp != null)
                        for (int i = 0; i < listTemp.Count; i++)
                            gvTrucking.Rows.Add(listTemp.ElementAt(i));

                    listTemp = null;
                }
                else if (supplier.CategoryName.Equals("Dooring Agent"))
                {
                    List<Entities.City> listTemp = sqlSupplierRepository.ListCitySupplier(supplier.Id);
                    groupBoxDestination.Visible = true;

                    if (listTemp != null)
                        for (int i = 0; i < listTemp.Count; i++)
                        {
                            gvDestination.Rows.AddNew();

                            GridViewDataRowInfo gridViewRow = gvDestination.Rows[i];
                            gridViewRow.Cells["ID"].Value = listTemp.ElementAt(i).ID.ToString();
                            gridViewRow.Cells["CityName"].Value = listTemp.ElementAt(i).CityName;
                        }

                    listTemp = null;
                }

                sqlSupplierRepository = null;
            }
        }
示例#8
0
        private void cboKeySearch_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboKeySearch.Text.Equals("Destination"))
            {
                SqlCityRepository sqlCityRepository = new SqlCityRepository();
                List<VisitaJayaPerkasa.Entities.City> listCity = sqlCityRepository.GetCity();

                if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
                    MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                cboValueSearch.DataSource = null;

                cboValueSearch.DataSource = listCity;
                cboValueSearch.DisplayMember = "CityName";
                cboValueSearch.ValueMember = "ID";

                txtRoSearch.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                cboValueSearch.Visibility = Telerik.WinControls.ElementVisibility.Visible;
                listCity = null;
                sqlCityRepository = null;
            }
            else if (cboKeySearch.Text.Equals("VOY"))
            {
                cboValueSearch.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                txtRoSearch.Visibility = Telerik.WinControls.ElementVisibility.Visible;
            }
            else if (cboKeySearch.Text.Equals("Vessel")) {
                SqlPelayaranRepository sqlPelayaranRepository = new SqlPelayaranRepository();
                List<VisitaJayaPerkasa.Entities.PelayaranDetail> listPelayaran = sqlPelayaranRepository.GetVessels();

                if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
                    MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                cboValueSearch.DataSource = null;

                cboValueSearch.DataSource = listPelayaran;
                cboValueSearch.DisplayMember = "VesselName";
                cboValueSearch.ValueMember = "VesselCode";

                txtRoSearch.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                cboValueSearch.Visibility = Telerik.WinControls.ElementVisibility.Visible;

                listPelayaran = null;
                sqlPelayaranRepository = null;
            }
            else if (cboKeySearch.Text.Equals("All"))
            {
                cboValueSearch.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                txtRoSearch.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
            }
        }
        public CustomerTransEdit(VisitaJayaPerkasa.Entities.CustomerTrans customerTrans)
        {
            InitializeComponent();
            this.customerTrans = customerTrans;
            
            sqlCustomerRepository = new SqlCustomerRepository();
            sqlTypeContRepository = new SqlTypeContRepository();
            sqlCityRepository = new SqlCityRepository();
            sqlPelayaranRepository = new SqlPelayaranRepository();
            sqlConditionRepository = new SqlConditionRepository();
            sqlPriceListRepository = new SqlPriceListRepository();
            sqlWarehouseRepository = new SqlWareHouseRepository();
            sqlRecipientRepository = new SqlRecipientRepository();
            sqlScheduleRepository = new SqlScheduleRepository();
            sqlTruckingRepository = new SqlTruckingRepository();
            sqlJenisBarangRepository = new SqlJenisBarangRepository();

            List<VisitaJayaPerkasa.Entities.Customer> listCustomer = sqlCustomerRepository.ListCustomers();
            List<VisitaJayaPerkasa.Entities.TypeCont> listType = sqlTypeContRepository.GetTypeCont();
            List<VisitaJayaPerkasa.Entities.City> listOrigin = sqlCityRepository.GetCity();
            if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
            {
                MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            List<VisitaJayaPerkasa.Entities.City> listDestination = sqlCityRepository.GetCity();
            List<VisitaJayaPerkasa.Entities.PelayaranDetail> listPelayaran = sqlPelayaranRepository.GetVessels();
            List<VisitaJayaPerkasa.Entities.Schedule> listSchedule = sqlScheduleRepository.ListSchedule();
            List<VisitaJayaPerkasa.Entities.Condition> listCondition = sqlConditionRepository.GetConditions();
            if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
            {
                MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            List<VisitaJayaPerkasa.Entities.WareHouse> listWarehouse;
            List<VisitaJayaPerkasa.Entities.Recipient> listRecipient;
            if (customerTrans != null)
            {
                listWarehouse = (this.customerTrans == null) ? sqlWarehouseRepository.GetWareHouse() : sqlWarehouseRepository.GetWareHouseByCustomer(customerTrans.CustomerID);
                listRecipient = (this.customerTrans == null) ? sqlRecipientRepository.GetRecipient() : sqlRecipientRepository.GetRecipientByCustomer(customerTrans.CustomerID);
            }
            else
            {
                listWarehouse = new List<Entities.WareHouse>();
                listRecipient = new List<Entities.Recipient>();
            }
            List<VisitaJayaPerkasa.Entities.Trucking> listTrucking = new List<Entities.Trucking>();
            List<VisitaJayaPerkasa.Entities.JenisBarang> listJenisBarang = sqlJenisBarangRepository.ListJenisBarang();
            if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
            {
                MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            cboCustomer.DataSource = listCustomer;
            cboCustomer.DisplayMember = "CustomerName";
            cboCustomer.ValueMember = "ID";
            cboCustomer.SelectedIndex = -1;
            cboCustomer.Text = "-- Choose --";
            cboCustomer.Tag = "cboCustomer";
            
            cboType.DataSource = listType;
            cboType.DisplayMember = "TypeName";
            cboType.ValueMember = "ID";
            cboType.SelectedIndex = -1;
            cboType.Text = "-- Choose --";

            cboOrigin.DataSource = listOrigin;
            cboOrigin.DisplayMember = "CityName";
            cboOrigin.ValueMember = "ID";
            cboOrigin.SelectedIndex = -1;
            cboOrigin.Text = "-- Choose --";

            cboDestination.DataSource = listDestination;
            cboDestination.DisplayMember = "CityName";
            cboDestination.ValueMember = "ID";
            cboDestination.SelectedIndex = -1;
            cboDestination.Text = "-- Choose --";

            days = from p in listDestination 
                   select p.Days;

            cboPelayaranDetail.DataSource = listSchedule;
            cboPelayaranDetail.DisplayMember = "namaKapal";
            //cboPelayaranDetail.ValueMember = "ID";
            cboPelayaranDetail.SelectedIndex = -1;
            cboPelayaranDetail.Text = "-- Choose --";

            cboCondition.DataSource = listCondition;
            cboCondition.DisplayMember = "ConditionName";
            cboCondition.ValueMember = "ID";
            cboCondition.SelectedIndex = -1;
            cboCondition.Text = "-- Choose --";

            cboStuffingPlace.DataSource = listWarehouse;
            cboStuffingPlace.DisplayMember = "Address";
            cboStuffingPlace.ValueMember = "Id";
            cboStuffingPlace.SelectedIndex = -1;
            cboStuffingPlace.Text = "-- Choose --";

            cboRecipient.DataSource = listRecipient;
            cboRecipient.DisplayMember = "Name";
            cboRecipient.ValueMember = "ID";
            cboRecipient.SelectedIndex = -1;
            cboRecipient.Text = "-- Choose --";

            cboTrucking.DataSource = listTrucking;
            cboTrucking.DisplayMember = "TruckNo";
            cboTrucking.ValueMember = "ID";
            cboTrucking.SelectedIndex = -1;
            cboTrucking.Text = "-- Choose --";

            cboJenisBarang.DataSource = listJenisBarang;
            cboJenisBarang.DisplayMember = "Nama";
            cboJenisBarang.ValueMember = "Nama";
            cboJenisBarang.SelectedIndex = -1;
            cboJenisBarang.Text = "-- Type or Choose --";

            if (customerTrans == null)
            {
                wantToCreateVessel = true;
                listCustomerTransDetail = new List<Entities.CustomerTransDetail>();
            }
            else
            {
                wantToCreateVessel = false;
                cboCustomer.SelectedValue = customerTrans.CustomerID;
                cboCustomer.Enabled = false;

                SqlCustomerTransRepository sqlCustomerTransRepository = new SqlCustomerTransRepository();
                listCustomerTransDetail = sqlCustomerTransRepository.ListCustomerTransDetail(customerTrans.CustomerTransID);
                ID = customerTrans.CustomerTransID;

                if (!Constant.VisitaJayaPerkasaApplication.anyConnection)
                    MessageBox.Show(this, "Please check your connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                else if (listCustomerTransDetail != null)
                    CustomerTransDetailGridView.DataSource = listCustomerTransDetail;
                else
                    listCustomerTransDetail = new List<VisitaJayaPerkasa.Entities.CustomerTransDetail>();

                sqlCustomerTransRepository = null;
            }



            cboCustomer.SelectedIndexChanged += new EventHandler(cboSelected_SelectedIndexChanged);
            cboType.SelectedIndexChanged += new EventHandler(cboSelected_SelectedIndexChanged);
            cboDestination.SelectedIndexChanged += new EventHandler(cboSelected_SelectedIndexChanged);
            cboCondition.SelectedIndexChanged += new EventHandler(cboSelected_SelectedIndexChanged);


            sqlCustomerRepository = null;
            sqlTypeContRepository = null;
            sqlCityRepository = null;
            sqlPelayaranRepository = null;
            sqlConditionRepository = null;

            if (wantToCreateVessel)
            {
                dtpTD.Visible = false;
                dtpETA.Visible = false;
                dtpTA.Visible = false;
                dtpUnloading.Visible = false;
            }
        }