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;
        }
        protected void btnContinue4_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            var obj = Badge.FetchObject(int.Parse(lblBID.Text));

            SaveBadgeExtendedAttributes(obj, gvCat, gvAge, gvBranch, gvLoc);

            if (!FileUploadCtl.FileExists())
            {
                var    masterPage = (IControlRoomMaster)Master;
                string message    = String.Format(SRPResources.ApplicationError1, "<ul>");
                message = string.Format(String.Format("{0}<li>{{0}}</li>", message), "The badge image is mandatory.  Please upload one.");

                message = string.Format("{0}</ul>", message);
                masterPage.PageError            = message;
                masterPage.DisplayMessageOnLoad = true;
            }
            else
            {
                Session["BLL"] = int.Parse(lblPK.Text);
                Response.Redirect("BookListAddEdit.aspx?M=K");
            }
        }