Exemple #1
0
        public override int GetHashCode()
        {
            int hash = 0;

            if (!string.IsNullOrWhiteSpace(AccessId))
            {
                hash ^= AccessId.GetHashCode();
            }

            if (!string.IsNullOrWhiteSpace(DataSourceName))
            {
                hash ^= DataSourceName.GetHashCode();
            }

            if (!string.IsNullOrWhiteSpace(EntityTypeName))
            {
                hash ^= EntityTypeName.GetHashCode();
            }

            if (!string.IsNullOrWhiteSpace(JobId))
            {
                hash ^= JobId.GetHashCode();
            }

            hash ^= IsActive.GetHashCode();
            hash ^= IsPublic.GetHashCode();
            hash ^= IsStaging.GetHashCode();

            return(hash);
        }
Exemple #2
0
 /// <summary>Snippet for GetDataSource</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetDataSourceResourceNames()
 {
     // Create client
     DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.Create();
     // Initialize request argument(s)
     DataSourceName name = DataSourceName.FromProjectDataSource("[PROJECT]", "[DATA_SOURCE]");
     // Make the request
     DataSource response = dataTransferServiceClient.GetDataSource(name);
 }
Exemple #3
0
        /// <summary>Snippet for CheckValidCredsAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task CheckValidCredsResourceNamesAsync()
        {
            // Create client
            DataTransferServiceClient dataTransferServiceClient = await DataTransferServiceClient.CreateAsync();

            // Initialize request argument(s)
            DataSourceName name = DataSourceName.FromProjectDataSource("[PROJECT]", "[DATA_SOURCE]");
            // Make the request
            CheckValidCredsResponse response = await dataTransferServiceClient.CheckValidCredsAsync(name);
        }
Exemple #4
0
 /// <summary>Snippet for GetDataSource</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetDataSourceRequestObject()
 {
     // Create client
     DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.Create();
     // Initialize request argument(s)
     GetDataSourceRequest request = new GetDataSourceRequest
     {
         DataSourceName = DataSourceName.FromProjectDataSource("[PROJECT]", "[DATA_SOURCE]"),
     };
     // Make the request
     DataSource response = dataTransferServiceClient.GetDataSource(request);
 }
Exemple #5
0
        public List <DataChoiceItem> GetDataSource()
        {
            if (this.DataSourceName == null || DataSourceName.Trim().Length == 0)
            {
                return(null);
            }
            List <DataCondition> conds = new List <DataCondition>();

            if (this.TranData != null)
            {
                for (int i = 0; i < this.TranData.Count; i++)
                {
                    if (this.NeedUpdateData.Items.ContainsKey(TranData[i].ToDataPoint))
                    {
                        string strval = this.NeedUpdateData.Items[this.TranData[i].ToDataPoint].value;
                        if (strval == null || strval.Trim().Length == 0)
                        {
                            continue;
                        }
                        DataCondition cond = new DataCondition();
                        cond.Datapoint = new DataPoint(TranData[i].ToDataPoint);
                        cond.value     = strval;
                        cond.Logic     = ConditionLogic.And;
                        conds.Add(cond);
                    }
                }
            }
            string  msg     = null;
            bool    isextra = false;
            DataSet ds      = WolfInv.Com.WCS_Process.DataSource.InitDataSource(this.DataSourceName, conds, strUid, out msg, ref isextra);

            if (msg != null || ds == null)
            {
                MessageBox.Show(string.Format("控件{0}无法获得数据!错误:{1}", this.Name, msg));
                return(null);
            }
            DataChoice dc = DataChoice.ConvertFromDataSet(ds, ValueField, TextField, true, ComboItemsSplitString);

            if (dc == null)
            {
                MessageBox.Show(string.Format("无法转换数据选择项{0}", this.Name));
                return(null);
            }
            //DataChoice dcc = GlobalShare.GetGlobalChoice(strUid, DataSourceName);
            if (!GlobalShare.UserAppInfos[strUid].DataChoices.ContainsKey(this.DataSourceName))//不断增加新的datachoice
            {
                GlobalShare.UserAppInfos[strUid].DataChoices.Add(this.DataSourceName, dc);
            }
            return(dc.Options);
        }
Exemple #6
0
 private string BuildFullDataSourceName()
 {
     // Some odd data sources (i.e. raster functions) can have XML in the various names
     if (DataSourceName != null && DataSourceName.StartsWith("<Xml") &&
         DataSourceName.Contains("FunctionRasterDatasetName"))
     {
         return("XML Raster Function Defintion");
     }
     //Still protect against other fields with illegal paths
     if (DataSourceName == null || DataSourceName.StartsWith("<"))
     {
         return(null);
     }
     if (WorkspacePath == null || WorkspacePath.StartsWith("<"))
     {
         return(DataSourceName);
     }
     if (Container == null || Container.StartsWith("<"))
     {
         return(Path.Combine(WorkspacePath, DataSourceName));
     }
     return(Path.Combine(WorkspacePath, Container, DataSourceName));
 }
Exemple #7
0
        public List <DataChoiceItem> GetDataSource()
        {
            string     strModel = "runningtime_S_{0}_U_{1}_V_{2}_S_{3}";
            string     strdc    = string.Format(strModel, this.DataSourceName, this.strUid, this.ValueField, this.ComboItemsSplitString);
            DataChoice dc       = null;

            if (GlobalShare.DataChoices.ContainsKey(strdc))//保存默认dc到dc字典中,如果有同样的id+source直接获取
            {
                dc = GlobalShare.DataChoices[strdc];
            }
            else
            {
                if (this.DataSourceName == null || DataSourceName.Trim().Length == 0)
                {
                    return(null);
                }
                List <DataCondition> conds = new List <DataCondition>();
                if (this.TranData != null)
                {
                    for (int i = 0; i < this.TranData.Count; i++)
                    {
                        string checkname = TranData[i].ToDataPoint;
                        string toname    = checkname;
                        if (!this.NeedUpdateData.Items.ContainsKey(checkname))
                        {
                            checkname = TranData[i].FromDataPoint.Name;
                            toname    = TranData[i].ToDataPoint;
                        }
                        if (!this.NeedUpdateData.Items.ContainsKey(checkname))
                        {
                            continue;
                        }
                        string strval = this.NeedUpdateData.Items[checkname].value;
                        if (strval == null || strval.Trim().Length == 0)
                        {
                            continue;
                        }
                        DataCondition cond = new DataCondition();
                        cond.Datapoint = new DataPoint(toname);
                        cond.value     = strval;
                        cond.Logic     = ConditionLogic.And;
                        conds.Add(cond);
                    }
                }
                string  msg     = null;
                bool    isextra = false;
                DataSet ds      = WCS_Process.DataSource.InitDataSource(this.DataSourceName, conds, this.strUid, out msg, ref isextra);
                if (ds == null)
                {
                    MessageBox.Show(string.Format("控件{0}无法获得数据![{1}]", this.Name, msg));
                    return(null);
                }
                dc = DataChoice.ConvertFromDataSet(ds, ValueField, TextField, ComboItemsSplitString);
                if (!GlobalShare.DataChoices.ContainsKey(strdc))
                {
                    GlobalShare.DataChoices.Add(strdc, dc);
                }
            }
            if (dc == null)
            {
                MessageBox.Show(string.Format("无法转换数据选择项{0},这可能是由网络异常引起的,即将退出软件,请重新登录看是否正常!", strdc));


                return(null);
            }
            if (!GlobalShare.DataChoices.ContainsKey(this.DataSourceName))//不断增加新的datachoice
            {
                GlobalShare.DataChoices.Add(this.DataSourceName, dc);
            }
            return(dc.Options);
        }