private void AutoButton_Click(object sender, RoutedEventArgs e) { var ud = _UserDevice; if (ud == null) { return; } var description = Attributes.GetDescription(_MappedTo); var form = new MessageBoxWindow(); var buttons = MessageBoxButton.YesNo; var text = string.Format("Do you want to fill {0} settings automatically?", description); if (ud.Device == null && !TestDeviceHelper.ProductGuid.Equals(ud.ProductGuid)) { text = string.Format("Device is off-line. Please connect device to fill {0} settings automatically.", description); buttons = MessageBoxButton.OK; } var result = form.ShowDialog(text, "Fill Controller Settings", buttons, MessageBoxImage.Question); if (result != MessageBoxResult.Yes) { return; } var ps = AutoMapHelper.GetAutoPreset(ud); _PadSetting.Load(ps); }
public bool EditSubCategory(SubCategoryViewModel model) { pub_SubCategoryEntity entity = AutoMapHelper.ToEntity <SubCategoryViewModel, pub_SubCategoryEntity>(model); if (entity.Id == 0) { entity.SubCategoryId = IDHelper.Create("S"); categoryRepository.InsertSubCategory(entity); } else { categoryRepository.UpdateSubCategory(entity); } return(true); }
public bool EditArticle(ArticleViewModel model) { ArticleEntity entity = AutoMapHelper.ToEntity <ArticleViewModel, ArticleEntity>(model); if (entity.Id == 0) { entity.ArticleId = IDHelper.Create("A"); articleRepository.InsertArticle(entity); } else { var last = articleRepository.GetArticleById(entity.Id); entity.CreateTime = last.CreateTime; entity.ArticleId = last.ArticleId; articleRepository.UpdateArticle(entity); } return(true); }
/// <inheritdoc/> public NOPInput ConvertInput(RecentQuota source) => AutoMapHelper.Map <NOPInput>(source);
public List <SubCategoryViewModel> GetSubCategoryByCategoryId(string categoryId) { var result = categoryRepository.GetSubCategoryByCategoryId(categoryId); return(AutoMapHelper.ToList <pub_SubCategoryEntity, SubCategoryViewModel>(result)); }
public List <CategoryViewModel> GetCategory() { var result = categoryRepository.GetCategory(); return(AutoMapHelper.ToList <pub_CategoryEntity, CategoryViewModel>(result)); }
public ListCategoryViewModel GetListCategoryById(string id, string subid) { var result = categoryRepository.GetListCategoryById(id, subid); return(AutoMapHelper.ToEntity <ListCategoryDto, ListCategoryViewModel>(result)); }
public List <ArticleDtoViewModel> GetLatestArticle() { var result = articleRepository.GetLatestArticle(); return(AutoMapHelper.ToList <ArticleDto, ArticleDtoViewModel>(result)); }
public int InsertComment(CommentViewModel model) { ArticleCommentEntity entity = AutoMapHelper.ToEntity <CommentViewModel, ArticleCommentEntity>(model); return(articleRepository.InsertComment(entity)); }
public List <CommentViewModel> GetCommentByArticleId(string ArticleId) { var result = articleRepository.GetCommentByArticleId(ArticleId); return(AutoMapHelper.ToList <ArticleCommentEntity, CommentViewModel>(result)); }
public List <ArticleDtoViewModel> GetArticleDtoBySubCategoryId(string categoryId, string subCategoryId) { var result = articleRepository.GetArticleDtoBySubCategoryId(categoryId, subCategoryId); return(AutoMapHelper.ToList <ArticleDto, ArticleDtoViewModel>(result)); }
public ArticleViewModel GetArticleByArticleId(string articleId) { var result = articleRepository.GetArticleByArticleId(articleId); return(AutoMapHelper.ToEntity <ArticleEntity, ArticleViewModel>(result)); }
public List <ArticleViewModel> GetArticleBySubCategoryId(string subCategoryId) { var result = articleRepository.GetArticleBySubCategoryId(subCategoryId); return(AutoMapHelper.ToList <ArticleEntity, ArticleViewModel>(result)); }