private void btn_SatisIade_Click(object sender, EventArgs e)
 {
     try
     {
         Cursor.Current = Cursors.WaitCursor;
         WS_Satis.service              SRV      = new KoctasMobil.WS_Satis.service();
         WS_Satis.ZktmobilIade         iade     = new KoctasMobil.WS_Satis.ZktmobilIade();
         WS_Satis.ZktmobilIadeResponse response = new KoctasMobil.WS_Satis.ZktmobilIadeResponse();
         SRV.Url         = Utility.getWsUrl("zktmobil_satis");
         SRV.Credentials = ProgramGlobalData.g_credential;
         iade.TeList     = _items;
         iade.IVbeln     = _items[0].Vbeln;
         response        = SRV.ZktmobilIade(iade);
         Cursor.Current  = Cursors.Default;
         if (response.EReturn.RcCode == "S")
         {
             this.DialogResult = DialogResult.OK;
         }
         else
         {
             throw new Exception(response.EReturn.RcText);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
     }
 }
Пример #2
0
        private void btn_kaydet_Click(object sender, EventArgs e)
        {
            if (_dt_urun.Rows.Count == 0)
            {
                return;
            }
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                WS_Satis.service              SRV      = new KoctasMobil.WS_Satis.service();
                WS_Satis.ZktmobilIade         iade     = new KoctasMobil.WS_Satis.ZktmobilIade();
                WS_Satis.ZktmobilIadeResponse response = new KoctasMobil.WS_Satis.ZktmobilIadeResponse();
                SRV.Url         = Utility.getWsUrl("zktmobil_satis");
                SRV.Credentials = ProgramGlobalData.g_credential;
                iade.TeList     = new KoctasMobil.WS_Satis.ZktmobilSIadeItems[_dt_urun.Rows.Count];
                int i = 0;

                foreach (DataRow row in _dt_urun.Rows)
                {
                    iade.TeList[i]            = new KoctasMobil.WS_Satis.ZktmobilSIadeItems();
                    iade.TeList[i].Matnr      = row["MATNR"].ToString();
                    iade.TeList[i].Meins      = row["MEINS"].ToString();
                    iade.TeList[i].Sel        = "X";
                    iade.TeList[i].Menge      = Convert.ToDecimal(row["MENGE"].ToString());
                    iade.TeList[i].CancelDate = DateTime.Now.ToString("yyyy-MM-dd");
                    switch (row["IADE"].ToString())
                    {
                    case "S":
                        iade.TeList[i].S = "X";
                        break;

                    case "R":
                        iade.TeList[i].R = "X";
                        break;

                    case "T":
                        iade.TeList[i].T = "X";
                        break;
                    }
                    i++;
                }
                response       = SRV.ZktmobilIade(iade);
                Cursor.Current = Cursors.Default;
                if (response.EReturn.RcCode == "S")
                {
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    throw new Exception(response.EReturn.RcText);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
            }
        }