public void forCancel() { string URL = "/api/inv/item_request/cancel/" + selectedID; Remarks remarkss = new Remarks(); remarkss.ShowDialog(); if (Remarks.isSubmit) { string remarks = Remarks.rem; JObject jObjectBody = new JObject(); jObjectBody.Add("remarks", remarks); apiPUT(jObjectBody, URL); } }
public void forCancel() { if (this.Text.Equals("Received Items") || this.Text.Equals("Transfer Items")) { Remarks remarkss = new Remarks(); remarkss.ShowDialog(); string remarks = Remarks.rem; if (Remarks.isSubmit) { DialogResult dialogResult = MessageBox.Show("Are you sure you want to cancel?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialogResult == DialogResult.Yes) { string type = this.Text.Equals("Received Items") ? "recv" : "trfr"; string sResponse = transferc.cancelTransfer(selectedID, remarks, type); JObject jObjectResponse = JObject.Parse(sResponse); string msg = ""; foreach (var x in jObjectResponse) { if (x.Key.Equals("message")) { msg = x.Value.ToString(); } } if (!string.IsNullOrEmpty(msg)) { MessageBox.Show(msg, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); isSubmit = true; this.Dispose(); } } } } else if (this.Text == "Pullout Items") { DialogResult dialogResult = MessageBox.Show("Are you sure you want to confirm?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialogResult == DialogResult.Yes) { JObject jObjectBody = new JObject(); string URL = "/api/pullout/confirm/" + selectedID; apiPUT(jObjectBody, URL); } } }