private string getMatnr(string MatnrEan11)
        {
            Cursor.Current = Cursors.WaitCursor;
            WS_Kontrol.service srv = new KoctasMobil.WS_Kontrol.service();
            srv.Url         = Utility.getWsUrl("zktmobil_kontrol");
            srv.Credentials = ProgramGlobalData.g_credential;

            WS_Kontrol.ZktmobilChckMtnr mtnr = new KoctasMobil.WS_Kontrol.ZktmobilChckMtnr();
            mtnr.IMatnr = MatnrEan11;
            WS_Kontrol.ZktmobilChckMtnrResponse matresp = new KoctasMobil.WS_Kontrol.ZktmobilChckMtnrResponse();

            try
            {
                matresp = srv.ZktmobilChckMtnr(mtnr);

                if (matresp.EReturn.RcCode == "E")
                {
                    throw new Exception(matresp.EReturn.RcText);
                }

                return(matresp.EMatnr);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
                return("");
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
        private string depoYerindenUretimYeriBul(string depoYeri)
        {
            string uretimYeri = "";

            WS_Kontrol.service    srv  = new KoctasMobil.WS_Kontrol.service();
            WS_Kontrol.ZktStore[] itab = new KoctasMobil.WS_Kontrol.ZktStore[10];

            WS_Kontrol.ZktmobilChkStorageLocation         chkStore = new KoctasMobil.WS_Kontrol.ZktmobilChkStorageLocation();
            WS_Kontrol.ZktmobilChkStorageLocationResponse resp     = new KoctasMobil.WS_Kontrol.ZktmobilChkStorageLocationResponse();

            chkStore.Itab   = itab;
            srv.Credentials = ProgramGlobalData.g_credential;
            srv.Url         = Utility.getWsUrl("zktmobil_kontrol");
            resp            = srv.ZktmobilChkStorageLocation(chkStore);

            if (resp.Itab.Length > 0)
            {
                for (int i = 0; i < resp.Itab.Length; i++)
                {
                    if (depoYeri == resp.Itab[i].Lgort.ToString())
                    {
                        uretimYeri = resp.Itab[i].Werks.ToString();
                        break;
                    }
                }
            }

            return(uretimYeri);
        }
        private void depoYeriDoldur()
        {
            WS_Kontrol.service    srv  = new KoctasMobil.WS_Kontrol.service();
            WS_Kontrol.ZktStore[] itab = new KoctasMobil.WS_Kontrol.ZktStore[10];

            WS_Kontrol.ZktmobilChkStorageLocation         chkStore = new KoctasMobil.WS_Kontrol.ZktmobilChkStorageLocation();
            WS_Kontrol.ZktmobilChkStorageLocationResponse resp     = new KoctasMobil.WS_Kontrol.ZktmobilChkStorageLocationResponse();

            chkStore.Itab   = itab;
            srv.Credentials = ProgramGlobalData.g_credential;
            srv.Url         = Utility.getWsUrl("zktmobil_kontrol");
            resp            = srv.ZktmobilChkStorageLocation(chkStore);

            if (resp.Itab.Length > 0)
            {
                for (int i = 0; i < resp.Itab.Length; i++)
                {
                    cmbDepoYeri.Items.Add(resp.Itab[i].Lgort.ToString());
                }
            }
            else
            {
                cmbDepoYeri.Items.Add("0001");
            }

            cmbDepoYeri.SelectedIndex = 0;
        }
Ejemplo n.º 4
0
        private void btn_getir_Click(object sender)
        {
            Cursor.Current = Cursors.WaitCursor;
            WS_Kontrol.service                  srv     = new KoctasMobil.WS_Kontrol.service();
            WS_Kontrol.ZktmobilChckMtnr         mtnr    = new KoctasMobil.WS_Kontrol.ZktmobilChckMtnr();
            WS_Kontrol.ZktmobilChckMtnrResponse matresp = new KoctasMobil.WS_Kontrol.ZktmobilChckMtnrResponse();

            try
            {
                if (sender == txt_Barkod)
                {
                    mtnr.IMatnr = txt_Barkod.Text.Trim();
                }
                else
                {
                    if (!String.IsNullOrEmpty(txt_Barkod.Text))
                    {
                        mtnr.IMatnr = txt_Barkod.Text.Trim();
                    }
                    else
                    {
                        return;
                    }
                }
                srv.Url         = Utility.getWsUrl("zktmobil_kontrol");
                srv.Credentials = ProgramGlobalData.g_credential;

                matresp = srv.ZktmobilChckMtnr(mtnr);

                if (matresp.EReturn.RcCode == "E")
                {
                    throw new Exception(matresp.EReturn.RcText);
                }

                txt_Barkod.Text = matresp.EEan11;
                lblMatnr.Text   = matresp.EMatnr;
                txt_maktx.Text  = matresp.EMaktx;
                txtAdt.Text     = matresp.EMeins;
                if (matresp.EMaktx != "")
                {
                    matChecked = true;
                    txtAciklama.Focus();
                }
                else
                {
                    txt_Barkod.Focus();
                }
            }
            catch (Exception ex)
            {
                txt_Barkod.Text = "";
                txt_maktx.Text  = "";
                MessageBox.Show(ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
        private void btn_Getir_Click(object sender, EventArgs e)
        {
            if (txtAdres.Text.Trim() == "")
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;

            try
            {
                WS_Kontrol.service       srv = new KoctasMobil.WS_Kontrol.service();
                WS_Kontrol.ZkmobilReturn ret = new KoctasMobil.WS_Kontrol.ZkmobilReturn();

                WS_Kontrol.ZktmobilChckAdr         chkAddres = new KoctasMobil.WS_Kontrol.ZktmobilChckAdr();
                WS_Kontrol.ZktmobilChckAdrResponse resp      = new KoctasMobil.WS_Kontrol.ZktmobilChckAdrResponse();

                chkAddres.EReturn = ret;

                adres = txtAdres.Text.Trim().ToUpper();
                chkAddres.IAddress = adres;


                srv.Credentials = ProgramGlobalData.g_credential;
                srv.Url         = Utility.getWsUrl("zktmobil_kontrol");
                resp            = srv.ZktmobilChckAdr(chkAddres);



                if (resp.EReturn.RcCode.ToUpper() == "E")
                {
                    //Eger adres tanımlı değil ise
                    txtAdres.Text = "";
                    MessageBox.Show(resp.EReturn.RcText, "HATA");
                }
                else
                {
                    txt_malzemeNo.Enabled = true;
                    txt_malzemeNo.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "HATA");
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
        private void btn_Sayim_Click(object sender, EventArgs e)
        {
            WS_Kontrol.ZktmobilCheckProductResponse resp = null;
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                WS_Kontrol.service srv = new KoctasMobil.WS_Kontrol.service();
                srv.Url         = Utility.getWsUrl("zktmobil_kontrol");
                srv.Credentials = ProgramGlobalData.g_credential;
                WS_Kontrol.ZktmobilCheckProduct product = new KoctasMobil.WS_Kontrol.ZktmobilCheckProduct();
                resp              = new KoctasMobil.WS_Kontrol.ZktmobilCheckProductResponse();
                resp.EReturn      = new KoctasMobil.WS_Kontrol.ZkmobilReturn();
                product.IMatnr    = txt_Matnr.Text.Trim();
                product.ItDepostk = new KoctasMobil.WS_Kontrol.ZktmobilDepostk[0];
                resp              = srv.ZktmobilCheckProduct(product);
                if (String.IsNullOrEmpty(resp.EMatnr))
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "HATA!", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
                return;
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
            frm_UrunKontrol2 frm = new frm_UrunKontrol2();

            frm.resp = resp;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                this.DialogResult = DialogResult.OK;
                this.malzemeNo    = txt_Matnr.Text;

                txt_Matnr.Text = "";
                txt_Matnr.Focus();

                this.Close();
            }
            else
            {
                txt_Matnr.Text = "";
                txt_Matnr.Focus();
            }
        }
Ejemplo n.º 7
0
        private void btn_Kaydet_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            WS_Kontrol.service                 srv      = new KoctasMobil.WS_Kontrol.service();
            WS_Kontrol.ZktmobilSaveGap         GAP      = new KoctasMobil.WS_Kontrol.ZktmobilSaveGap();
            WS_Kontrol.ZktmobilSaveGapResponse Response = new WS_Kontrol.ZktmobilSaveGapResponse();

            try
            {
                srv.Url         = Utility.getWsUrl("zktmobil_kontrol");
                srv.Credentials = ProgramGlobalData.g_credential;

                WS_Kontrol.ZitGap[] items = new WS_Kontrol.ZitGap[dtGAP.Rows.Count];
                for (int i = 0; i < dtGAP.Rows.Count; i++)
                {
                    WS_Kontrol.ZitGap item = new WS_Kontrol.ZitGap();

                    item.Matnr = dtGAP.Rows[i]["matnr"].ToString();
                    item.Nlpla = this.Nlpla;  //RAf Adresi

                    items[i] = item;
                }
                GAP.ItGap = items;


                Response = srv.ZktmobilSaveGap(GAP);

                //if (matresp.EReturn.RcCode == "E")
                //{
                //    throw new Exception(matresp.EReturn.RcText);
                //}

                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
        private void checkMalzeme()
        {
            Cursor.Current = Cursors.WaitCursor;
            WS_Kontrol.service                  SRV     = new KoctasMobil.WS_Kontrol.service();
            WS_Kontrol.ZktmobilChckMtnr         mtnr    = new KoctasMobil.WS_Kontrol.ZktmobilChckMtnr();
            WS_Kontrol.ZktmobilChckMtnrResponse matresp = new KoctasMobil.WS_Kontrol.ZktmobilChckMtnrResponse();
            try
            {
                SRV.Url         = Utility.getWsUrl("zktmobil_kontrol");
                SRV.Credentials = ProgramGlobalData.g_credential;

                if (String.IsNullOrEmpty(txt_malzemeno.Text))
                {
                    return;
                }
                mtnr.IMatnr = txt_malzemeno.Text;

                matresp = SRV.ZktmobilChckMtnr(mtnr);
                if (!String.IsNullOrEmpty(matresp.EMaktx.Trim()))
                {
                    txt_miktar.Focus();
                    txt_birim.Text            = matresp.EMeins;
                    txt_malzemeno.Text        = matresp.EMatnr;
                    txt_maktx.Text            = matresp.EMaktx;
                    cmbIadeTipi.SelectedValue = Utility.getIadeTip(mtnr.ITip);
                    malzemeChecked            = true;
                }
                else
                {
                    txt_malzemeno.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "HATA!", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
                txt_malzemeno.Focus();
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
        private void txt_malzemeNo_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (txt_malzemeNo.Text == "")
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (e.KeyChar == (char)13)
                {
                    // Malzeme alanına girilen kod barkod yada malzeme no olmasına
                    // göre webservice inden malzeme numarası çekiliyor.
                    WS_Kontrol.service       srv = new KoctasMobil.WS_Kontrol.service();
                    WS_Kontrol.ZkmobilReturn ret = new KoctasMobil.WS_Kontrol.ZkmobilReturn();

                    WS_Kontrol.ZktmobilChckMtnr         chkMtnr     = new KoctasMobil.WS_Kontrol.ZktmobilChckMtnr();
                    WS_Kontrol.ZktmobilChckMtnrResponse chkMtnrResp = new KoctasMobil.WS_Kontrol.ZktmobilChckMtnrResponse();

                    chkMtnr.EReturn = ret;
                    chkMtnr.IMatnr  = txt_malzemeNo.Text.Trim();

                    srv.Credentials = ProgramGlobalData.g_credential;
                    srv.Url         = Utility.getWsUrl("zktmobil_kontrol");
                    chkMtnrResp     = srv.ZktmobilChckMtnr(chkMtnr);

                    if (chkMtnrResp.EReturn.RcCode.ToUpper() == "E")
                    {
                        //Eger siparis tanımlı değilse
                        txt_malzemeNo.Text = "";
                        MessageBox.Show(chkMtnrResp.EReturn.RcText, "HATA");
                        return;
                    }
                    else
                    {
                        txt_malzemeNo.Text = malzemeNo = chkMtnrResp.EMatnr.ToString();
                        txt_maktx.Text     = malzemeTanim = chkMtnrResp.EMaktx.ToString();
                        txt_birim.Text     = malzemeBirim = chkMtnrResp.EMeins.ToString();
                        txt_miktar.Enabled = true;
                        txt_miktar.Focus();
                    }



                    // Girilen artikel no siparise ait malzeme
                    // listesinde kontrol ediliyor
                    #region

                    /*
                     * try
                     * {
                     *  ekleMal.Clear();
                     *  for (int i = 0; i < index; i++)
                     *  {
                     *      if ((malList[i].Matnr == txt_malzemeNo.Text.PadLeft(18, '0')) && (malList[i].Ebeln == txt_siparisNo.Text.Trim()))
                     *      {
                     *
                     *          txt_miktar.Enabled = true;
                     *          txt_birim.Enabled = true;
                     *          txt_maktx.Enabled = true;
                     *
                     *          txt_maktx.Text = malTanim = malList[i].Maktx.ToString();
                     *          txt_birim.Text = malBirim = malList[i].Meins.ToString();
                     *
                     *          string[] strMal = malList[i].Menge.Split('.');
                     *          malAdet += Convert.ToInt32(strMal[0].ToString());
                     *          malNo = txt_malzemeNo.Text;
                     *
                     *
                     *          txt_miktar.Focus();
                     *
                     *          //Eklenmek istenen malzeme tabloya aktarılıyor
                     *          DataRow row = ekleMal.NewRow();
                     *          row["Ebeln"] = malList[i].Ebeln.ToString();
                     *          row["Matnr"] = malList[i].Matnr.ToString();
                     *          row["Meins"] = malList[i].Meins.ToString();
                     *          row["Menge"] = Convert.ToInt32(strMal[0].ToString());
                     *          row["Ebelp"] = malList[i].Ebelp.ToString();
                     *          ekleMal.Rows.Add(row);
                     *
                     *          malKontrol = 1;
                     *      }
                     *  }
                     *
                     *  //MessageBox.Show(malAdet.ToString(), "TEST");
                     *
                     *  if (malKontrol == 0)
                     *  {
                     *      MessageBox.Show("Girilen Ürün Sipariş Listesinde Bulunamadı", "HATA");
                     *      txt_malzemeNo.Text = "";
                     *  }
                     * }
                     * catch (Exception ex)
                     * {
                     *  MessageBox.Show(ex.Message.ToString(), "HATA");
                     *  txt_malzemeNo.Text = "";
                     * }*/
                    #endregion
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "HATA");
                return;
            } finally {
                Cursor.Current = Cursors.Default;
            }
        }
Ejemplo n.º 10
0
        DataTable dtstokR = new DataTable(); //bölge market stok

        private void frm_UrunKontrol2_Load(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Maximized;
            try
            {
                if (resp != null)
                {
                    txt_ayliksatis.Text      = resp.EMenge.ToString("N2") + " " + resp.EMeins;
                    txt_Barkod.Text          = resp.EEan11;
                    txt_fiyat.Text           = resp.EPrice.ToString("N2");
                    txt_ParoKartliTutar.Text = resp.EParoTotal.ToString("N2");
                    txt_KonsinyeBirim.Text   = resp.EKmeins;
                    txt_KonsinyeMiktar.Text  = resp.EKmenge.ToString("N2");
                    txt_maktx.Text           = resp.EMaktx;
                    txt_Malgrubu1.Text       = resp.EMatkl;
                    txt_Malgrubu2.Text       = resp.EWgbez;
                    txt_malzdurum1.Text      = resp.EStatus;
                    txt_malzdurum2.Text      = resp.EDescr;
                    txt_matnr.Text           = resp.EMatnr;
                    txt_Satici1.Text         = resp.ELifnr;
                    txt_Satici2.Text         = resp.EName1;
                    txt_SayiciTel.Text       = resp.ETelf;
                    grd_acikSip.DataSource   = null;

                    dtstok.Columns.Add("werks");
                    dtstok.Columns.Add("lgort");
                    dtstok.Columns.Add("lgobe");
                    dtstok.Columns.Add("menge");
                    dtstok.Columns.Add("meins");

                    for (int i = 0; i < resp.ItDepostk.Length; i++)
                    {
                        DataRow row = dtstok.NewRow();
                        row["werks"] = resp.ItDepostk[i].Werks;
                        row["lgort"] = resp.ItDepostk[i].Lgort;
                        row["lgobe"] = resp.ItDepostk[i].Lgobe;
                        row["meins"] = resp.ItDepostk[i].Meins;
                        row["menge"] = resp.ItDepostk[i].Menge;
                        dtstok.Rows.Add(row);
                    }
                    grd_depostok.DataSource = dtstok;

                    WS_Kontrol.ZktmobilRegionStock         reg   = new KoctasMobil.WS_Kontrol.ZktmobilRegionStock();
                    WS_Kontrol.ZktmobilRegionStockResponse respR = new KoctasMobil.WS_Kontrol.ZktmobilRegionStockResponse();
                    reg.ItBolgstk = new KoctasMobil.WS_Kontrol.ZktmobilDepostk[0];
                    try
                    {
                        WS_Kontrol.service srv = new KoctasMobil.WS_Kontrol.service();
                        srv.Url         = Utility.getWsUrl("zktmobil_kontrol");
                        srv.Credentials = ProgramGlobalData.g_credential;
                        reg.IMatnr      = txt_matnr.Text.Trim();
                        respR           = srv.ZktmobilRegionStock(reg);

                        dtstokR.Columns.Add("werks");
                        dtstokR.Columns.Add("lgort");
                        dtstokR.Columns.Add("lgobe");
                        dtstokR.Columns.Add("menge");
                        dtstokR.Columns.Add("meins");

                        for (int i = 0; i < respR.ItBolgstk.Length; i++)
                        {
                            DataRow row = dtstokR.NewRow();
                            row["werks"] = respR.ItBolgstk[i].Werks;
                            row["lgort"] = respR.ItBolgstk[i].Lgort;
                            row["lgobe"] = respR.ItBolgstk[i].Lgobe;
                            row["meins"] = respR.ItBolgstk[i].Meins;
                            row["menge"] = respR.ItBolgstk[i].Menge;
                            dtstokR.Rows.Add(row);
                        }
                        grd_StokR.DataSource = dtstokR;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, "HATA!", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Conversion error: " + ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
            }
        }
Ejemplo n.º 11
0
        private void pictureButton1_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            DataTable dt_sip = new DataTable();

            dt_sip.Columns.Add("ebeln");
            dt_sip.Columns.Add("bedat");
            dt_sip.Columns.Add("menge");
            dt_sip.Columns.Add("meins");
            dt_sip.Columns.Add("ear");

            WS_Kontrol.service                  srv     = new KoctasMobil.WS_Kontrol.service();
            WS_Kontrol.ZktmobilGetOpnPo         po      = new KoctasMobil.WS_Kontrol.ZktmobilGetOpnPo();
            WS_Kontrol.ZktmobilGetOpnPoResponse resp    = new KoctasMobil.WS_Kontrol.ZktmobilGetOpnPoResponse();
            WS_Kontrol.ZktmobilChckMtnr         mtnr    = new KoctasMobil.WS_Kontrol.ZktmobilChckMtnr();
            WS_Kontrol.ZktmobilChckMtnrResponse matresp = new KoctasMobil.WS_Kontrol.ZktmobilChckMtnrResponse();

            try
            {
                if (!String.IsNullOrEmpty(txt_Barkod.Text))
                {
                    po.IMatnr = txt_Barkod.Text.Trim();
                }
                else if (!String.IsNullOrEmpty(txt_matnr.Text))
                {
                    po.IMatnr = txt_matnr.Text.Trim();
                }
                else
                {
                    return;
                }

                srv.Url         = Utility.getWsUrl("zktmobil_kontrol");
                srv.Credentials = ProgramGlobalData.g_credential;

                mtnr.IMatnr = po.IMatnr;

                matresp = srv.ZktmobilChckMtnr(mtnr);
                if (String.IsNullOrEmpty(matresp.EMaktx.Trim()))
                {
                    dt_sip.Clear();
                    grd_acikSip.DataSource = dt_sip;
                    return;
                }
                po.IMatnr  = matresp.EMatnr;
                po.ItOpnpo = new KoctasMobil.WS_Kontrol.ZktmobilOpnPo[0];

                resp = srv.ZktmobilGetOpnPo(po);

                if (resp.ItOpnpo.Length == 0)
                {
                    MessageBox.Show("Ürüne ait açık sipariş bulunamadı.");
                    dt_sip.Clear();
                    grd_acikSip.DataSource = dt_sip;
                    return;
                }
                foreach (WS_Kontrol.ZktmobilOpnPo opn in resp.ItOpnpo)
                {
                    DataRow row = dt_sip.NewRow();
                    row["ebeln"] = opn.EEbeln;
                    row["bedat"] = Convert.ToDateTime(opn.EBedat).ToString("dd/MM/yyyy");
                    row["menge"] = opn.EMenge;
                    row["meins"] = opn.EMeins;
                    if (opn.EAr == "X")
                    {
                        row["ear"] = opn.EAr;
                    }
                    else
                    {
                        row["ear"] = "";
                    }

                    dt_sip.Rows.Add(row);
                }
                grd_acikSip.DataSource = dt_sip;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
        private void txt_malzemeNo_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (txt_malzemeNo.Text == "")
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (e.KeyChar == (char)13)
                {
                    // Malzeme alanına girilen kod barkod yada malzeme no olmasına
                    // göre webservice inden malzeme numarası çekiliyor.
                    WS_Kontrol.service       srv = new KoctasMobil.WS_Kontrol.service();
                    WS_Kontrol.ZkmobilReturn ret = new KoctasMobil.WS_Kontrol.ZkmobilReturn();

                    WS_Kontrol.ZktmobilChckMtnr         chkMtnr     = new KoctasMobil.WS_Kontrol.ZktmobilChckMtnr();
                    WS_Kontrol.ZktmobilChckMtnrResponse chkMtnrResp = new KoctasMobil.WS_Kontrol.ZktmobilChckMtnrResponse();

                    chkMtnr.EReturn = ret;
                    chkMtnr.IMatnr  = txt_malzemeNo.Text.Trim();

                    srv.Credentials = ProgramGlobalData.g_credential;
                    srv.Url         = Utility.getWsUrl("zktmobil_kontrol");
                    chkMtnrResp     = srv.ZktmobilChckMtnr(chkMtnr);

                    if (chkMtnrResp.EReturn.RcCode.ToUpper() == "E")
                    {
                        //Eger siparis tanımlı değilse
                        txt_malzemeNo.Text = "";
                        MessageBox.Show(chkMtnrResp.EReturn.RcText, "HATA");
                        return;
                    }
                    else
                    {
                        //Malzemenin adreslemedeki adedi bulunuyor
                        for (int i = 0; i < drMal.Rows.Count; i++)
                        {
                            if (drMal.Rows[i]["Matnr"].ToString() == chkMtnrResp.EMatnr.ToString())
                            {
                                malzemeAdet = Convert.ToDecimal(drMal.Rows[i]["Menge"].ToString());
                            }
                        }


                        txt_malzemeNo.Text = malzemeNo = chkMtnrResp.EMatnr.ToString();
                        txt_maktx.Text     = malzemeTanim = chkMtnrResp.EMaktx.ToString();
                        txt_birim.Text     = malzemeBirim = chkMtnrResp.EMeins.ToString();
                        txt_miktar.Enabled = true;
                        txt_miktar.Text    = malzemeAdet.ToString();
                        txt_miktar.Focus();
                        txt_miktar.SelectAll();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "HATA");
                return;
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
        private void btn_Getir_Click(object sender, EventArgs e)
        {
            if (txtKaynakAdres.Text.Trim() == "")
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;

            try
            {
                WS_Kontrol.service         srv       = new KoctasMobil.WS_Kontrol.service();
                WS_Kontrol.ZmbSendToAdrs[] zmbAddres = new KoctasMobil.WS_Kontrol.ZmbSendToAdrs[1];

                WS_Kontrol.ZktmobilGetAdressContent         chkAddres = new KoctasMobil.WS_Kontrol.ZktmobilGetAdressContent();
                WS_Kontrol.ZktmobilGetAdressContentResponse resp      = new KoctasMobil.WS_Kontrol.ZktmobilGetAdressContentResponse();

                chkAddres.ZmbSendToAdrs = zmbAddres;

                kaynakAdres       = txtKaynakAdres.Text.Trim().ToUpper();
                chkAddres.ImNlpla = kaynakAdres;


                srv.Credentials = ProgramGlobalData.g_credential;
                srv.Url         = Utility.getWsUrl("zktmobil_kontrol");
                resp            = srv.ZktmobilGetAdressContent(chkAddres);



                if (resp.ZmbSendToAdrs.Length <= 0)
                {
                    //Eger adres listesi boş ise
                    txtKaynakAdres.Text = "";
                    grd_mal.DataSource  = null;
                    MessageBox.Show("Kaynak adres içeriğinde malzeme bulunamadı", "HATA");
                }
                else
                {
                    //grd_mal listesi dolduruluyor
                    drMal.Clear();
                    for (int i = 0; i < resp.ZmbSendToAdrs.Length; i++)
                    {
                        DataRow row = drMal.NewRow();
                        row["Matnr"] = resp.ZmbSendToAdrs[i].Matnr.ToString().TrimStart('0');
                        row["Menge"] = resp.ZmbSendToAdrs[i].Menge.ToString();
                        row["Meins"] = resp.ZmbSendToAdrs[i].Meins.ToString();
                        row["Nlpla"] = resp.ZmbSendToAdrs[i].Nlpla.ToString();
                        drMal.Rows.Add(row);
                    }

                    grd_mal.DataSource = null;
                    grd_mal.DataSource = drMal;

                    txt_malzemeNo.Enabled = true;
                    txt_miktar.Enabled    = true;
                    txt_malzemeNo.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "HATA");
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Ejemplo n.º 14
0
        private void btn_Getir_Click(object sender, EventArgs e)
        {
            if (txt_malzemeNo.Text == "")
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                // Malzeme alanına girilen kod barkod yada malzeme no olmasına
                // göre webservice inden malzeme numarası çekiliyor.
                WS_Kontrol.service       srv = new KoctasMobil.WS_Kontrol.service();
                WS_Kontrol.ZkmobilReturn ret = new KoctasMobil.WS_Kontrol.ZkmobilReturn();

                WS_Kontrol.ZktmobilChckMtnr         chkMtnr     = new KoctasMobil.WS_Kontrol.ZktmobilChckMtnr();
                WS_Kontrol.ZktmobilChckMtnrResponse chkMtnrResp = new KoctasMobil.WS_Kontrol.ZktmobilChckMtnrResponse();

                chkMtnr.EReturn = ret;
                chkMtnr.IMatnr  = txt_malzemeNo.Text.Trim();

                srv.Credentials = ProgramGlobalData.g_credential;
                srv.Url         = Utility.getWsUrl("zktmobil_kontrol");
                chkMtnrResp     = srv.ZktmobilChckMtnr(chkMtnr);

                if (chkMtnrResp.EReturn.RcCode.ToUpper() == "E")
                {
                    //Eger siparis tanımlı değilse
                    txt_malzemeNo.Text = "";
                    MessageBox.Show(chkMtnrResp.EReturn.RcText, "HATA");
                    return;
                }
                else
                {
                    txt_malzemeNo.Text = malzemeNo = chkMtnrResp.EMatnr.ToString();
                    txt_maktx.Text     = malzemeTanim = chkMtnrResp.EMaktx.ToString();
                    depoYeri           = cmbDepoYeri.SelectedItem.ToString();

                    //Malzemenin adresleme bilgileri cekiliyor...
                    WS_Kontrol.ZmbMalzemeAdres[] zmbAdres = new KoctasMobil.WS_Kontrol.ZmbMalzemeAdres[1];

                    WS_Kontrol.ZktmobilMalzemeAdrsMiktar         malAdresMiktar = new KoctasMobil.WS_Kontrol.ZktmobilMalzemeAdrsMiktar();
                    WS_Kontrol.ZktmobilMalzemeAdrsMiktarResponse resp           = new KoctasMobil.WS_Kontrol.ZktmobilMalzemeAdrsMiktarResponse();

                    malAdresMiktar.Itab    = zmbAdres;
                    malAdresMiktar.ImMatnr = malzemeNo;
                    malAdresMiktar.ImLgort = depoYeri;

                    srv.Credentials = ProgramGlobalData.g_credential;
                    srv.Url         = Utility.getWsUrl("zktmobil_kontrol");
                    resp            = srv.ZktmobilMalzemeAdrsMiktar(malAdresMiktar);

                    if (resp.Itab.Length <= 0)
                    {
                        //Eger adres listesi boş ise
                        grd_mal.DataSource = null;
                        MessageBox.Show("Belirtilen ürüne ait adresleme bulunamadı", "HATA");
                    }
                    else
                    {
                        //grd_mal listesi dolduruluyor
                        drMal.Clear();
                        for (int i = 0; i < resp.Itab.Length; i++)
                        {
                            DataRow row = drMal.NewRow();
                            row["Matnr"] = malzemeNo;
                            row["Lgort"] = depoYeri;
                            row["Menge"] = resp.Itab[i].Menge.ToString();
                            row["Meins"] = resp.Itab[i].Meins.ToString();
                            row["Nlpla"] = resp.Itab[i].Lgpla.ToString();
                            drMal.Rows.Add(row);
                        }

                        grd_mal.DataSource = null;
                        grd_mal.DataSource = drMal;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "HATA");
                return;
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Ejemplo n.º 15
0
        private void checkMalzeme()
        {
            Cursor.Current = Cursors.WaitCursor;
            WS_Kontrol.service                  SRV     = new KoctasMobil.WS_Kontrol.service();
            WS_Kontrol.ZktmobilChckMtnr         mtnr    = new KoctasMobil.WS_Kontrol.ZktmobilChckMtnr();
            WS_Kontrol.ZktmobilChckMtnrResponse matresp = new KoctasMobil.WS_Kontrol.ZktmobilChckMtnrResponse();
            try
            {
                SRV.Url         = Utility.getWsUrl("zktmobil_kontrol");
                SRV.Credentials = ProgramGlobalData.g_credential;

                if (String.IsNullOrEmpty(txt_malzemeno.Text))
                {
                    return;
                }
                mtnr.IMatnr = txt_malzemeno.Text;

                mtnr.ITip = this.iadeTuru.ToString();

                matresp = SRV.ZktmobilChckMtnr(mtnr);
                if (!String.IsNullOrEmpty(matresp.EMaktx.Trim()))
                {
                    if (matresp.EDurum.ToString() == "X")
                    {
                        /*
                         * 27.03.2012 - farklı satıcı kontrolü çıkartıldı, by brksnmz...
                         * 18.07.2012 - Sadece Mal Kabulden İade seçeneği ile geldiğinde bu kontrol aktif olacak şekilde yeniden revize edildi., by brksnmz via ulass.
                         *
                         *
                         */

                        //  14.01.2019 Mehmet Keskin via Ümit Buzol
                        //if (this.iadeTuru.ToString() == "M")
                        //{
                        //    if (((dt_mal.Rows.Count >= 1)) && (saticiKodu != matresp.ELifnr.ToString()))
                        //    {
                        //        MessageBox.Show("Farklı bir satıcıya ait ürün ekleyemezsiniz.", "HATA");
                        //        malzemeChecked = false;
                        //        return;
                        //    }
                        //}

                        txt_miktar.Focus();
                        txt_birim.Text     = matresp.EMeins;
                        txt_malzemeno.Text = matresp.EMatnr;
                        txt_maktx.Text     = matresp.EMaktx;
                        _saticiKodu        = matresp.ELifnr.ToString();
                        _tanim             = matresp.ETanim.ToString();


                        //Iade turu ayıplı iade ise tanım bilgisi ekrana basiliyor
                        if (this.iadeTuru.ToString() == "B")
                        {
                            if (_tanim.Trim() != "")
                            {
                                MessageBox.Show(_tanim.ToString(), "İADE STATÜSÜ");
                            }
                        }
                        malzemeChecked = true;
                    }
                    else
                    {
                        MessageBox.Show("İade statü bilgisi yoktur.", "HATA!", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
                        txt_malzemeno.Text = "";
                        txt_malzemeno.Focus();
                    }
                }
                else
                {
                    txt_malzemeno.Text = "";
                    txt_malzemeno.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "HATA!", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
                txt_malzemeno.Focus();
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }