コード例 #1
0
    public void btnPost_Click(object sender, EventArgs e)
    {
        using (var api = GetServiceAPIProxy())
        {
            var er =
                api.CheckEntitlement(msJobPostingEntitlement.CLASS_NAME, ConciergeAPI.CurrentEntity.ID, null).
                ResultValue;

            if (er.IsEntitled && er.Quantity > 0)
            {
                var saveResult = api.Save(targetJobPosting);
                if (!saveResult.Success)
                {
                    QueueBannerError(string.Format("Unable to save Job Posting: {0}", saveResult.FirstErrorMessage));
                }

                targetJobPosting = saveResult.ResultValue.ConvertTo <msJobPosting>();

                // MS-5386 Adjust entitlement (-1). Otherwise user will be able to use the entitlement forever.
                api.AdjustEntitlementAvailableQuantity(ConciergeAPI.CurrentEntity.ID, msJobPostingEntitlement.CLASS_NAME,
                                                       null, -1);
                Redirect();
            }
            else
            {
                MultiStepWizards.PostAJob.JobPosting = targetJobPosting;
                GoTo("~/careercenter/SelectCareerCenterProduct.aspx?transientJobPosting=true");
            }
        }
    }
コード例 #2
0
    protected void loadTargetObject(IConciergeAPIService proxy)
    {
        targetJobPosting = LoadObjectFromAPI <msJobPosting>(ContextID);

        if (targetJobPosting != null && !string.IsNullOrWhiteSpace(targetJobPosting.Location))
        {
            targetJobPostingLocation = LoadObjectFromAPI <msJobPostingLocation>(targetJobPosting.Location);
        }
    }
コード例 #3
0
    protected void unbindJobPosting()
    {
        if (targetJobPosting == null)
        {
            targetJobPosting = new msJobPosting
            {
                Owner = ConciergeAPI.CurrentEntity.ID,
                AllowOnlineResumeSubmission = true,
                IsApproved = false
            };
            CustomFieldSet1.MemberSuiteObject = targetJobPosting;
        }

        targetJobPosting.Name                  = tbName.Text;
        targetJobPosting.ResumeEmail           = tbResumeEmail.Text;
        targetJobPosting.CompanyName           = tbCompanyName.Text;
        targetJobPosting.Division              = tbDivision.Text;
        targetJobPosting.InternalReferenceCode = tbInternalReferenceCode.Text;

        if (trLocation.Visible)
        {
            targetJobPosting.Location = ddlLocation.SelectedValue;
        }

        DateTime postDate = dtpPostOn.SelectedDate.HasValue ? dtpPostOn.SelectedDate.Value : DateTime.Now;

        targetJobPosting.PostOn = postDate;
        targetJobPosting.Body   = reBody.Content;
        targetJobPosting.AllowOnlineResumeSubmission = true;
        targetJobPosting.ExpirationDate = postDate.AddDays(PortalConfiguration.Current.DefaultJobPostingExpiration);

        targetJobPosting.Categories = (from item in dlbCategories.Destination.Items
                                       select item.Value).ToList();

        CustomFieldSet1.Harvest();

        // MS-5754 (Modified 11/6/2014) At this point, it is worth checking that the target job posting has a proper ID.
        // If it doesn't, then save the object so that it does
        // MS-6201 - undo MS5747 so that nothing is saved until Order processes
        ////if (string.IsNullOrWhiteSpace(targetJobPosting.ID))
        ////{
        ////    targetJobPosting = SaveObject(targetJobPosting);
        ////    CustomFieldSet1.MemberSuiteObject = targetJobPosting;
        ////}
    }
コード例 #4
0
    /// <summary>
    /// Initializes the target object for the page
    /// </summary>
    /// <remarks>Many pages have "target" objects that the page operates on. For instance, when viewing
    /// an event, the target object is an event. When looking up a directory, that's the target
    /// object. This method is intended to be overriden to initialize the target object for
    /// each page that needs it.</remarks>
    protected override void InitializeTargetObject()
    {
        base.InitializeTargetObject();

        targetJobPosting = MultiStepWizards.PostAJob.JobPosting;

        if (targetJobPosting == null)
        {
            GoTo("~/careercenter/CreateEditJobPosting.aspx");
            return;
        }

        if (Post)
        {
            Redirect();
        }

        if (!string.IsNullOrWhiteSpace(targetJobPosting.Location))
        {
            targetJobPostingLocation = LoadObjectFromAPI <msJobPostingLocation>(targetJobPosting.Location);
        }
    }
コード例 #5
0
    /// <summary>
    /// Initializes the target object for the page
    /// </summary>
    /// <remarks>Many pages have "target" objects that the page operates on. For instance, when viewing
    /// an event, the target object is an event. When looking up a directory, that's the target
    /// object. This method is intended to be overriden to initialize the target object for
    /// each page that needs it.</remarks>
    protected override void InitializeTargetObject()
    {
        base.InitializeTargetObject();

        targetJobPosting = MultiStepWizards.PostAJob.JobPosting;

        if (targetJobPosting == null)
        {
            // MS-4172 - respect settings
            targetJobPosting       = CreateNewObject <msJobPosting>();
            targetJobPosting.Owner = ConciergeAPI.CurrentEntity.ID;
            // do NOT set this, let the default values to precedencetargetJobPosting.AllowOnlineResumeSubmission = , AllowOnlineResumeSubmission = true, IsApproved = false };
        }

        if (!string.IsNullOrWhiteSpace(ContextID))
        {
            MemberSuiteObject obj;
            using (var api = GetServiceAPIProxy())
                obj = api.Get(ContextID).ResultValue;

            if (obj == null)
            {
                GoToMissingRecordPage();
                return;
            }

            if (obj.ClassType.Equals(msJobPosting.CLASS_NAME, StringComparison.InvariantCultureIgnoreCase))
            {
                targetJobPosting = LoadObjectFromAPI <msJobPosting>(ContextID);

                if (targetJobPosting == null)
                {
                    GoToMissingRecordPage();
                    return;
                }
            }
        }
    }