Exemple #1
0
        public ClassifiedBranch QueryGetBranch(string className, long id, string name)
        {
            try
            {
                if (null == className)
                {
                    className = string.Empty;
                }

                if (null == name)
                {
                    name = string.Empty;
                }

                var branch = new ClassifiedBranch()
                {
                    Class = className,
                    ID    = id,
                    Name  = name
                };

                string strKey = branch.ToString();

                return(this.Branches.GetOrAdd(strKey, branch));
            }
            catch
            {
                throw;
            }
        }
Exemple #2
0
        public ClassifiedBranch AddBranch(string className, long id, string name)
        {
            if (null == className)
            {
                className = string.Empty;
            }

            if (null == name)
            {
                name = string.Empty;
            }

            var branch = new ClassifiedBranch()
            {
                Class = className,
                ID    = id,
                Name  = name
            };

            this.Branches.AddOrUpdate(branch.ToString(), branch, (k, v) => { return(branch); });

            return(branch);
        }