Пример #1
0
        protected void btnGoNext_Click(object sender, EventArgs e)
        {
            MasterPage master = this.Master as MasterPage;

            ArrayList ScoresArray = new ArrayList();

            ScoresArray.Add(txtIQScore.Text);
            ScoresArray.Add(txtLanguage.Text);
            ScoresArray.Add(txtPersonalScore.Text);
            ScoresArray.Add(txtTechnicalScore.Text);

            WorkflowManager manager = master.workflowManager;

            string nextState = manager.GoNext(ScoresArray);

            if (!string.IsNullOrEmpty(nextState))
            {
                if (nextState == "RejectApplicant")
                {
                    Guid       cartableId = new Guid(Session["CartableId"].ToString());
                    wfCartable OldCart    = (from cart in context.wfCartable
                                             where cart.CartableId == cartableId
                                             select cart).First();

                    OldCart.wfWorkflowStatusReference.Load();

                    OldCart.wfWorkflowStatus = context.wfWorkflowStatus.First(id => id.Status == "Completed");
                    OldCart.ActionDate       = DateTime.Now;
                }

                context.SaveChanges();

                btnGoNext.Enabled = false;
                BtnOk.Enabled     = false;
            }
        }