Exemplo n.º 1
0
 private DataTable GetReasonCodeDataTable()
 {
     wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
     try
     {
         List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
         lstParameters.Add(new MESParameterInfo()
         {
             ParamName = "reasoncategory",
             ParamValue = "%" + MES_ReasonCategory.Repair.ToString() + "%",
             ParamType = "string"
         });
         return client.GetReasonCodeRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).Tables[0];
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
 }
Exemplo n.º 2
0
        private void GetReasonCode()
        {
            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                lstParameters.Add(new MESParameterInfo()
                {
                    ParamName = "reasoncategory",
                    ParamValue = "%" + MES_ReasonCategory.Repair.ToString() + "%",
                    ParamType = "string"
                });
                DataTable dt = client.GetReasonCodeRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).Tables[0];
                DataView dv = dt.DefaultView;
                dv.RowFilter = "reasoncategory LIKE '%全检%'";
                dv.Sort = "reasoncategorydesc asc";
                dt = dv.ToTable();

                int categoryIndex = 0;
                string beforecategory = "";

                if (dt != null)
                {
                    dt.Columns.Add(new DataColumn("ck", typeof(string)));
                    dt.Columns.Add(new DataColumn("pairqty", typeof(int)));
                    dt.Columns.Add(new DataColumn("remark", typeof(string)));
                    dt.Columns.Add(new DataColumn("categoryindex", typeof(int)));

                    foreach (DataRow row in dt.Rows)
                    {
                        if (!row["reasoncategorydesc"].ToString().Equals(beforecategory))
                        {
                            beforecategory = row["reasoncategorydesc"].ToString();
                            categoryIndex++;
                        }

                        row["ck"] = "N";
                        row["pairqty"] = 0;
                        row["remark"] = "";
                        row["categoryindex"] = categoryIndex;
                    }
                    this.grdDetail.SetDataBinding(dt, "");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
Exemplo n.º 3
0
 private DataTable GetReasonCode()
 {
     wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
     DataTable dt = null;
     try
     {
         dt = client.GetReasonCodeRecords(baseForm.CurrentContextInfo, (new List<MESParameterInfo>()).ToArray<MESParameterInfo>()).Tables[0];
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
     return dt;
 }
Exemplo n.º 4
0
        private void GetData(List<MESParameterInfo> lstParameters)
        {
            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
            try
            {
                baseForm.SetCursor();

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

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

                if (this.grdQuery.Rows.Count < 1)
                {
                    this.ucToolbar1.SetToolbarWithoutRows();
                }
                else
                {
                    this.ucToolbar1.SetToolbarWithRows();
                }

                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);
            }
        }