示例#1
0
        public static ValueListItem[] GetValueList_ReasonCode(MES_ReasonCategory reasonCategory)
        {
            List<ValueListItem> lstVL = new List<ValueListItem>();
            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                lstParameters.Add(new MESParameterInfo() {
                    ParamName="reasoncategory",
                    ParamValue=reasonCategory.ToString()
                });
                List<tmdlreasoncode> lstReasonCode = client.GetReasonCodeList((new BaseForm()).CurrentContextInfo,
                    lstParameters.ToArray<MESParameterInfo>()).ToList();

                var q = from p in lstReasonCode orderby p.reasoncodedesc ascending select p;
                for (int i = 0; i < q.Count(); i++)
                {
                    ValueListItem item = new ValueListItem()
                    {
                        DisplayText = q.ElementAt(i).reasoncodedesc,
                        DataValue = q.ElementAt(i).reasoncode
                    };
                    lstVL.Add(item);
                }
                return lstVL.ToArray<ValueListItem>();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
示例#2
0
        public static void InitCMB_ReasonCode_ByCategoryStep(ComboBox cmd,
            MES_ReasonCategory reasonCategory, string stepsysid)
        {
            cmd.Items.Clear();
            cmd.DisplayMember = "DisplayField";
            cmd.ValueMember = "ValueField";

            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();

            try
            {
                List<tmdlreasoncode> lstReasonCode = client.GetReasonCodeList_ByCategoryStep(
                    (new BaseForm()).CurrentContextInfo, reasonCategory.ToString(), stepsysid).ToList<tmdlreasoncode>();

                var q = from p in lstReasonCode orderby p.reasoncodedesc ascending select p;
                for (int i = 0; i < q.Count(); i++)
                {
                    cmd.Items.Add(new ValueInfo()
                    {
                        DisplayField = q.ElementAt(i).reasoncodedesc,
                        ValueField = q.ElementAt(i).reasoncode
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
示例#3
0
        public static void InitCMB_ReasonCode_ByCategory(ComboBox cmd, MES_ReasonCategory reasonCategory)
        {
            cmd.Items.Clear();
            cmd.DisplayMember = "DisplayField";
            cmd.ValueMember = "ValueField";

            wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();

            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                lstParameters.Add(new MESParameterInfo()
                {
                    ParamName = "reasoncategory",
                    ParamValue = reasonCategory.ToString()
                });

                List<tmdlreasoncode> lstReasonCode = client.GetReasonCodeList((new BaseForm()).CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).ToList<tmdlreasoncode>();
                for (int i = 0; i < lstReasonCode.Count; i++)
                {
                    cmd.Items.Add(new ValueInfo()
                    {
                        DisplayField = lstReasonCode[i].reasoncodedesc,
                        ValueField = lstReasonCode[i].reasoncode
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }