コード例 #1
0
ファイル: MasterDataProvider.cs プロジェクト: ssssossss/sai
        protected virtual BookSize GetBookSizeFromReader(IDataReader reader)
        {
            EntityConverter <BookSize> PrintedAtEntity = new EntityConverter <BookSize>();
            BookSize BookSize = PrintedAtEntity.Convert(reader);

            return(BookSize);
        }
コード例 #2
0
ファイル: BookService.svc.cs プロジェクト: yxandam/BabyPlan
        public AdvancedResult <int> AddBook(string bookname, BookSize booksize, BookCoverType bookcover, int booktype, string introduction, string token)
        {
            AdvancedResult <int> result = new AdvancedResult <int>();

            try
            {
                if (string.IsNullOrEmpty(bookname))
                {
                    result.Error = AppError.ERROR_BOOK_NOT_NULL;
                    return(result);
                }
                if (!CacheManagerFactory.GetMemoryManager().Contains(token))
                {
                    result.Error = AppError.ERROR_PERSON_NOT_LOGIN;
                }
                else
                {
                    int userid = Convert.ToInt32(CacheManagerFactory.GetMemoryManager().Get(token));

                    //int userid = 5;
                    ProBook book = new ProBook();

                    book.BookName     = bookname.Trim();
                    book.BookSize     = booksize;
                    book.BookType     = booktype;
                    book.AdUserId     = userid;
                    book.BookCover    = bookcover;
                    book.Introduction = string.IsNullOrEmpty(introduction) ? string.Empty : introduction.Trim();

                    result.Data = ProBookAccessor.Instance.Insert(book);

                    result.Error = AppError.ERROR_SUCCESS;
                }
            }
            catch (Exception e)
            {
                result.Error     = AppError.ERROR_FAILED;
                result.ExMessage = e.ToString();
            }
            return(result);
        }
コード例 #3
0
        public AdvancedResult<int> AddBook(string bookname, BookSize booksize,BookCoverType bookcover, int booktype, string introduction, string token)
        {
            AdvancedResult<int> result = new AdvancedResult<int>();
            try
            {
                if (string.IsNullOrEmpty(bookname))
                {
                    result.Error = AppError.ERROR_BOOK_NOT_NULL;
                    return result;
                }
                if (!CacheManagerFactory.GetMemoryManager().Contains(token))
                {
                    result.Error = AppError.ERROR_PERSON_NOT_LOGIN;
                }
                else
                {
                    int userid = Convert.ToInt32(CacheManagerFactory.GetMemoryManager().Get(token));

                //int userid = 5;
                    ProBook book = new ProBook();

                    book.BookName = bookname.Trim();
                    book.BookSize = booksize;
                    book.BookType = booktype;
                    book.AdUserId = userid;
                    book.BookCover = bookcover;
                    book.Introduction = string.IsNullOrEmpty(introduction) ? string.Empty : introduction.Trim();

                    result.Data = ProBookAccessor.Instance.Insert(book);

                    result.Error = AppError.ERROR_SUCCESS;
                }
            }
            catch (Exception e)
            {
                result.Error = AppError.ERROR_FAILED;
                result.ExMessage = e.ToString();
            }
            return result;
        }
コード例 #4
0
ファイル: BookService.svc.cs プロジェクト: yxandam/BabyPlan
        public RespResult EditBook(int bookid, string bookname, BookSize booksize, BookCoverType bookcover, int booktype, string introduction, string token)
        {
            RespResult result = new RespResult();

            try
            {
                if (string.IsNullOrEmpty(bookname))
                {
                    result.Error = AppError.ERROR_BOOK_NOT_NULL;
                    return(result);
                }

                if (!CacheManagerFactory.GetMemoryManager().Contains(token))
                {
                    result.Error = AppError.ERROR_PERSON_NOT_LOGIN;
                }
                else
                {
                    ProBook book = new ProBook();
                    book.BookId       = bookid;
                    book.BookName     = bookname.Trim();
                    book.BookSize     = booksize;
                    book.BookType     = booktype;
                    book.BookCover    = bookcover;
                    book.Introduction = string.IsNullOrEmpty(introduction) ? string.Empty : introduction.Trim();
                    book.State        = StateType.Active;

                    ProBookAccessor.Instance.Update(book);

                    result.Error = AppError.ERROR_SUCCESS;
                }
            }
            catch (Exception e)
            {
                result.Error     = AppError.ERROR_FAILED;
                result.ExMessage = e.ToString();
            }
            return(result);
        }
コード例 #5
0
        void ReleaseDesignerOutlets()
        {
            if (AContentView != null)
            {
                AContentView.Dispose();
                AContentView = null;
            }

            if (AreaLabel != null)
            {
                AreaLabel.Dispose();
                AreaLabel = null;
            }

            if (AuthorLabel != null)
            {
                AuthorLabel.Dispose();
                AuthorLabel = null;
            }

            if (BookSize != null)
            {
                BookSize.Dispose();
                BookSize = null;
            }

            if (BookSizeLabel != null)
            {
                BookSizeLabel.Dispose();
                BookSizeLabel = null;
            }

            if (BookTitleLabel != null)
            {
                BookTitleLabel.Dispose();
                BookTitleLabel = null;
            }

            if (CaseLabel != null)
            {
                CaseLabel.Dispose();
                CaseLabel = null;
            }

            if (CasesButton != null)
            {
                CasesButton.Dispose();
                CasesButton = null;
            }

            if (CaseTextField != null)
            {
                CaseTextField.Dispose();
                CaseTextField = null;
            }

            if (CaseView != null)
            {
                CaseView.Dispose();
                CaseView = null;
            }

            if (ContactEmailLabel != null)
            {
                ContactEmailLabel.Dispose();
                ContactEmailLabel = null;
            }

            if (ContactPhoneLabel != null)
            {
                ContactPhoneLabel.Dispose();
                ContactPhoneLabel = null;
            }

            if (CoverImageView != null)
            {
                CoverImageView.Dispose();
                CoverImageView = null;
            }

            if (CurrencyDate != null)
            {
                CurrencyDate.Dispose();
                CurrencyDate = null;
            }

            if (CurrencyDateLabel != null)
            {
                CurrencyDateLabel.Dispose();
                CurrencyDateLabel = null;
            }

            if (CurrentDayLabel != null)
            {
                CurrentDayLabel.Dispose();
                CurrentDayLabel = null;
            }

            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }

            if (DescriptionView != null)
            {
                DescriptionView.Dispose();
                DescriptionView = null;
            }

            if (DespTextField != null)
            {
                DespTextField.Dispose();
                DespTextField = null;
            }

            if (ExpiredInfoTF != null)
            {
                ExpiredInfoTF.Dispose();
                ExpiredInfoTF = null;
            }

            if (ExpiredLabel != null)
            {
                ExpiredLabel.Dispose();
                ExpiredLabel = null;
            }

            if (ExpiredView != null)
            {
                ExpiredView.Dispose();
                ExpiredView = null;
            }

            if (InfoLabel != null)
            {
                InfoLabel.Dispose();
                InfoLabel = null;
            }

            if (InformationView != null)
            {
                InformationView.Dispose();
                InformationView = null;
            }

            if (InstalledDate != null)
            {
                InstalledDate.Dispose();
                InstalledDate = null;
            }

            if (InstalledLabel != null)
            {
                InstalledLabel.Dispose();
                InstalledLabel = null;
            }

            if (LoanButton != null)
            {
                LoanButton.Dispose();
                LoanButton = null;
            }

            if (PracticeArea != null)
            {
                PracticeArea.Dispose();
                PracticeArea = null;
            }

            if (ProgressBar != null)
            {
                ProgressBar.Dispose();
                ProgressBar = null;
            }

            if (ProgressStatusLabel != null)
            {
                ProgressStatusLabel.Dispose();
                ProgressStatusLabel = null;
            }

            if (ProgressView != null)
            {
                ProgressView.Dispose();
                ProgressView = null;
            }

            if (ScrollView != null)
            {
                ScrollView.Dispose();
                ScrollView = null;
            }

            if (Subcategory != null)
            {
                Subcategory.Dispose();
                Subcategory = null;
            }

            if (SubcategoryLabel != null)
            {
                SubcategoryLabel.Dispose();
                SubcategoryLabel = null;
            }

            if (TagsView != null)
            {
                TagsView.Dispose();
                TagsView = null;
            }

            if (TitleView != null)
            {
                TitleView.Dispose();
                TitleView = null;
            }

            if (UpdateButton != null)
            {
                UpdateButton.Dispose();
                UpdateButton = null;
            }

            if (UpdateInfoLabel != null)
            {
                UpdateInfoLabel.Dispose();
                UpdateInfoLabel = null;
            }

            if (Version != null)
            {
                Version.Dispose();
                Version = null;
            }

            if (VersionLabel != null)
            {
                VersionLabel.Dispose();
                VersionLabel = null;
            }

            if (WhatNewInfoLabel != null)
            {
                WhatNewInfoLabel.Dispose();
                WhatNewInfoLabel = null;
            }

            if (WhatNewInfoView != null)
            {
                WhatNewInfoView.Dispose();
                WhatNewInfoView = null;
            }

            if (WhatNewLabel != null)
            {
                WhatNewLabel.Dispose();
                WhatNewLabel = null;
            }

            if (WhatNewView != null)
            {
                WhatNewView.Dispose();
                WhatNewView = null;
            }

            if (DotButton != null)
            {
                DotButton.Dispose();
                DotButton = null;
            }
        }
コード例 #6
0
        public RespResult EditBook(int bookid, string bookname, BookSize booksize, BookCoverType bookcover, int booktype, string introduction, string token)
        {
            RespResult result = new RespResult();
            try
            {
                if (string.IsNullOrEmpty(bookname))
                {
                    result.Error = AppError.ERROR_BOOK_NOT_NULL;
                    return result;
                }

                if (!CacheManagerFactory.GetMemoryManager().Contains(token))
                {
                    result.Error = AppError.ERROR_PERSON_NOT_LOGIN;
                }
                else
                {

                    ProBook book = new ProBook();
                    book.BookId = bookid;
                    book.BookName = bookname.Trim();
                    book.BookSize = booksize;
                    book.BookType = booktype;
                    book.BookCover = bookcover;
                    book.Introduction = string.IsNullOrEmpty(introduction) ? string.Empty : introduction.Trim();
                    book.State = StateType.Active;

                    ProBookAccessor.Instance.Update(book);

                    result.Error = AppError.ERROR_SUCCESS;
                }
            }
            catch (Exception e)
            {
                result.Error = AppError.ERROR_FAILED;
                result.ExMessage = e.ToString();
            }
            return result;
        }