Exemplo n.º 1
0
 private void DeleteShipPlan()
 {
     if (this.grdQuery.ActiveRow != null)
     {
         Dictionary<string, object> dir = new Dictionary<string, object>();
         dir.Add(UtilCulture.GetString("Label.R02057"), this.grdQuery.ActiveRow.Cells["shippingplanno"].Value.ToString());
         DialogResult result = baseForm.CreateMessageBox(Public_MessageBox.Question,
                                                         MessageBoxButtons.OKCancel,
                                                         UtilCulture.GetString("Msg.R00004"),
                                                         dir);
         if (result == DialogResult.OK)
         {
             baseForm.SetCursor();
             wsINP.IwsINPClient client = new wsINP.IwsINPClient();
             try
             {
                 if (client.HasShipByPlanNo(baseForm.CurrentContextInfo, this.grdQuery.ActiveRow.Cells["shippingplanno"].Value.ToString()))
                 {
                     baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00095"));
                 }
                 else
                 {
                     client.DoDeleteShipping(baseForm.CurrentContextInfo, this.grdQuery.ActiveRow.Cells["shippingsysid"].Value.ToString());
                     RefreshGrid();
                     baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00003"));
                 }
             }
             catch (Exception ex)
             {
                 MESMsgBox.ShowError(ExceptionParser.Parse(ex));
             }
             finally
             {
                 baseForm.ResetCursor();
                 baseForm.CloseWCF(client);
             }
         }
     }
 }