private void btn_Bol_Click(object sender, EventArgs e) { decimal bolmeMiktari = 0; try { bolmeMiktari = Convert.ToDecimal(txtAdet.Text); } catch { MessageBox.Show("Miktar alanına sayısal bir değer giriniz", "HATA"); Utility.selectText(txtAdet); return; } if (bolmeMiktari <= 1) { MessageBox.Show("Miktar alanına 1'den büyük bir değer giriniz", "HATA"); Utility.selectText(txtAdet); return; } if (MessageBox.Show("Koli bölünmesini onaylıyor musunuz?", "BİLGİ", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { grd_List.Enabled = false; Cursor.Current = Cursors.WaitCursor; try { drKoli.Clear(); WS_Islem.ZKT_WM_WS_ISLEMService srv = new KoctasWM_Project.WS_Islem.ZKT_WM_WS_ISLEMService(); WS_Islem.ZKtWmWsKoliBol chk = new KoctasWM_Project.WS_Islem.ZKtWmWsKoliBol(); WS_Islem.ZKtWmWsKoliBolResponse resp = new KoctasWM_Project.WS_Islem.ZKtWmWsKoliBolResponse(); chk.IvKoliNo = txtKargoKoliNo.Text.Trim(); chk.IvBolmeAdedi = bolmeMiktari.ToString(); srv.Credentials = GlobalData.globalCr; srv.Url = Utility.getWsUrlForWM("zkt_wm_ws_islem"); resp = srv.ZKtWmWsKoliBol(chk); if (resp.EsResponse[0].Msgty.ToString().ToUpper() == "S") { //Donen değerleri tabloya ekle for (int i = 0; i < resp.EtOut.Length; i++) { DataRow row = drKoli.NewRow(); row["koliNo"] = resp.EtOut[i].KoliNo.ToString(); row["koliTipi"] = ""; row["desi"] = ""; row["mesaj"] = resp.EtOut[i].ReturnMessage.ToString(); drKoli.Rows.Add(row); } grd_List.DataSource = null; grd_List.DataSource = drKoli; grd_List.Enabled = true; cmbKoliTipi.Enabled = true; btn_Guncelle.Enabled = true; koliTipiCek(); koliTipiDoldur(); txtKargoKoliNo.Enabled = false; txtAdet.Enabled = false; btn_Bol.Enabled = false; } else { MessageBox.Show(resp.EsResponse[0].Message.ToString(), "HATA"); Utility.selectText(txtKargoKoliNo); } } catch (Exception ex) { MessageBox.Show(ex.Message, "HATA"); } finally { Cursor.Current = Cursors.Default; } } }