コード例 #1
0
ファイル: frmXUnpacking.cs プロジェクト: jimidzj/Inspect
        private void DoXUnpacking()
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try
            {
                baseForm.SetCursor();
                grdQuery.UpdateData();
                List<string[]> lstunpacking = new List<string[]>();
                foreach (UltraGridRow row in this.grdQuery.Rows)
                {
                    if (row.Cells["ck"].Value.ToString().Equals(MES_Misc.Y.ToString()))
                    {
                        if (row.Cells["workgroup"].Value.ToString().Equals(""))
                        {
                            throw new Exception(UtilCulture.GetString("Msg.R01020", UtilCulture.GetString("Label.R01016")));
                        }
                        else
                        {
                            lstunpacking.Add(new string[] { row.Cells["customerid"].Value.ToString(), row.Cells["custorderno"].Value.ToString(), row.Cells["cartonno"].Value.ToString(), row.Cells["workgroup"].Value.ToString() });
                        }
                    }
                }
                if (lstunpacking.Count == 0)
                {
                    throw new Exception(UtilCulture.GetString("Msg.R01018"));
                }

                client.DoXUnpacking(baseForm.CurrentContextInfo,lstunpacking.ToArray());
                baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00028"));
                RefreshGrid();
            }
            catch (Exception ex)
            {
                baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, ex.Message);
            }
            finally
            {
                baseForm.ResetCursor();
                baseForm.CloseWCF(client);
            }
        }