示例#1
0
        protected void btnAddVolume_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                dto.Volume volumeDto = new dto.Volume();

                volumeDto.VolumeName = tbVolumeName.Text.Trim();

                volumeDto.VolumeYear = tbVolumeYear.Text.Trim();

                volumeDto.IsActive = Convert.ToBoolean(Convert.ToInt32(ddlStatus.SelectedValue));

                volumeDto.CreationUserId = UserInfo.UserDto.UserId;

                VolumeFacade facade = new VolumeFacade(BusinessFacadeBehavior.TRANSACTIONAL);

                dto.ActionStatus status = facade.InsertVolume(volumeDto);

                if (status.IsSuccessful)
                {
                    ResetFormValues();
                }

                LblStatus.Text = GetFormattedMessages(status);
            }
        }
示例#2
0
        protected void btnAddArticle_OnClick(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                //Init page objects from session
                GetSessionValues();

                ArticleBF.ArticleDto.IssueDto.VolumeIssueId = Convert.ToInt32(ddlIssues.SelectedValue);

                ArticleBF.ArticleDto.Title = tbTitle.Text.Trim();

                ArticleBF.ArticleDto.Authors = tbAuthors.Text.Trim();

                ArticleBF.ArticleDto.Keywords = tbKeywords.Text.Trim();

                ArticleBF.ArticleDto.IsActive = Convert.ToBoolean(Convert.ToInt32(ddlStatus.SelectedValue));

                ArticleBF.ArticleDto.CreationUserId = UserInfo.UserDto.UserId;

                //Persist page objects to session
                SetSessionValues();

                dto.ActionStatus status = ArticleBF.AddArticle();

                if (status.IsSuccessful)
                {
                    DeleteTempDocs();

                    ResetArticleFormValues();
                }
                else
                {
                    lblErrors.Text = GetFormattedMessages(status);
                }
            }
        }
示例#3
0
        protected void btnAddIssue_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                //Init page objects from session
                GetSessionValues();

                IssueBF.IssueDto.ParentVolume.VolumeId = Convert.ToInt32(ddlVolumes.SelectedValue);

                IssueBF.IssueDto.IssueName = tbIssueName.Text.Trim();

                IssueBF.IssueDto.IsActive = Convert.ToBoolean(Convert.ToInt32(ddlStatus.SelectedValue));

                IssueBF.IssueDto.CreationUserId = UserInfo.UserDto.UserId;

                //Persist page objects to session
                SetSessionValues();

                dto.ActionStatus status = IssueBF.AddIssue();

                if (status.IsSuccessful)
                {
                    DeleteTempDocs();

                    ResetIssueFormValues();

                    IssueBF.IssueDto = null;

                    SetSessionValues();
                }
                else
                {
                    lblErrors.Text = GetFormattedMessages(status);
                }
            }
        }