Exemplo n.º 1
0
        private void GetUnpackingData(List<MESParameterInfo> lstParameters)
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try
            {
                baseForm.SetCursor();

                DataSet ds = new DataSet();
                DataSet mainds = client.GetPackingDtlSumRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>());
                DataSet subds = client.GetPackingDtlRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>());
                DataTable maindt = mainds.Tables[0];
                DataTable subdt = subds.Tables[0];
                maindt.TableName = "Main";
                subdt.TableName = "Sub";
                mainds.Tables.Clear();
                subds.Tables.Clear();

                if (maindt != null)
                {
                    ds.Tables.Add(maindt);
                    ds.Tables.Add(subdt);
                    ds.Relations.Add("ps", new DataColumn[] { ds.Tables["Main"].Columns["customerid"], ds.Tables["Main"].Columns["custorderno"], ds.Tables["Main"].Columns["cartonno"] }, new DataColumn[] { ds.Tables["Sub"].Columns["customerid"], ds.Tables["Sub"].Columns["custorderno"], ds.Tables["Sub"].Columns["cartonno"] }, false);
                    this.grdUnpacking.SetDataBinding(ds, "");
                }

                this.ucStatusBar1.ShowText1(UtilCulture.GetString("Msg.R00006") + ": " + maindt.Rows.Count.ToString());

            }
            catch (Exception ex)
            {
                MESMsgBox.ShowError(ExceptionParser.Parse(ex));
            }
            finally
            {
                baseForm.ResetCursor();
                baseForm.CloseWCF(client);
            }
        }