Exemple #1
0
        public void GetAttributesFromTemplate()
        {
            wsUCSYS.IwsSYSClient client = new wsUCSYS.IwsSYSClient();

            try
            {
                Cursor.Current = Cursors.WaitCursor;

                if (AttributeTemplateID == null) AttributeTemplateID = string.Empty;

                if (AttributeTemplateID.Trim() == "*")
                {
                    List<MESParameterInfo> lstParams = new List<MESParameterInfo>();
                    lstParams.Add(new MESParameterInfo()
                    {
                        ParamName = "usedby",
                        ParamValue = WhereUsed.ToString(),
                        ParamType = "string"
                    });

                    lstParams.Add(new MESParameterInfo()
                    {
                        ParamName = "isdefault",
                        ParamValue = MES_Misc.Y.ToString(),
                        ParamType = "string"
                    });

                    tsysattrtplate template = client.GetSingleAttributeTemplate(CurrentContextInfo,lstParams.ToArray<MESParameterInfo>());

                    if (template != null)
                    {
                        AttributeTemplateID = template.attrtplatid;
                    }
                    else
                    {
                        AttributeTemplateID = string.Empty;
                    }

                }

                if (AttributeTemplateID.Trim() != string.Empty)
                {
                    List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                    lstParameters.Add(new MESParameterInfo()
                    {
                        ParamName = "attrtplatid",
                        ParamValue = AttributeTemplateID,
                        ParamType = "string"
                    });

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

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

                SetLayout();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                Cursor.Current = Cursors.Default;
                PublicFunction.CloseWCF(client);
            }
        }
Exemple #2
0
        public void GetAttributesByID()
        {
            wsUCSYS.IwsSYSClient client = new wsUCSYS.IwsSYSClient();

            try
            {
                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
                lstParameters.Add(new MESParameterInfo()
                {
                    ParamName = "attributeid",
                    ParamValue = AttributeID,
                    ParamType = "string"
                });
                DataSet ds = client.GetAttributeRecords(CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>());

                this.grdAttribute.SetDataBinding(ds.Tables[0], "");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                PublicFunction.CloseWCF(client);
            }
        }