Пример #1
0
 public static ValueListItem[] GetValueList_Customer_All()
 {
     List<ValueListItem> lstVL = new List<ValueListItem>();
     wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient();
     try
     {
         List<MESParameterInfo> lstParameters = new List<MESParameterInfo>() { };
         List<tmdlcustomer> lstCustomer = client.GetCustomerList((new BaseForm()).CurrentContextInfo,
             lstParameters.ToArray<MESParameterInfo>()).ToList();
         var q = from p in lstCustomer orderby p.customername ascending select p;
         for (int i = 0; i < q.Count(); i++)
         {
             ValueListItem item = new ValueListItem()
             {
                 DisplayText = q.ElementAt(i).customername,
                 DataValue = q.ElementAt(i).customerid
             };
             lstVL.Add(item);
         }
         return lstVL.ToArray<ValueListItem>();
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
 }
Пример #2
0
        public static void InitCMB_Customer_All_Name(ComboBox cmb)
        {
            cmb.Items.Clear();
            cmb.DisplayMember = "DisplayField";
            cmb.ValueMember = "ValueField";

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

            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                List<tmdlcustomer> lstCustomer = client.GetCustomerList((new BaseForm()).CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).ToList<tmdlcustomer>();
                var q = from p in lstCustomer orderby p.customername ascending select p;
                for (int i = 0; i < q.Count(); i++)
                {
                    cmb.Items.Add(new ValueInfo()
                    {
                        DisplayField = q.ElementAt(i).customername,
                        ValueField = q.ElementAt(i).customername
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }
Пример #3
0
        public static void InitCMB_Customer_All(ComboBox cmb)
        {
            cmb.Items.Clear();
            cmb.DisplayMember = "DisplayField";
            cmb.ValueMember = "ValueField";

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

            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                List<tmdlcustomer> lstCustomer = client.GetCustomerList((new BaseForm()).CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).ToList<tmdlcustomer>();
                for (int i = 0; i < lstCustomer.Count; i++)
                {
                    cmb.Items.Add(new ValueInfo()
                    {
                        DisplayField = lstCustomer[i].customername,
                        ValueField = lstCustomer[i].customerid
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                baseForm.CloseWCF(client);
            }
        }