Inheritance: System.Web.UI.Page
示例#1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id;
         hashCode = (hashCode * 397) ^ (CategoryName != null ? CategoryName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Picture != null ? Picture.GetHashCode() : 0);
         return(hashCode);
     }
 }
示例#2
0
        private bool ValidCategory()
        {
            if (string.IsNullOrEmpty(CategoryName))
            {
                return(false);
            }

            var parts = CategoryName.Split(".");

            return(string.Equals(parts[0], "Historian"));
        }
        public DomainCategory AddNew(string categoryPath)
        {
            NameValidator.ValidateCategoryPath(categoryPath);
            var categoryName = new CategoryName(categoryPath);

            if (this.ContainsKey(categoryName.ParentPath) == false)
            {
                this.AddNew(categoryName.ParentPath);
            }
            return(this.BaseAddNew(categoryName.Name, categoryName.ParentPath, null, null));
        }
示例#4
0
        public void Restore(Authentication authentication, Domain domain)
        {
            authentication.Sign();
            var dataBase     = this.Context.CremaHost.DataBases[domain.DataBaseID];
            var categoryName = CategoryName.Create(dataBase.Name, domain.DomainInfo.ItemType);
            var category     = this.Context.Categories.Prepare(categoryName);

            domain.Category   = category;
            domain.Dispatcher = new CremaDispatcher(domain);
            domain.Dispatcher.InvokeAsync(() => this.InvokeDomainCreatedEvent(authentication, domain));
        }
示例#5
0
        public UserCategory AddNew(Authentication authentication, string name, string parentPath)
        {
            this.Dispatcher.VerifyAccess();
            var categoryName = new CategoryName(parentPath, name);
            var result       = this.Context.Service.NewUserCategory(categoryName);

            result.Validate(authentication);
            var category = this.BaseAddNew(name, parentPath, authentication);

            this.InvokeCategoriesCreatedEvent(authentication, new UserCategory[] { category });
            return(category);
        }
示例#6
0
        private static CategoryName GetCategory(LogEvent logEvent, Database db)
        {
            CategoryName category = CategoryName.OneWhere(cc => cc.Value == logEvent.Category, db);

            if (category == null)
            {
                category       = new CategoryName();
                category.Value = logEvent.Category;
                category.Save(db);
            }
            return(category);
        }
示例#7
0
 public async Task AddAsync(Authentication authentication, Domain domain, DataBase dataBase)
 {
     await this.Dispatcher.InvokeAsync(() =>
     {
         var categoryName = CategoryName.Create(dataBase.Name, domain.DomainInfo.ItemType);
         var category     = this.Categories.Prepare(categoryName);
         domain.Category  = category;
         domain.Context   = this;
         domain.Logger    = new DomainLogger(this.Serializer, domain);
         this.Domains.InvokeDomainCreatedEvent(authentication, new Domain[] { domain });
     });
 }
示例#8
0
        public override void OnValidateRename(IAuthentication authentication, object target, string oldPath, string newPath)
        {
            base.OnValidateRename(authentication, target, oldPath, newPath);
            if (this.templateList.Any() == true)
            {
                throw new CremaException("새로운 테이블을 생성중일때는 이름을 변경할 수 없습니다.");
            }

            var categoryName = new CategoryName(Regex.Replace(this.Path, $"^{oldPath}", newPath));

            this.Context.ValidateCategoryPath(categoryName);
        }
示例#9
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id;
         hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Repetitions.GetHashCode();
         hashCode = (hashCode * 397) ^ (CategoryName != null ? CategoryName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (UnitType != null ? UnitType.GetHashCode() : 0);
         return(hashCode);
     }
 }
示例#10
0
 //重置
 protected void Reset_Click(object sender, EventArgs e)
 {
     try
     {
         CategoryName.Reset();
         CategoryContent.Reset();
     }
     catch (Exception ex)
     {
         publicmethod.SaveError(ex, this.Request);
     }
 }
示例#11
0
        public void EnterDetails()
        {
            CategoryName.SendKeys("NEW Category" + RandomString(20));
            var Section = driver.FindElement(By.Name("Section"));
            //create select element object
            var selectElement = new SelectElement(Section);

            //select by value
            selectElement.SelectByValue("Sales");
            // select by text
            selectElement.SelectByText("Technical");
        }
        public async Task CategoryLockRenameTestAsync()
        {
            var newName      = RandomUtility.NextIdentifier();
            var parentPath   = category.Parent.Path;
            var categoryPath = new CategoryName(parentPath, newName);
            await category.LockAsync(authentication, string.Empty);

            await category.RenameAsync(authentication, newName);

            Assert.AreEqual(categoryPath, category.Path);
            Assert.AreEqual(newName, category.Name);
        }
示例#13
0
        public override void OnValidateMove(IAuthentication authentication, object target, string oldPath, string newPath)
        {
            base.OnValidateMove(authentication, target, oldPath, newPath);
            if (this.templateList.Any() == true)
            {
                throw new InvalidOperationException(Resources.Exception_CannotMoveOnCreateType);
            }
            this.ValidateUsingTables(authentication);
            var categoryName = new CategoryName(Regex.Replace(this.Path, $"^{oldPath}", newPath));

            this.Context.ValidateCategoryPath(categoryName);
        }
示例#14
0
 public bool Equals(CategoryNode C)
 {
     if (ReferenceEquals(null, C))
     {
         return(false);
     }
     if (ReferenceEquals(this, C))
     {
         return(true);
     }
     return(CategoryName.Equals(C.CategoryName));
 }
示例#15
0
 public static MvcHtmlString CategoryLink(this HtmlHelper help, CategoryName category)
 {
     return(help.ActionLink(category.Name, "Category", "Blognew",
                            new
     {
         category = category.UrlName
     },
                            new
     {
         title = string.Format("See All Posts in {0}", category.Name)
     }));
 }
示例#16
0
 public void SetCategoryTitle(string cat)
 {
     try
     {
         CategoryName enumerable = (CategoryName)System.Enum.Parse(typeof(CategoryName), cat);
         titleText.text = ArabicFixer.Fix(categoryNamesArabic[(int)enumerable]);
         //Foo(enumerable); //Now you have your enum, do whatever you want.
     }
     catch (System.Exception)
     {
         Debug.LogErrorFormat("Parse: Can't convert {0} to int, please check the spell.", cat);
     }
 }
示例#17
0
        public async Task <ResultBase> NewUserCategoryAsync(Guid authenticationToken, string categoryPath)
        {
            var authentication = this.peer[authenticationToken];
            var result         = new ResultBase();
            var categoryName   = new CategoryName(categoryPath);
            var parent         = await this.GetCategoryAsync(categoryName.ParentPath);

            var category = await parent.AddNewCategoryAsync(authentication, categoryName.Name);

            result.TaskID        = category.Guid;
            result.SignatureDate = authentication.SignatureDate;
            return(result);
        }
示例#18
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (SystemId != null ? SystemId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StoreName != null ? StoreName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CategoryName != null ? CategoryName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ StartDate.GetHashCode();
         hashCode = (hashCode * 397) ^ EndDate.GetHashCode();
         hashCode = (hashCode * 397) ^ DiscountAmount;
         return(hashCode);
     }
 }
示例#19
0
 public void Log <TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func <TState, Exception, string> formatter)
 {
     if (IsEnabled(logLevel))
     {
         lock (_lockObj)
         {
             Console.ForegroundColor = LogLevelColors[logLevel];
             Console.Write($"[{CategoryName.Split('.').Last()}] ");
             Console.ForegroundColor = ConsoleColor.Gray;
             Console.WriteLine(formatter(state, exception));
         }
     }
 }
示例#20
0
        public TypeCategory AddNew(Authentication authentication, string name, string parentPath)
        {
            this.DataBase.ValidateBeginInDataBase(authentication);
            var categoryName = new CategoryName(parentPath, name);
            var result       = this.Service.NewTypeCategory(categoryName);

            result.Validate(authentication);
            var category = this.Prepare(categoryName.Path);
            var items    = EnumerableUtility.One(category).ToArray();

            this.InvokeCategoriesCreatedEvent(authentication, items);
            return(category);
        }
示例#21
0
        public string GetListPhoto()
        {
            if (string.IsNullOrEmpty(Photo))
            {
                return(string.Empty);
            }

            string[] splitedPhotos = Photo.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            string   extension;
            string   name = GetName(splitedPhotos[0], out extension);

            return(string.Format("{0}/{1}{2}", CategoryName.ToLower(), name, extension));
        }
        public async Task Indexer_Arg0_Nonexistent_FailTestAsync()
        {
            var categoryFilter = new UserCategoryFilter()
            {
                HasParent = true
            };
            var category = await categoryFilter.GetUserCategoryAsync(app);

            var name = await category.GenerateNewCategoryNameAsync();

            var categoryName = new CategoryName(category.Path, name);
            await userCategoryCollection.Dispatcher.InvokeAsync(() => userCategoryCollection[categoryName]);
        }
        public async Task <LocalizedCategoryBM> GetAsync(CategoryIdBM id, string languageCode)
        {
            Category category = await context.Category.SingleAsync(x => x.Id == id.Value);

            CategoryName name = await context.CategoryName.SingleAsync(x => x.CategoryId == id.Value && x.LanguageCode == languageCode);

            return(new LocalizedCategoryBM(
                       categoryId: category.Id,
                       languageCode: name.LanguageCode,
                       localizedName: name.LocalizedName,
                       parentCategoryId: category.ParentId
                       ));
        }
示例#24
0
        public override bool Equals(object obj)
        {
            if (obj != null)
            {
                Category c = obj as Category;
                if (CategoryName.Equals(c.CategoryName))
                {
                    return(true);
                }
            }

            return(false);
        }
示例#25
0
        public ActionResult Create([Bind(Include = "Category_Name")] CategoryName categoryName)
        {
            if (ModelState.IsValid)
            {
                if (categoryName.CategoryNameValidator(categoryName.Category_Name))
                {
                    db.CategoryNames.Add(categoryName);
                    db.SaveChanges();
                }
                return(RedirectToAction("Index"));
            }

            return(View(categoryName));
        }
示例#26
0
 public CategoryNameEntity(CategoryName CategoryName, params object[] args) : base(CategoryName)
 {
     foreach (object arg in args)
     {
         if (arg is Category Category)
         {
             CategoryEntity = new CategoryEntity(Category);
         }
         if (arg is Language Language)
         {
             LanguageEntity = new LanguageEntity(Language);
         }
     }
 }
示例#27
0
 // Helper Methods
 public void GoToGame(string cat)
 {
     try
     {
         CategoryName enumerable = (CategoryName)System.Enum.Parse(typeof(CategoryName), cat);
         GameData.GAME_CATEGORY = enumerable;
         SceneManager.LoadScene(1);
         //Foo(enumerable); //Now you have your enum, do whatever you want.
     }
     catch (System.Exception)
     {
         Debug.LogErrorFormat("Parse: Can't convert {0} to enum, please check the spell.", cat);
     }
 }
示例#28
0
 public void InsertCategoryName(CategoryName categoryName)
 {
     if (categoryName != null)
     {
         if (categoryName.EntityState != EntityState.Detached)
         {
             this.ObjectContext.ObjectStateManager.ChangeObjectState(categoryName, EntityState.Added);
         }
         else
         {
             this.ObjectContext.CategoryNames.AddObject(categoryName);
         }
     }
 }
示例#29
0
        public UserCategoryDeleteArguments(UserCategory userCategory)
        {
            var items      = EnumerableUtility.One(userCategory).ToArray();
            var oldPaths   = items.Select(item => item.Path).ToArray();
            var path       = userCategory.Path;
            var targetName = new CategoryName(path);

            var(userPaths, lockPaths) = GetPathForData(userCategory, targetName);
            this.CategoryPath         = userCategory.Path;
            this.Items     = items;
            this.OldPaths  = oldPaths;
            this.UserPaths = userPaths;
            this.LockPaths = lockPaths;
        }
示例#30
0
        // GET: CategoryName/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CategoryName categoryName = db.CategoryNames.Find(id);

            if (categoryName == null)
            {
                return(HttpNotFound());
            }
            return(View(categoryName));
        }