예제 #1
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Syndication", Request, "AccountFeedsManage.aspx"));

            DomainClass cs = SessionManager.GetDomainClass("MadLib");
            inputName.MaxLength = cs["Name"].MaxLengthInChars;

            if (RequestId > 0)
            {
                TransitMadLib t = SessionManager.MadLibService.GetMadLibById(
                    SessionManager.Ticket, RequestId);
                inputTemplate.Text = t.Template;
                inputName.Text     = t.Name;
                sitemapdata.Add(new SiteMapDataAttributeNode(t.Name, Request.Url));
            }
            else
            {
                sitemapdata.Add(new SiteMapDataAttributeNode("New MadLib", Request.Url));
            }
            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(save);
    }
예제 #2
0
 public void save_Click(object sender, EventArgs e)
 {
     TransitMadLib t = new TransitMadLib();
     t.Id = RequestId;
     t.Template = inputTemplate.Text;
     t.Name = inputName.Text;
     SessionManager.CreateOrUpdate<TransitMadLib>(
         t, SessionManager.MadLibService.CreateOrUpdateMadLib);
     Redirect("AccountMadLibsManage.aspx");
 }
예제 #3
0
    public void save_Click(object sender, EventArgs e)
    {
        TransitMadLib t = new TransitMadLib();

        t.Id       = RequestId;
        t.Template = inputTemplate.Text;
        t.Name     = inputName.Text;
        SessionManager.CreateOrUpdate <TransitMadLib>(
            t, SessionManager.MadLibService.CreateOrUpdateMadLib);
        Redirect("AccountMadLibsManage.aspx");
    }
    public override void DataBind()
    {
        if (MadLibId <= 0)
        {
            throw new Exception("Missing Mad Lib Id");
        }

        TransitMadLib ml = SessionManager.MadLibService.GetMadLibById(SessionManager.Ticket, MadLibId);

        mIndices = Parse(ml.Template, OnTextDataBind, OnTagDataBind);

        base.DataBind();
    }
    public bool TryGetText(ref string value)
    {
        if (mText == null)
        {
            mValid = true;
            mText  = new StringBuilder();

            if (MadLibId <= 0)
            {
                throw new Exception("Missing Mad Lib Id");
            }

            TransitMadLib ml = SessionManager.MadLibService.GetMadLibById(SessionManager.Ticket, MadLibId);
            Parse(ml.Template, OnTextCollect, OnTagCollect);
        }

        value = mText.ToString();
        return(mValid);
    }
예제 #6
0
 public int CreateOrUpdateMadLib(string ticket, TransitMadLib madlib)
 {
     return WebServiceImpl<TransitMadLib, ManagedMadLib, MadLib>.CreateOrUpdate(
         ticket, madlib);
 }
예제 #7
0
 public int CreateOrUpdateMadLib(string ticket, TransitMadLib madlib)
 {
     return(WebServiceImpl <TransitMadLib, ManagedMadLib, MadLib> .CreateOrUpdate(
                ticket, madlib));
 }