Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BurrowFramework bf = new BurrowFramework();
            IConversation conversation = bf.CurrentConversation;

            if (conversation == null)
            {
                throw new Exception("The page doesn't have conversation");
            }

            object lastConversationId = Session["conversationId"];
            if (lastConversationId == null)
            {
                throw new Exception("We haven't found the Id of previous conversation");
            }

            if (!conversation.Id.Equals(lastConversationId))
            {
                throw new Exception(
                    "Failed to join the conversation in the same workspace, a new conversation was  created");
            }
        }
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        BurrowFramework bf = new BurrowFramework();
        IConversation conversation = bf.CurrentConversation;

        if (conversation == null)
        {
            throw new Exception("The page doesn't have current conversation!");
        }

        if (!IsPostBack)
        {
            Checker.CheckSpanningConversations(0);
            conversation.SpanWithPostBacks();
            Checker.CheckSpanningConversations(1);

            //conversation.Items["step"] = 0;
            Session["conversationId"] = conversation.Id;
            Session["step"] = 0;
            btnNextStep.Text = "step 1";
        }
        else
        {
            if (!conversation.Id.Equals(Session["conversationId"]))
            {
                throw new Exception("The current conversation isn't the correct");
            }

            //if (conversation.Items["step"] == null)
            //    throw new Exception("The current conversation has lost state");

            lblMessage.Text = "We have successfully checked that the conversation is shared between postbacks";
        }
    }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BurrowFramework bf = new BurrowFramework();
            IConversation conversation = bf.CurrentConversation;
            Checker.CheckSpanningConversations(0);

            if (conversation == null)
            {
                throw new Exception("The page doesn't have conversation");
            }

            //if (BurrowFramework.ActiveConversations.Count != 1)
            //    throw new Exception("There are more conversations that the expected");

            object lastConversationId = Session["conversationId"];
            if (lastConversationId == null)
            {
                throw new Exception("We haven't found the Id of previous conversation");
            }

            if (conversation.Id.Equals(lastConversationId))
            {
                throw new Exception("The conversation is same that previous, the new conversation was not created");
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BurrowFramework bf = new BurrowFramework();
            IConversation conversation = bf.CurrentConversation;
            Checker.CheckSpanningConversations(1);

            if (conversation == null)
            {
                throw new Exception("The page doesn't have conversation");
            }

            object lastConversationId = Session["conversationId"];
            if (lastConversationId == null)
            {
                throw new Exception("We haven't found the Id of previous conversation");
            }

            if (!conversation.Id.Equals(lastConversationId))
            {
                throw new Exception("The conversation isn't same that previous, the new conversation was created");
            }

            conversation.FinishSpan();
        }
    }
 protected void btnNextStep_Click(object sender, EventArgs e)
 {
     IConversation conversation = new BurrowFramework().CurrentConversation;
     conversation.SpanWithCookie("WorkSpaceStep06");
     Session["conversationId"] = conversation.Id;
     Response.Redirect("Step06.aspx");
 }
Example #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack || Session["continue"] != null && (bool) Session["continue"])
        {
            BurrowFramework bf = new BurrowFramework();
            IConversation conversation = bf.CurrentConversation;

            if (conversation == null)
            {
                throw new Exception("The page doesn't have conversation");
            }
            Checker.CheckSpanningConversations(1);

            object lastConversationId = Session["conversationId"];
            if (lastConversationId == null)
            {
                throw new Exception("We haven't found the Id of previous conversation");
            }

            if (!conversation.Id.Equals(lastConversationId))
            {
                throw new Exception("The conversation isn't same that previous, the new conversation was created");
            }
        }

        if (StepCompleted("a") && StepCompleted("b"))
        {
            Session.Remove("continue");
            btnNextStep.Visible = true;
        }
        else if (IsPostBack)
        {
            lblMessage.Text = "You should complete the step 6a, 6b, 6c a before continue";
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        BurrowFramework bf = new BurrowFramework();
        IConversation conversation = bf.CurrentConversation;

        if (conversation == null)
        {
            throw new Exception("The page doesn't have conversation");
        }

        if (Session["conversationId"] == null)
        {
            throw new Exception("We haven't found the Id's conversation in the ASP.NET session");
        }

        object id = Session["conversationId"];

        if (!conversation.Id.Equals(id))
        {
            throw new Exception("The conversation in iframe isn't same that conversation in container page. Current.Id "
                                + conversation.Id);
        }
        Checker.CheckSpanningConversations(1);

        lblConversationId.Text = conversation.Id.ToString();
    }
Example #8
0
    protected void btnNextStep_Click(object sender, EventArgs e)
    {
        BurrowFramework bf = new BurrowFramework();
        IConversation conversation = bf.CurrentConversation;

        //int step = (int)conversation.Items["step"];
        int step = (int) Session["step"];

        step++;
        //conversation.Items["step"] = step;
        Session["step"] = step;

        if (step < 5)
        {
            btnNextStep.Text = "step 1 + " + step + "/5";
            Checker.CheckSpanningConversations(1);
        }
        else
        {
            conversation.FinishSpan();
            Checker.CheckSpanningConversations(0);

            Response.Redirect("Step02.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        BurrowFramework bf = new BurrowFramework();
        IConversation conversation = bf.CurrentConversation;

        if (!IsPostBack)
        {
            if (conversation == null)
            {
                throw new Exception("The page doesn't have conversation");
            }
            Checker.CheckSpanningConversations(0);
            conversation.SpanWithPostBacks();
            Checker.CheckSpanningConversations(1);
            Session["continue"] = false;
            //if (BurrowFramework.ActiveConversations.Count != 1)
            //    throw new Exception("There are more conversations that the expected");
        }
            //else if (conversation.Items.ContainsKey("continue"))
        else if (Session["continue"] != null && (bool) Session["continue"])
        {
            Session.Remove("continue");
            btnNextStep.Visible = true;
        }
        else
        {
            lblMessage.Text = "You should complete the step 3 a before continue";
        }
    }
 private void HandleUpdateCompleted(object sender, EventArgs e)
 {
     // PageMethods is perfect for managing strongly-typed redirects...
     // definitely use it with your web apps instead of the following.
     BurrowFramework burrow = new BurrowFramework();
     burrow.CurrentConversation.FinishSpan();
     Response.Redirect("ListCustomers.aspx?action=updated", false);
 }
Example #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BurrowFramework burrow = new BurrowFramework();
            burrow.CurrentConversation.SpanWithPostBacks();
        }

        InitEditCustomerView();
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if(!IsPostBack)
     {
         Util.ResetEnvironment();
         BurrowFramework bf = new BurrowFramework();
         bf.CurrentConversation.SpanWithPostBacks();
         Session["conversationId"] = bf.CurrentConversation.Id;
     }
 }
Example #13
0
 public static void ResetEnvironment()
 {
     SchemaUtil su = new SchemaUtil();
     su.CreateSchemas();
     BurrowFramework f = new BurrowFramework();
     f.CloseWorkSpace();
     f.BurrowEnvironment.ShutDown(); //Restart the environment to prepare a fresh start 
     f.BurrowEnvironment.Start();
     Checker.CheckSpanningConversations(0);
     f.InitWorkSpace();
 }
        private void ConversationUnvailableException()
        {
            string msg = new BurrowFramework().CurrentConversation == null
                             ? "ConversationalData can not be accessed outside conversation. "
                         + "Make sure Conversation is intialized before visiting conversational data."
                         +
                         " It might be caused by missing <add name=\"WebUtilHTTPModule\" type=\"NHibernate.Burrow.WebUtil.WebUtilHTTPModule\" /> in the Web.Config file"
                             : "Conversation may have changed, if you don't need to keep data after conversation changed, please use OutOfConversationSafe Mode on.";

            throw new ConversationUnavailableException(msg);
        }
Example #15
0
    protected void btnClose_Click(object sender, EventArgs e)
    {
        BurrowFramework bf = new BurrowFramework();
        IConversation conversation = bf.CurrentConversation;
        Session["continue"] = true;

        conversation.FinishSpan();
        Checker.CheckSpanningConversations(1);

        hdClose.Value = "1";
    }
    protected void btnNextStep_Click(object sender, EventArgs e)
    {
        BurrowFramework bf = new BurrowFramework();
        IConversation conversation = bf.CurrentConversation;
        Checker.CheckSpanningConversations(1);

        Session["conversationId"] = conversation.Id;
        //using string.Empty as workspace name will span the conversation over all pages, NOT recommendded though
        conversation.SpanWithCookie(String.Empty);
        Checker.CheckSpanningConversations(1);

        Response.Redirect("Step05.aspx");
    }
    protected override void OnPreRender(EventArgs e)
    {
        lStatus.Text = "MockEntity In Conversation: " + GetNumber(me) + "<br /> MockEntity in DB: " + GetNumber(meInDb);
        bool spanning = new BurrowFramework().CurrentConversation.IsSpanning;
        btnUpdate.Enabled = spanning;
        btnCommit.Enabled = spanning;
        btnCancel.Enabled = spanning;
        btnStart.Enabled = !spanning;
        phStrategies.Visible = !spanning;
        base.OnPreRender(e);
        Checker.AssertEqual(Session["me"], me);
        Checker.AssertEqual(Session["meInDb"], meInDb);

    }
Example #18
0
        public EditCustomerPresenter(IEditCustomerView view)
        {
            Check.Require(view != null, "view may not be null");
            this.view = view;

            BurrowFramework burrow = new BurrowFramework();

            //Save model in current conversation.
            object mod;
            if (!burrow.CurrentConversation.Items.TryGetValue("EditCustomerModel", out mod))
            {
                model = new EditCustomerModel();
                burrow.CurrentConversation.Items.Add("EditCustomerModel",model);
            }
            else
                model = mod as EditCustomerModel;
        }
Example #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BurrowFramework bf = new BurrowFramework();
            IConversation conversation = bf.CurrentConversation;

            if (conversation == null)
            {
                throw new Exception("The page doesn't have conversation");
            }
            Checker.CheckSpanningConversations(1);

            conversation.SpanWithPostBacks();

            Checker.CheckSpanningConversations(2);

            //if (BurrowFramework.ActiveConversations.Count != 2)
            //    throw new Exception("There are more conversations that the expected");            }
        }
    }
 protected override void Perform()
 {
     pt = new ProgressTracker();
     BurrowFramework bf = new BurrowFramework();
     bf.InitWorkSpace();
     try {
         pt.ProgressChanged += new EventHandler(pt_ProgressChanged);
         DoPerform();
     }catch(Exception) {
         try {
             if (bf.CurrentConversation != null)
                 bf.CurrentConversation.GiveUp();
         }catch (Exception) {/*prevent this exception hiding the real one*/}
         throw;
     }
     finally {
         try {
             bf.CloseWorkSpace();
         }
         catch (Exception) {/*prevent this exception hiding the real one*/}
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BurrowFramework bf = new BurrowFramework();
            IConversation conversation = bf.CurrentConversation;
            Checker.CheckSpanningConversations(0);

            if (conversation == null)
            {
                throw new Exception("The page doesn't have conversation");
            }

            conversation.SpanWithPostBacks();
            Checker.CheckSpanningConversations(1);

            Session["conversationId"] = conversation.Id;
            lblConversationId.Text = "Current: " + conversation.Id;

            WebUtil utils = new WebUtil();
            frameChild.Attributes["src"] = utils.WrapUrlWithConversationInfo("Step04Child.aspx");
        }
    }
 public ISession GetSession(Type type)
 {
     BurrowFramework facade = new BurrowFramework();
     return facade.GetSession(type);
 }
Example #23
0
 public void Setup()
 {
     BurrowFramework framework = new BurrowFramework();
     framework.InitWorkSpace();
     NHibernateSessionManager.Instance.BeginTransaction(null);
 }
 protected void btnStart_Click(object sender, EventArgs e)
 {
     MEInConversation = new MockEntity();
     BurrowFramework f = new BurrowFramework();
     f.CurrentConversation.SpanWithPostBacks(GetStrategy());
 }
Example #25
0
 protected void InitWorkSpace()
 {
     burrow = new BurrowFramework();
     burrow.InitWorkSpace();
 }
Example #26
0
 private void HandleUpdateCancelled(object sender, EventArgs e)
 {
     BurrowFramework burrow = new BurrowFramework();
     burrow.CurrentConversation.FinishSpan();
     Response.Redirect("ListCustomers.aspx", false);
 }