private void btn_ekle_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; WS_Satis.service SRV = new KoctasMobil.WS_Satis.service(); WS_Satis.ZktmobilItemsGet items = new KoctasMobil.WS_Satis.ZktmobilItemsGet(); WS_Satis.ZktmobilItemsGetResponse itemsresponse = new KoctasMobil.WS_Satis.ZktmobilItemsGetResponse(); WS_Satis.ZktmobilSItemslist[] list = new KoctasMobil.WS_Satis.ZktmobilSItemslist[1]; try { SRV.Url = Utility.getWsUrl("zktmobil_satis"); SRV.Credentials = ProgramGlobalData.g_credential; items.IVbeln = txt_siparisNo.Text.Trim(); items.TiKalemler = list; itemsresponse = SRV.ZktmobilItemsGet(items); if (itemsresponse.TiKalemler.Length == 0) { MessageBox.Show("Siparişin kalemleri bulunamadı, girdiğiniz sipariş numarasını kontrol ediniz.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); return; } grd_Siparisler.DataSource = null; DataRow row = dt_sip.NewRow(); row["SIPARISNO"] = txt_siparisNo.Text.Trim(); dt_sip.Rows.Add(row); grd_Siparisler.DataSource = dt_sip; itemsresponse.TiKalemler.CopyTo(list_all, listlenght); listlenght += itemsresponse.TiKalemler.Length; txt_siparisNo.Text = ""; } catch (Exception ex) { MessageBox.Show(ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); } finally { Cursor.Current = Cursors.Default; } }
private void btnGetir_Click(object sender, EventArgs e) { try { Cursor.Current = Cursors.WaitCursor; WS_Satis.service SRV = new WS_Satis.service(); SRV.Url = Utility.getWsUrl("zktmobil_satis"); SRV.Credentials = ProgramGlobalData.g_credential; WS_Satis.ZktmobilItemsGet items = new KoctasMobil.WS_Satis.ZktmobilItemsGet(); items.IVbeln = txtBelgeNo.Text.Trim(); items.TiKalemler = new KoctasMobil.WS_Satis.ZktmobilSItemslist[0]; items.TiOrders = new KoctasMobil.WS_Satis.ZktmobilOrders[0]; WS_Satis.ZktmobilItemsGetResponse response = SRV.ZktmobilItemsGet(items); Cursor.Current = Cursors.Default; if (response.EReturn.RcCode == "E") { MessageBox.Show(response.EReturn.RcText, "HATA!", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); return; } datatocopy copydata = new datatocopy(); copydata.musteri = response.TiOrders[0].Name2; copydata.semt = response.TiOrders[0].Name3; copydata.not = response.TiOrders[0].Notes; copydata.siparistipi = response.TiOrders[0].Stipi; copydata.evtel = response.TiOrders[0].Telf1; copydata.ceptel = response.TiOrders[0].Telf3; copydata.istel = response.TiOrders[0].Telf2; frm_NormalSiparisYarat yarat = null; switch (_operation) { case op.kopyala: yarat = new frm_NormalSiparisYarat(response.TiKalemler, "", frm_NormalSiparisYarat.Title.kopyala); yarat.Copyingdata = copydata; if (rdb_Transferli.Checked) { yarat.Transferli = "X"; } else if (rdb_Normal.Checked) { yarat.Transferli = ""; } break; case op.degistir: yarat = new frm_NormalSiparisYarat(response.TiKalemler, txtBelgeNo.Text.Trim(), frm_NormalSiparisYarat.Title.degistir); yarat.Copyingdata = copydata; break; default: break; } DialogResult dr = DialogResult.None; if (response.TiKalemler.Length > 0) { dr = yarat.ShowDialog(); } if (dr == DialogResult.OK) { this.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "HATA!", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); } finally { Cursor.Current = Cursors.Default; } }