protected void btnContinue3_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            var badge = LoadBadgeObject();

            badge.Insert();

            try
            {
                var badgePath = string.Format(Server.MapPath("~/images/Badges/"));
                System.IO.File.Copy(string.Format("{0}no_badge.png", badgePath),
                                    string.Format("{0}{1}.png", badgePath, badge.BID));
                System.IO.File.Copy(string.Format("{0}no_badge_sm.png", badgePath),
                                    string.Format("{0}sm_{1}.png", badgePath, badge.BID));
            }
            catch (Exception ex)
            {
                this.Log().Error("Couldn't copy no_badge images into new badge: {0}",
                                 ex.Message);
            }

            new SessionTools(Session).RemoveCache(Cache, CacheKey.BadgesActive);
            lblBID.Text = badge.BID.ToString();
            var bl = BookList.FetchObject(int.Parse(lblPK.Text));

            bl.AwardBadgeID = badge.BID;
            bl.Update();
            FileUploadCtl.FileName = lblBID.Text;
            FileUploadCtl.ProcessRender();
            OpenBadgesBadgeMaker.FileName = lblBID.Text;

            pnlLast.Visible      = true;
            pnlBadgeMore.Visible = false;
        }
示例#2
0
        protected void btnContinue3_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            var obj = LoadBadgeObject();

            obj.Insert();
            Cache[CacheKey.BadgesActive] = true;
            lblBID.Text = obj.BID.ToString();
            var bl = BookList.FetchObject(int.Parse(lblPK.Text));

            bl.AwardBadgeID = obj.BID;
            bl.Update();
            FileUploadCtl.FileName = lblBID.Text;
            FileUploadCtl.ProcessRender();

            pnlLast.Visible      = true;
            pnlBadgeMore.Visible = false;
        }