Example #1
0
        protected void CreateClick(object sender, EventArgs e)
        {
            // create the hiringRequest info and populate it with data from the UI
            HiringRequestInfo requestInfo = new HiringRequestInfo()
            {
                Id           = Guid.NewGuid(),
                RequesterId  = currentUser.Id,
                CreationDate = DateTime.Now,
                DepartmentId = this.hiringRequestDetails1.DepartmentId,
                PositionId   = this.hiringRequestDetails1.PositionId,
                Description  = this.hiringRequestDetails1.Description,
                Title        = this.hiringRequestDetails1.CreateRequestTitle(this.currentUser)
            };

            // start the hiring request
            HiringRequestServiceClient client = new HiringRequestServiceClient();

            client.StartProcess(requestInfo);
            client.Close();

            // update ui
            this.btnCancel.Text    = "Request created, click here to go back to the Inbox";
            this.btnCancel.Width   = new System.Web.UI.WebControls.Unit(400, System.Web.UI.WebControls.UnitType.Pixel);
            this.btnCreate.Visible = false;
        }
        protected override void Execute(NativeActivityContext context)
        {
            HiringRequestInfo hiringRequestInfo = this.HiringRequestInfo.Get(context);

            hiringRequestInfo.IsCompleted = this.IsCompleted.Get(context);
            hiringRequestInfo.IsCancelled = this.IsCancelled.Get(context);
            hiringRequestInfo.IsSuccess   = this.IsSuccess.Get(context);
            HiringRequestRepository.Save(hiringRequestInfo);
        }
        protected override void Execute(CodeActivityContext context)
        {
            HiringRequestInfo hiringRequestInfo = this.HiringRequestInfo.Get(context);

            hiringRequestInfo.WorkflowInstanceId = context.WorkflowInstanceId;
            hiringRequestInfo.IsCompleted        = false;
            hiringRequestInfo.IsCancelled        = false;
            hiringRequestInfo.IsSuccess          = false;
            this.HiringRequestInfoOut.Set(context, hiringRequestInfo);
        }
Example #4
0
        protected override IAsyncResult BeginOnSave(IDictionary <System.Xml.Linq.XName, object> readWriteValues, IDictionary <System.Xml.Linq.XName, object> writeOnlyValues, TimeSpan timeout, AsyncCallback callback, object state)
        {
            HiringRequestInfo info = ExtractHiringRequestInfoFromValues(writeOnlyValues);

            if (info != null)
            {
                HiringRequestRepository.Save(info);
            }
            // save the hiring request data here
            return(base.BeginOnSave(readWriteValues, writeOnlyValues, timeout, callback, state));
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            currentUser = (Employee)Session["user"];

            HiringRequestInfo info = new HiringRequestInfo {
                RequesterId = currentUser.Id
            };

            this.hiringRequestDetails1.HiringRequestInfo = info;
            this.hiringRequestDetails1.ShowCommentsField = false;
            this.hiringRequestDetails1.Editable          = true;
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // initialize data
            requestId        = Request["id"];
            this.info        = HiringRequestRepository.Load(requestId);
            this.currentUser = (Employee)Session["user"];

            // show request info
            this.hiringRequestDetails1.HiringRequestInfo = info;
            this.hiringRequestDetails1.Editable          = false;
            this.hiringRequestHistory1.HiringRequestId   = requestId;

            // only show the cancellation button to the requester
            if (!IsPostBack)
            {
                this.btnCancel.Visible = (!info.IsCompleted && info.RequesterId.Equals(currentUser.Id));
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // get information from state
            requestId = Request["id"];
            state     = Request["state"];

            // get the user
            currentUser = (Employee)Session["user"];

            // configure the control to show hiring request info
            info = HiringRequestRepository.Load(requestId);

            // set UI
            this.SetControlsVisibility();

            this.hiringRequestDetails1.HiringRequestInfo = info;
            this.hiringRequestDetails1.ShowCommentsField = true;
            this.hiringRequestHistory1.HiringRequestId   = requestId;
        }
        protected override JobPosting Execute(CodeActivityContext context)
        {
            HiringRequestInfo hiringRequestInfo = this.HiringRequestInfo.Get(context);

            return(new JobPosting
            {
                Id = Guid.NewGuid(),
                Title = hiringRequestInfo.Title,
                Description = hiringRequestInfo.Description,
                HiringRequestInfo = new HiringRequestInfo
                {
                    Id = hiringRequestInfo.Id,
                    CreationDate = hiringRequestInfo.CreationDate,
                    Description = hiringRequestInfo.Description,
                    DepartmentId = hiringRequestInfo.DepartmentId,
                    Title = hiringRequestInfo.Title,
                    PositionId = hiringRequestInfo.PositionId,
                    RequesterId = hiringRequestInfo.RequesterId
                }
            });
        }