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(); } }
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; } }