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

                DataSet ds = client.GetWipRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>());

                this.grdQuery.SetDataBinding(ds.Tables[0], "");

                this.ucStatusBar1.ShowText1(UtilCulture.GetString("Msg.R00006") + ": " + ds.Tables[0].Rows.Count.ToString());
            }
            catch (Exception ex)
            {
                MESMsgBox.ShowError(ExceptionParser.Parse(ex));
            }
            finally
            {
                baseForm.ResetCursor();
                baseForm.CloseWCF(client);
            }
        }
Esempio n. 2
0
        private void GetBadWip(string customerid)
        {
            wsINP.IwsINPClient client = new wsINP.IwsINPClient();
            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                lstParameters.Add(new MESParameterInfo()
                {
                    ParamName = "customerid",
                    ParamValue = customerid,
                    ParamType = "string"
                });
                lstParameters.Add(new MESParameterInfo()
                {
                    ParamName = "status",
                    ParamValue = MES_WIPStatus.BAD.ToString(),
                    ParamType = "string"
                });
                DataTable dt = client.GetWipRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).Tables[0];
                if (dt != null)
                {
                    dt.Columns.Add(new DataColumn("ck", typeof(string)));
                    dt.Columns.Add(new DataColumn("returnqty", typeof(int)));
                    foreach (DataRow row in dt.Rows)
                    {
                        row["ck"] = MES_Misc.N.ToString();
                        row["returnqty"] = 0;
                    }

                    if (UpdateMode == Public_UpdateMode.Update)
                    {
                        foreach (DataRow dtlRow in returndtlDt.Rows)
                        {
                            var q = from p in dt.AsEnumerable()
                                    where p["custorderno"].ToString() == dtlRow["custorderno"].ToString()
                                    && p["styleno"].ToString() == dtlRow["styleno"].ToString()
                                    && p["color"].ToString() == dtlRow["color"].ToString()
                                    && p["size"].ToString() == dtlRow["size"].ToString()
                                    && p["checktype"].ToString() == dtlRow["checktype"].ToString()
                                    select p;
                            if (q.Count() > 0)
                            {
                                DataRow row = q.ElementAt(0);
                                row["ck"] = MES_Misc.Y.ToString();
                                row["pairqty"] = Convert.ToDecimal(row["pairqty"]) +  Convert.ToDecimal(dtlRow["pairqty"]);
                                row["returnqty"] = dtlRow["pairqty"];
                            }
                            else
                            {
                                DataRow row = dt.Rows.Add();
                                row["ck"] = MES_Misc.Y.ToString();
                                row["custorderno"] = dtlRow["custorderno"];
                                row["styleno"] = dtlRow["styleno"];
                                row["color"] = dtlRow["color"];
                                row["size"] = dtlRow["size"];
                                row["checktype"] = dtlRow["checktype"];
                                row["pairqty"] =dtlRow["pairqty"];
                                row["returnqty"] = dtlRow["pairqty"];
                            }
                        }
                    }

                    this.grdDetail.SetDataBinding(dt, "");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }