Exemplo n.º 1
0
        private YerDegisiklikSonuc YerDegisiklikSonucOlustur(string aciklama, string hataAciklama)
        {
            var sonuc = new YerDegisiklikSonuc();
            var h     = new Hata();

            h.HataAciklamasi = hataAciklama;
            sonuc.Hatalar.Add(h);
            sonuc.IslemSonucu = false;
            sonuc.Aciklama    = aciklama;
            return(sonuc);
        }
Exemplo n.º 2
0
        private void btnGonder_Click(object sender, EventArgs e)
        {
            if (radioButtonTasimaBilgileriKaydet.Checked == false && radioButtonKonteynerYeriniDegistir.Checked == false)
            {
                MessageBox.Show("Select operation!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (String.IsNullOrEmpty(txtRequest.Text))
            {
                MessageBox.Show("Select the message!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);

            binding.SendTimeout = TimeSpan.FromSeconds(125);
            binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
            binding.Security.Transport.Realm = "";
            binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;
            binding.Security.Message.ClientCredentialType  = BasicHttpMessageCredentialType.UserName;
            binding.Security.Message.AlgorithmSuite        = System.ServiceModel.Security.SecurityAlgorithmSuite.Default;

            EndpointAddress address = new EndpointAddress("http://ws.xxx.gov.tr:8080/EXT/ABC/Konteyner/Provider");
            KonteynerClient client  = new KonteynerClient(binding, address);

            client.ClientCredentials.UserName.UserName = "******";
            client.ClientCredentials.UserName.Password = "******";

            objSerialize sr = new objSerialize();

            if (radioButtonTasimaBilgileriKaydet.Checked)
            {
                object msgTasima        = sr.DeSerializeAnObject(txtRequest.Text, typeof(Tasima));
                Sonuc  tasimaKayitSonuc = client.TasimaBilgileriKaydet((Tasima)msgTasima);

                txtResponse.Text = IndentXMLString(sr.SerializeAnObject(tasimaKayitSonuc));
            }
            else if (radioButtonKonteynerYeriniDegistir.Checked)
            {
                ContainerPlaceChange kyd      = (ContainerPlaceChange)sr.DeSerializeAnObject(txtRequest.Text, typeof(ContainerPlaceChange));
                YerDegisiklikSonuc   yerSonuc = client.KonteynerYeriniDegistir(kyd.NotificationNo, kyd.ContainerNo, kyd.Placeholder);

                txtResponse.Text = IndentXMLString(sr.SerializeAnObject(yerSonuc));
            }
        }
Exemplo n.º 3
0
        public YerDegisiklikSonuc KonteynerYeriniDegistir(string bildirimNo, string konteynerNo, string bulunduguYer)
        {
            string             konteynerNoKontrolSonucu = String.Empty;
            YerDegisiklikSonuc sonuc;

            try
            {
                if (String.IsNullOrEmpty(bildirimNo))
                {
                    return(YerDegisiklikSonucOlustur("Değişiklik yapılmadı", "Bildirim No alanı boş olamaz!"));
                }

                if (bildirimNo.Length < 8)
                {
                    return(YerDegisiklikSonucOlustur("Değişiklik yapılmadı", "BildirimNo bilgisi format hatası!"));
                }

                if (BildirimNoKontrolEt(bildirimNo))
                {
                    return(YerDegisiklikSonucOlustur("Değişiklik yapılmadı", "Sistemde olmayan bildirim numarasını gönderdiniz!"));
                }

                konteynerNoKontrolSonucu = KonteynerNoKontrolEt(konteynerNo);

                if (konteynerNoKontrolSonucu != String.Empty)
                {
                    return(YerDegisiklikSonucOlustur("Değişiklik yapılmadı", konteynerNoKontrolSonucu));
                }

                if (YerDegisiklikKonteynerNoKontrolEt(bildirimNo, konteynerNo))
                {
                    return(YerDegisiklikSonucOlustur("Değişiklik yapılmadı", "Beyan ettiğiniz bildirim numarasına karşılık sistemde olmayan konteyner numarası gönderdiniz!"));
                }

                sonuc = new YerDegisiklikSonuc();
                IData data = GetDataObject();

                string sorgu = @"update TASIMA_DETAY set BULUNDUGU_YER = :bulunduguyer 
                                 where TASIMA_SIRA_NO = (select SIRA_NO from TASIMA where BILDIRIM_NO = :bildirimno) 
                                       and KONTEYNER_NO=:konteynerno";

                data.AddOracleParameter("bulunduguyer", bulunduguYer, OracleDbType.Varchar2, 200);
                data.AddOracleParameter("bildirimno", bildirimNo, OracleDbType.Varchar2, 20);
                data.AddOracleParameter("konteynerno", konteynerNo, OracleDbType.Varchar2, 30);

                int islemSonucu = data.ExecuteStatement(sorgu, CommandType.Text);

                if (islemSonucu == 0)
                {
                    sonuc = YerDegisiklikSonucOlustur("Değişiklik yapılmadı", "Güncellenecek kayıt bulunamadı!");
                }
                else
                {
                    sonuc.IslemSonucu = true;
                    sonuc.Aciklama    = "Değişiklik yapıldı";
                }
            }
            catch (Exception exc)
            {
                sonuc = YerDegisiklikSonucOlustur("Değişiklik yapılmadı", exc.Message);
            }

            return(sonuc);
        }