Ejemplo n.º 1
0
        private void btn_Getir_Click(object sender, EventArgs e)
        {
            if (txtKoliNo.Text.Trim() == "")
            {
                return;
            }

            try { decimal.Parse(txtKoliNo.Text.Trim()); }
            catch
            {
                MessageBox.Show("Koli No alanına yalnız sayısal değer girebilirsiniz.", "HATA");
                return;
            }


            try
            {
                Cursor.Current = Cursors.WaitCursor;

                WS_Paket.SERVICE       srv      = new KoctasMobil.WS_Paket.SERVICE();
                WS_Paket.ZkmobilReturn ret      = new KoctasMobil.WS_Paket.ZkmobilReturn();
                WS_Paket.Ztoplama2[]   koliList = new KoctasMobil.WS_Paket.Ztoplama2[0];

                WS_Paket.ZktmobilPakCheckKoli         chkKoli     = new KoctasMobil.WS_Paket.ZktmobilPakCheckKoli();
                WS_Paket.ZktmobilPakCheckKoliResponse chkKoliResp = new KoctasMobil.WS_Paket.ZktmobilPakCheckKoliResponse();

                chkKoli.EReturn = ret;
                chkKoli.ItData  = koliList;

                string koliNo = txtKoliNo.Text.Trim().PadLeft(10, '0');
                chkKoli.ImPaketno = koliNo;
                srv.Credentials   = ProgramGlobalData.g_credential;
                srv.Url           = Utility.getWsUrl("zktmobil_paket");

                chkKoliResp = srv.ZktmobilPakCheckKoli(chkKoli);

                if (chkKoliResp.EReturn.RcCode.ToUpper() == "E")
                {
                    txtKoliNo.Text = "";
                    MessageBox.Show(chkKoliResp.EReturn.RcText, "HATA");
                }
                else
                {
                    frm_PaketlemeToplamaDegistir frm = new frm_PaketlemeToplamaDegistir();
                    frm.gecerliKoliMal = chkKoliResp.ItData;
                    frm.paketNo        = koliNo;
                    Cursor.Current     = Cursors.Default;
                    frm.ShowDialog();
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "HATA");
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Ejemplo n.º 2
0
        private void btn_YuklemeEkle_Click(object sender, EventArgs e)
        {
            if (txt_formNo.Text.Trim() == "")
            {
                return;
            }

            try { decimal.Parse(txt_formNo.Text.Trim()); }
            catch
            {
                MessageBox.Show("Koli No alanına yalnız sayısal değer girebilirsiniz.", "HATA");
                return;
            }

            try {
                Cursor.Current = Cursors.WaitCursor;

                WS_Paket.SERVICE       srv = new KoctasMobil.WS_Paket.SERVICE();
                WS_Paket.ZkmobilReturn ret = new KoctasMobil.WS_Paket.ZkmobilReturn();

                WS_Paket.ZktmobilPakCheckKoli         chkKoli     = new KoctasMobil.WS_Paket.ZktmobilPakCheckKoli();
                WS_Paket.ZktmobilPakCheckKoliResponse chkKoliResp = new KoctasMobil.WS_Paket.ZktmobilPakCheckKoliResponse();

                chkKoli.EReturn = ret;

                string koliNo   = txt_formNo.Text.Trim().PadLeft(10, '0');
                bool   listEkle = true;
                chkKoli.ImPaketno = koliNo;
                srv.Credentials   = ProgramGlobalData.g_credential;
                srv.Url           = Utility.getWsUrl("zktmobil_paket");

                chkKoliResp = srv.ZktmobilPakCheckKoli(chkKoli);

                if (chkKoliResp.EReturn.RcCode.ToUpper() == "E")
                {
                    txt_formNo.Text = "";
                    MessageBox.Show(chkKoliResp.EReturn.RcText, "HATA");
                }
                else
                {
                    for (int i = 0; i < lst_Koli.Items.Count; i++)
                    {
                        if (lst_Koli.Items[i].ToString() == koliNo)
                        {
                            listEkle = false;
                        }
                    }

                    if (listEkle)
                    {
                        lst_Koli.Items.Add(koliNo);
                    }

                    txt_formNo.Text = "";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "HATA");
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }