private void BindPage(string brandSysNo) { if (!String.IsNullOrEmpty(brandSysNo)) { _facade = new CategoryFacade(); _sysNo = int.Parse(brandSysNo); _facade.GetCategoryBySysNo(int.Parse(brandSysNo), (obj, args) => { if (args.FaultsHandle()) { return; } if (args.Result == null) { Window.MessageBox.Show("没有获得分类信息.", MessageBoxType.Warning); return; } var vm = args.Result.Convert <CategoryInfo, CategoryVM>(); DataContext = vm; }); } else { _sysNo = 0; DataContext = new CategoryVM(); cmbCategoryStatusList.SelectedIndex = 0; } }
public ArticleController(IMapper mapper, ArticleFacade articleFacade, IConfiguration configuration, CategoryFacade categoryFacade) { _mapper = mapper; _articleFacade = articleFacade; _configuration = configuration; _categoryFacade = categoryFacade; }
public CategoryEditMaintain() { InitializeComponent(); this.Loaded += (sender, e) => { facade = new CategoryFacade(); if (IsEdit) { this.myCategoryConnection.cbCategoryType.IsEnabled = false; btnSave.Visibility = Visibility.Visible; } else { Data = new CategoryVM(); } this.myCategoryConnection.CategoryTypeChanged += myCategoryConnection_CategoryTypeChanged; this.myCategoryConnection.myCategory.LoadCategoryCompleted += (obj, arg) => { if (Data.Category2SysNo == 0) { Data.Category2SysNo = null; Data.Category1SysNo = null; } this.DataContext = Data; if (Data != null) { SetC3CodeControlVisibility(Data.Type); } }; }; }
private void RetrieveData() { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey)) { CategoryFacade facade = new CategoryFacade(uow); CurrentInstances = facade.RetrieveAllCategory(new CategoryConverter()); } }
public void VerifyManualNavigateToCategoriesPage() { CategoryFacade facade = new CategoryFacade(); facade.ManualNavigate(); facade.AssertCategoryPageIsOpen(); }
public void VerifyAddEditFormCreateCategory() { CategoryFacade facade = new CategoryFacade(); Categories category = new Categories("Category", "20"); facade.AddCategory(category); facade.AssertCategoryExist(category); }
private void RetrieveData() { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey)) { CatalogFacade facade = new CatalogFacade(uow); CurrentCatalog = facade.RetrieveOrNewCatalog(InstanceId, new CatalogConverter()); // Retrieve ScheduleEvents of Customer CategoryFacade categoryfacade = new CategoryFacade(uow); CurrentCatalog.CategoryList = categoryfacade.RetrieveCategoryTree(InstanceId, new CategoryConverter()); } }
public List <CategoryModel> GetCategoryList() { var allInfo = CategoryFacade.QueryCategoryInfosForHomePage(); List <CategoryModel> result = new List <CategoryModel>(); ClientType clientType = HeaderHelper.GetClientType(); string subFoler = "h"; if (clientType == ClientType.Android) { if (HeaderHelper.IsAndroidXHigh()) { subFoler = "xh"; } } else { subFoler = "ios"; } string baseUrl = ""; MobileAppConfig config = AppSettings.GetCachedConfig(); if (config != null && config.MobileAppServiceHost != null) { config.MobileAppServiceHost = config.MobileAppServiceHost.Trim(); if (!config.MobileAppServiceHost.EndsWith("/")) { config.MobileAppServiceHost += "/"; } baseUrl = config.MobileAppServiceHost; } foreach (var c1 in allInfo) { var m1 = Transform(c1); //获取一级分类图标 m1.ICon = BuildCatIcon(baseUrl, "c1", subFoler, c1.CategoryID.ToString(), "png");//CatHelper.GetIcon(c1.CategoryID); result.Add(m1); foreach (var c2 in c1.SubCategories) { var m2 = Transform(c2); //获取二级分类图标 m2.ICon = BuildCatIcon(baseUrl, "c2", subFoler, c2.CategoryID.ToString(), "jpg");//CatHelper.GetSubIcon(c1.CategoryID, c2.CategoryID); m1.SubCategories.Add(m2); foreach (var c3 in c2.SubCategories) { var m3 = Transform(c3); m2.SubCategories.Add(m3); } } } return(result); }
public void VerifyAddFormOrderErrorMessages() { CategoryFacade facade = new CategoryFacade(); var path = PathGenerator.AbsoluteRelativeCombine(Paths.DataBindLocation + "CategoryFormOrder.xlsx"); foreach (var sheet in Workbook.Worksheets(path)) { foreach (var row in sheet.Rows) { Categories category = new Categories(row.Cells); facade.AddCategory(category); facade.AssertOrderErrorMessage(category); } } }
private int UpdateSubItemCategories(string parentId) { ItemCategoryFacade localFacade = new ItemCategoryFacade(); localFacade.DeleteItemCategoryByParentId(parentId); CategoryFacade topFacade = new CategoryFacade(varHelper.TOP_AppKey, varHelper.TOP_AppSecret); TOPDataList <ItemCategory> list = topFacade.GetItemCategories(parentId, string.Empty); foreach (ItemCategory category in list) { if (!localFacade.IsItemCategoryExist(category.Id)) { localFacade.AddItemCategory(string.Empty, category.Id, category.ParentId, category.Name, category.IsParent, category.Status, category.SortOrder); } } return(list.Count); }
private void btnSave_Click(object sender, RoutedEventArgs e) { var vm = DataContext as CategoryVM; if (vm == null) { return; } ValidationManager.Validate(ChildLayoutRoot); //vm.CategoryID = vm.CategoryID.Trim(); //if (String.IsNullOrEmpty(vm.CategoryID)) //{ // Window.MessageBox.Show("分类编号不能为空.", MessageBoxType.Warning); // return; //} _facade = new CategoryFacade(); vm.SysNo = _sysNo; if (vm.SysNo == null || vm.SysNo.Value <= 0) { _facade.CreateCategory(vm, (obj, args) => { if (args.FaultsHandle()) { return; } vm.SysNo = args.Result.SysNo; vm.CategoryID = Convert.ToString(args.Result.SysNo); Window.Alert(ResBrandMaintain.Info_SaveSuccessfully); }); } else { //_facade.UpdateCategory(vm, (obj, args) => //{ // if (args.FaultsHandle()) // { // var errorMsg = args.Error.Faults[0].ErrorDescription; // Window.Alert(errorMsg); // return; // } // Window.Alert(ResBrandMaintain.Info_SaveSuccessfully); //}); } }
/// <summary> /// 三级分类-详情 /// </summary> /// <param name="ID"></param> /// <returns></returns> public ActionResult Category3(int ID) { SearchCriteriaModel criteria = new SearchCriteriaModel() { Category3ID = ID, PageSize = 10 }; ProductSearchResultVM pageVM = SearchManager.Search(criteria, HttpContext.Request.QueryString); var allCategories = CategoryFacade.QueryCategoryInfos(); var subCategoryInfo = allCategories.Find(f => f.CategoryType == CategoryType.SubCategory && f.CategoryID == ID); if (subCategoryInfo != null) { ViewBag.Title = subCategoryInfo.CategoryName; } ViewBag.ID = ID; return(View(pageVM)); }
public ActionResult Index() { CategoryFacade categoryFacade = new CategoryFacade(); IndexModel model = new IndexModel(); CategoryLanguage categoryLanguage; foreach (var category in categoryFacade.GetAll((int)CurrentLanguage.LanguageId)) { categoryLanguage = category.CategoryLanguage.FirstOrDefault(); model.Categories.Add(new CategoryModel { CategoryId = category.CategoryId, LanguageId = categoryLanguage.LanguageId, Image = category.Image, Name = categoryLanguage.Name, Description = categoryLanguage.Description }); } model.UserPrincipal = CustomUser; model.CurrentLanguage = CurrentLanguage; return(View(model)); }
public CategoryController(IMapper mapper, CategoryFacade categoryFacade) { _mapper = mapper; _categoryFacade = categoryFacade; }
public ItemsController(ItemFacade ItemFacade, CategoryFacade categoryFacade) { this.ItemFacade = ItemFacade; CategoryFacade = categoryFacade; }
public CategoryController(IOptions <AppSettings> _appSettings, IAuthenticateHelper _authHelper) { appSettings = _appSettings.Value; facade = new CategoryFacade(appSettings.VotingPlatformConnectionString); authHelper = _authHelper; }
public CategoryController( CategoryFacade categoryFacade) { this.categoryFacade = categoryFacade; }
public void VerifyNestedCategoriesAreCreated() { CategoryFacade facade = new CategoryFacade(); Categories category = new Categories("Category", "15"); var listOfNestedCategories = new List<Categories>() { new Categories("NestedOne", "2"), new Categories("NestedTwo", "4"), new Categories("NestedThree", "3") }; facade.AddCategory(category); facade.AddNestedCategory(category, listOfNestedCategories); facade.GoToHierarchyPage(category, listOfNestedCategories); facade.AssertCategoryHierachy(category, listOfNestedCategories); }
public void VerifyGridSort() { CategoryFacade facade = new CategoryFacade(); facade.SortGrid(); }
public Category() { facade = new CategoryFacade(connectionString); request = new CategoryRequest(); }
public void VerifyEditFormNameErrorMessagesDataBind() { CategoryFacade facade = new CategoryFacade(); Categories category = new Categories("Category", "20"); var path = PathGenerator.AbsoluteRelativeCombine(Paths.DataBindLocation + "CategoryFormName.xlsx"); facade.AddCategory(category); foreach (var sheet in Workbook.Worksheets(path)) { foreach (var row in sheet.Rows) { Categories editCategory = new Categories(row.Cells); facade.EditCategory(category, editCategory); facade.AssertNameErrorMessage(editCategory); } } }
public void VerifyManualNavigateFromCategoryPageToAdmin() { CategoryFacade facade = new CategoryFacade(); facade.GoBackToAdminPage(); this.adminFacade.VerifyPageIsOpen(); }