コード例 #1
0
        public void Refresh(string rootId)
        {
            var SQL = "select * from roots where root_id={0}";
            var ds  = RepositoryUtils.ExecuteQuery(String.Format(SQL, rootId.SafeStringToSQL()));

            if (ds.Tables[0].Rows.Count == 1)
            {
                var row = ds.Tables[0].Rows[0];

                RootId     = rootId;
                RootPath   = row["root_path"].ToString();
                IsDefault  = Convert.ToInt32(row["is_default"]) == 1 ? true : false;
                LastUpdate = Convert.ToDateTime(row["last_update"]);
            }
        }
コード例 #2
0
        internal static string[] GetDefaultRootId()
        {
            try
            {
                CheckRepositoryFile();
                var ds = RepositoryUtils.ExecuteQuery("select root_id,root_path from roots where is_default=1"); // should be only 1 record

                if (ds.Tables[0].Rows.Count == 1)
                {
                    return(new[] { ds.Tables[0].Rows[0]["root_id"].ToString(), ds.Tables[0].Rows[0]["root_path"].ToString() });
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }