Exemplo n.º 1
0
        public ResponseView Add(TextbookView textbook, string loginName)
        {
            return new ResponseView();
            //if (string.IsNullOrWhiteSpace(loginName))
            //{
            //    return new ResponseView { IsSuccess = false, Message = "用户名不能为空" };
            //}

            ////取用户
            //var user = new TbmisUserAppl(loginName).GetUser();

            ////类型转换
            //var book = _adapter.Adapt<Textbook>(textbook);

            ////创建教材
            //var bookAdd = Domain.TextbookService.CreateTextbook(book, user);

            //var repo = ServiceLocator.Current.GetInstance<ITextbookRepository>();
            //var result = new ResponseView();

            //try
            //{
            //    repo.Add(bookAdd);
            //    repo.Context.Commit();
            //    return result;
            //}
            //catch (Exception)
            //{
            //    result.IsSuccess = false;
            //    result.Message = "新增图书失败";
            //    return result;
            //}
        }
 public ResponseView Modify(TextbookView textbook)
 {
     return _impl.Modify(textbook);
 }
Exemplo n.º 3
0
        public ResponseView Modify(TextbookView textbook)
        {
            return new ResponseView();
            ////取教材
            //var id = textbook.TextbookId.ConvertToGuid();
            ////CUD仓储
            //var repo = ServiceLocator.Current.GetInstance<ITextbookRepository>();
            //var bookModify = repo.First(t => t.TextbookId == id);
            ////类型转换
            //var book = _adapter.Adapt<Textbook>(textbook);
            ////改教材
            //bookModify.Author = book.Author;
            //bookModify.Edition = book.Edition;
            //bookModify.Isbn = book.Isbn;
            //bookModify.IsSelfCompile = book.IsSelfCompile;
            //bookModify.Name = book.Name;
            //bookModify.PageCount = book.PageCount;
            //bookModify.PressId = book.PressId;
            //bookModify.Price = book.Price;
            //bookModify.PrintCount = book.PrintCount;
            //bookModify.PublishDate = book.PublishDate;
            //bookModify.TextbookType = book.TextbookType;

            //var result = new ResponseView();

            //try
            //{
            //    repo.Context.Commit();
            //    return result;
            //}
            //catch (Exception e)
            //{
            //    result.IsSuccess = false;
            //    result.Message = "修改图书失败";
            //    return result;
            //}
        }
 public ResponseView Add(TextbookView textbook, string loginName)
 {
     return _impl.Add(textbook, loginName);
 }