Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _nav = new AdminNavigation(Request.QueryString);

            try
            {
                // Get the Review ID
                ReviewInfo review = new ReviewInfo();

                if (!Page.IsPostBack)
                {
                    cmdDelete.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("DeleteItem") + "');");
                    if (_nav.ReviewID != Null.NullInteger)
                    {
                        ReviewController controller = new ReviewController();
                        review = controller.GetReview(PortalId, _nav.ReviewID);
                        if (review != null)
                        {
                            cmdDelete.Visible       = true;
                            divApproval.Visible     = true;
                            cmbRating.SelectedValue = review.Rating.ToString();
                            txtComments.Text        = review.Comments;
                            chkAuthorized.Checked   = review.Authorized;
                            txtUserName.Text        = review.UserName;
                        }
                        else
                        {
                            if (UserId != -1)
                            {
                                txtUserName.Text = UserInfo.DisplayName;
                            }
                            else
                            {
                                txtUserName.Text = Localization.GetString("Anonymous.Text", LocalResourceFile);
                            }
                        }
                    }
                }

                // Which controls do we display?
                if (CanManageReviews())
                {
                    txtUserName.Enabled   = false;
                    cmbRating.Enabled     = false;
                    divAuthorized.Visible = true;
                    divApproval.Visible   = false;
                }
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }