Exemplo n.º 1
0
 public static string InterviewOperation(InterviewResult operation, string action)
 {
     // var myval = new CommonOperation<InterviewResult>();//  PostingInterview() ;
     // return myval.Operation(operation, action);   //  myval.InterviewOperation(operation, positonID );
     // return CommonOperationExcute<InterviewResult>.CommonOperation(operation, action);
     return(Operation(operation, action));
 }
        public void SaveInitialCandidateInterviewResults(InterviewResultViewModel interviewResultViewModel, List <InterviewTask> currentInterviewTasks, ApplicationDbContext _context)
        {
            var interviewResult = new InterviewResult()
            {
                Value          = interviewResultViewModel.Value,
                GeneralComment = interviewResultViewModel.GeneralComment,
                Candidate      = interviewResultViewModel.Candidate
            };

            _context.InterviewResults.Add(interviewResult);
            _context.SaveChanges();

            for (int i = 0; i < interviewResultViewModel.Comment.Count; i++)
            {
                var interviewQuestionsAnswers = new InterviewQuestionsAnswers()
                {
                    InterviewTask = currentInterviewTasks[i],
                    Comment       = interviewResultViewModel.Comment[i],
                    Candidate     = interviewResultViewModel.Candidate
                };

                _context.InterviewQuestionsAnswers.Add(interviewQuestionsAnswers);
                _context.SaveChanges();
            }
        }
Exemplo n.º 3
0
        public InterviewResults TestExcelInterviewResultData()
        {
            InterviewResults interviewResults = new InterviewResults();
            InterviewResult  interviewResult  = new InterviewResult
            {
                Appointment    = "錄用",
                Results_Remark = "say\nsomthing\nsay\nsomthing\nsay\nsomthing\nsay\nsomthing"
            };

            interviewResults.InterviewResult = interviewResult;

            List <InterviewComments> interviewCommentsList = new List <InterviewComments>();
            InterviewComments        interviewComments     = new InterviewComments
            {
                Interviewer = "國基",
                Result      = "嘎U"
            };

            interviewCommentsList.Add(interviewComments);
            interviewCommentsList.Add(interviewComments);

            interviewResults.InterviewCommentsList = interviewCommentsList;

            return(interviewResults);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 面談結果
        /// </summary>
        /// <param name="interviewResults"></param>
        /// <param name="sheet"></param>
        /// <returns></returns>
        private Worksheet CreateInterviewResualtSheet(InterviewResults interviewResults, Worksheet sheet)
        {
            int rowCount = 11;
            ////任用評定
            InterviewResult interviewResult = interviewResults.InterviewResult;

            switch (interviewResult.Appointment)
            {
            case "錄用":
                sheet.Range["B5"].Text = "■" + interviewResult.Appointment;
                break;

            case "不錄用":
                sheet.Range["B6"].Text = "■" + interviewResult.Appointment;
                break;

            case "暫保留":
                sheet.Range["B7"].Text = "■" + interviewResult.Appointment;
                break;
            }
            ////面談評語
            List <InterviewComments> interviewCommentsList = interviewResults.InterviewCommentsList;

            if (interviewCommentsList.Count == 0)
            {
                rowCount += 2;
            }

            for (int i = 0; i < interviewCommentsList.Count; i++)
            {
                rowCount += 2;
                sheet.Range["B" + rowCount].Text = "面談者";
                sheet.Range["B" + rowCount].Style.HorizontalAlignment = HorizontalAlignType.Left;
                sheet.Range["C" + rowCount + ":D" + rowCount].Merge();
                sheet.Range["C" + rowCount + ":D" + rowCount].Style.Borders[BordersLineType.EdgeBottom].LineStyle = LineStyleType.Double;
                sheet.Range["C" + rowCount].Style.HorizontalAlignment = HorizontalAlignType.Left;
                sheet.Range["C" + rowCount].Text = interviewCommentsList[i].Interviewer;
                sheet.Range["F" + rowCount].Text = "面談結果";
                sheet.Range["F" + rowCount].Style.HorizontalAlignment = HorizontalAlignType.Left;
                sheet.Range["G" + rowCount + ":L" + rowCount].Merge();
                sheet.Range["G" + rowCount + ":L" + rowCount].Style.Borders[BordersLineType.EdgeBottom].LineStyle = LineStyleType.Double;
                sheet.Range["G" + rowCount].Style.HorizontalAlignment = HorizontalAlignType.Left;
                sheet.Range["G" + rowCount].Text = interviewCommentsList[i].Result;
            }
            rowCount++;
            sheet.Range["B" + (rowCount - interviewCommentsList.Count - 2) + ":M" + rowCount].BorderAround(LineStyleType.Medium);
            rowCount += 2;
            sheet.Range["B" + rowCount + ":C" + (rowCount + 1)].Merge();
            sheet.Range["B" + rowCount].Text = "備註";
            sheet.Range["B" + rowCount + ":C" + (rowCount + 1)].BorderAround(LineStyleType.Medium);
            rowCount += 3;
            sheet.Range["B" + rowCount + ":M" + (rowCount + 2)].Merge();
            sheet.Range["B" + rowCount].Style.HorizontalAlignment = HorizontalAlignType.Left;
            sheet.Range["B" + rowCount].Text = string.IsNullOrEmpty(interviewResult.Results_Remark) ? string.Empty : interviewResult.Results_Remark;
            sheet.Range["B" + rowCount + ":M" + (rowCount + 2)].BorderAround(LineStyleType.Medium);


            return(sheet);
        }
Exemplo n.º 5
0
        /// <summary>
        /// InterviewOperation is general Method. It can replace all follow 6 procedures
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="positonID"></param>
        /// <returns></returns>
        public static string SaveInterview(InterviewResult operation, string positonID)
        {
            var myval = new  PostingInterview();

            return(myval.InterviewOperation(operation, positonID));
            // var myval = new CommonOperation<InterviewResult>();//  PostingInterview() ;
            //  return myval.Operation(operation, positonID);   //  myval.InterviewOperation(operation, positonID );
        }
Exemplo n.º 6
0
        }                                                // null by default
        #endregion

        #region Public IServices Members

        /// <summary>
        /// Returns an HTML fragment suitable for inclusion in any standards-mode web page, which embeds a HotDocs interview
        /// directly in that web page.
        /// </summary>
        /// <param name="template">The template for which the interview will be requested.</param>
        /// <param name="answers">The initial set of answers to include in the interview.</param>
        /// <param name="settings">Settings that define various interview behavior.</param>
        /// <param name="markedVariables">A collection of variables that should be marked with special formatting in the interview.</param>
        /// <param name="logRef">A string to display in logs related to this request.</param>
        /// <returns>An object which contains an HTML fragment to be inserted in a web page to display the interview.</returns>
        public InterviewResult GetInterview(Template template, TextReader answers, InterviewSettings settings, IEnumerable <string> markedVariables, string logRef)
        {
            // Validate input parameters, creating defaults as appropriate.
            string logStr = logRef == null ? string.Empty : logRef;

            if (template == null)
            {
                throw new ArgumentNullException("template", string.Format(@"Cloud.Services.GetInterview: the ""template"" parameter passed in was null, logRef: {0}", logStr));
            }

            if (settings == null)
            {
                settings = new InterviewSettings();
            }

            // Configure interview settings
            settings.Settings["OmitImages"]       = "true";       // Instructs HDS not to return images used by the interview; we'll get them ourselves from the template location. (See GetInterviewFile below.)
            settings.Settings["OmitDefinitions"]  = "true";       // Instructs HDS not to return interview definitions; we'll get them ourselves from the template location. (See GetInterviewFile below.)
            settings.Settings["TempInterviewUrl"] = Util.GetInterviewImageUrl(settings, template);
            settings.Settings["InterviewDefUrl"]  = Util.GetInterviewDefinitionUrl(settings, template);
            settings.MarkedVariables = (string[])(markedVariables ?? new string[0]);

            // Get the interview.
            InterviewResult result = new InterviewResult();

            BinaryObject[] interviewFiles = null;
            using (var client = new SoapClient(_subscriberID, _signingKey, HostAddress, ProxyAddress))
            {
                interviewFiles = client.GetInterview(
                    template,
                    answers == null ? "" : answers.ReadToEnd(),
                    settings,
                    logRef
                    );

                // Throw an exception if we do not have exactly one interview file.
                // Although interviewFiles could potentially contain more than one item, the only one we care about is the
                // first one, which is the HTML fragment. All other items, such as interview definitions (.JS and .DLL files)
                // or dialog element images are not needed, because we can get them out of the package file instead.
                // We enforce this by setting the OmitImages and OmitDefinitions values above, so we will always have exactly one item here.
                if (interviewFiles.Length != 1)
                {
                    throw new Exception();
                }

                StringBuilder htmlFragment = new StringBuilder(Util.ExtractString(interviewFiles[0]));

                Util.AppendSdkScriptBlock(htmlFragment, template, settings);
                result.HtmlFragment = htmlFragment.ToString();
            }

            return(result);
        }
Exemplo n.º 7
0
        //public string UpdateResult(object position, int positionID)
        //{
        //    try
        //    {
        //        string sp = "dbo.tcdsb_LTO_PageInterview_Operation @Operate, @UserID, @SchoolYear, @PositionID, @CPNum, @Recommendation, @InterviewDate, @EffectiveDate, @OutCome, @Acceptance";
        //        var result = GeneralDataAccess.TextValue(sp, position);
        //        return result;
        //    }
        //    catch (Exception ex)
        //    {
        //        var exm = ex.Message;
        //        return "Failed";
        //    }
        //}
        //public string RecommendForHire(object position, int positionID)
        //{
        //    try
        //    {
        //        string sp = "dbo.tcdsb_LTO_PageInterview_Operation @Operate, @UserID, @SchoolYear, @PositionID, @CPNum, @Recommendation, @InterviewDate, @EffectiveDate, @OutCome, @Acceptance";
        //        var result = GeneralDataAccess.TextValue(sp, position);
        //        return result;
        //    }
        //    catch (Exception ex)
        //    {
        //        var exm = ex.Message;
        //        return "Failed";
        //    }
        //}

        //public string CheckInterviewCount(object position, int positionID)
        //{
        //    try
        //    {
        //        string sp = "dbo.tcdsb_LTO_PageInterview_OperationCheck @Operate, @UserID, @SchoolYear, @PositionID";
        //        var result = GeneralDataAccess.TextValue(sp, position);
        //        return result;
        //    }
        //    catch (Exception ex)
        //    {
        //        var exm = ex.Message;
        //        return "0";
        //    }
        //}
        //public string CheckSignOffCount(object position, int positionID)
        //{
        //    try
        //    {
        //        string sp = "dbo.tcdsb_LTO_PageInterview_OperationCheck @Operate, @UserID, @SchoolYear, @PositionID, @CPNum";
        //        var result = GeneralDataAccess.TextValue(sp, position);
        //        return result;
        //    }
        //    catch (Exception ex)
        //    {
        //        var exm = ex.Message;
        //        return "0";
        //    }
        //}
        //public string CheckHiringProcessStatus(object position, int positionID)
        //{
        //    try
        //    {
        //        string sp = "dbo.tcdsb_LTO_PageInterview_OperationCheck @Operate, @UserID, @SchoolYear, @PositionID";
        //        var result = GeneralDataAccess.TextValue(sp, position);
        //        return result;
        //    }
        //    catch (Exception ex)
        //    {
        //        var exm = ex.Message;
        //        return "Failed";
        //    }
        //}
        //public string InterviewSignOffAction(object position, int positionID)
        //{
        //    try
        //    {
        //        string sp = "dbo.tcdsb_LTO_PageInterview_SignOff @Operate, @UserID, @SchoolYear, @PositionID, @CPNum";
        //        var result = GeneralDataAccess.TextValue(sp, position);
        //        return result;
        //    }
        //    catch (Exception ex)
        //    {
        //        var exm = ex.Message;
        //        return "0";
        //    }
        //}
        public string InterviewOperation(InterviewResult position, string positonID)
        {
            try
            {
                string sp     = GetSP(position.Operate);
                var    result = GeneralDataAccess.TextValue(sp, position);
                return(result);
            }
            catch (Exception ex)
            {
                var exm = ex.Message;
                return("Failed");
            }
        }
Exemplo n.º 8
0
        public void InterviewOperationTest_return_Successfully()
        {
            //Arrange
            InterviewResult operation = new InterviewResult();

            operation.Operate    = "Update";
            operation.PositionID = "11220";
            operation.CPNum      = "00019270";
            var expect = "Successfully";
            //Act
            var result = CommonOperationExcute.InterviewOperation(operation, operation.PositionID);

            //Assert
            Assert.AreEqual(expect, result, $"  Interview Update is { result}");
        }
Exemplo n.º 9
0
        public void CommonOperationTest_For_Interview()
        {
            //Arrange
            var operation = new InterviewResult();

            operation.Operate    = "Update";
            operation.PositionID = "11220";
            operation.CPNum      = "00019270";
            var expect = "Successfully";
            //Act
            var result = CommonOperationExcute <InterviewResult> .CommonOperation(operation, "Update");

            //Assert
            Assert.AreEqual(expect, result, $"  Interview Update is { result}");
        }
Exemplo n.º 10
0
        private string Step10_RecommendForHire()
        {
            // 10 Recommend one interview candidate for hire
            //Arrange

            //Arrange
            string          result  = "";
            InterviewResult outcome = new InterviewResult()
            {
                Operate        = "Recommend",
                SchoolYear     = _schoolYear,
                PositionID     = _positionId.ToString(),
                UserID         = _principalId,
                CPNum          = _cpNum,
                Acceptance     = "1",
                OutCome        = "6", // interview
                Recommendation = "Principal interview comments from full testing process interview step 9",
                InterviewDate  = DateFC.YMD(DateTime.Now),
                EffectiveDate  = DateFC.YMD(DateTime.Now),
            };

            var parameter = new
            {
                Operate    = "",
                SchoolYear = _schoolYear,
                PositionID = _positionId
            };

            //Act
            string expect = "Successfully";
            List <ApplicantListSelect> interviewlist = SelectCandidateExe.Applicants(parameter);

            foreach (ApplicantListSelect applicant in interviewlist)
            {
                string teachername = applicant.TeacherName;
                outcome.CPNum = applicant.CPNum;

                if (outcome.Acceptance == "1" && outcome.OutCome == "6")
                {
                    result      = InterviewProcessExe.Recommend(outcome);
                    _hiredCpNum = outcome.CPNum;
                    break;
                }
            }
            //Assert
            Assert.AreEqual(expect, result, $" Recommented for hire of { outcome.CPNum } ");
            return(result);
        }
        public string ValidateInterviewResultsToTestResultLimits(InterviewResult interviewResult, InterviewResultViewModel interviewResultViewModel)
        {
            string message = null;

            if (interviewResultViewModel.GeneralComment == null)
            {
                message = $"Pagrindinis komentaras negali būti tuščias";
            }

            if (interviewResultViewModel.Value > 10)
            {
                message = $"Pokalbio balas negali būti didesnis negu 10";
            }

            return(message);
        }
Exemplo n.º 12
0
        public IActionResult AnswerQuestion([FromBody] object data)
        {
            _logger.LogInformation($"Req id:{rnd}\n Time: {now} Method: {System.Reflection.MethodInfo.GetCurrentMethod()}\n");

            dynamic req  = JObject.Parse(data.ToString());
            dynamic resp = new JObject();

            resp.status = "OK";

            string idvk   = req.idvk;
            string answer = req.answer;

            // получить айди вопроса из базы
            var user = new User();

            user = _FBRepo._ctx.USERS.Where(u => u.IDVK == idvk).FirstOrDefault();

            //получить айди ответа на этот вопрос
            int?ansId;

            ansId = _FBRepo._ctx.ANSWERVARIANTS.Where(aw => aw.QUESTION_ID == user.LASTOPENEDQUESTION_ID && aw.ANSWER_VARIANT == answer)
                    .Select(aw => aw.ID).FirstOrDefault();

            // занести ответ на вопрос в базу результатов
            var interviewResult = new InterviewResult()
            {
                USER_ID          = user.ID,
                QUESTIONID       = user.LASTOPENEDQUESTION_ID,
                ANSWER_VARIANTID = ansId
            };

            _FBRepo._ctx.INTERVIEWRESULTS.AddRange(interviewResult);
            _FBRepo._ctx.SaveChanges();

            //обнулить открытый вопрос юзера
            user = _FBRepo._ctx.USERS.Where(u => u.IDVK == idvk).FirstOrDefault();
            user.LASTOPENEDQUESTION_ID = null;
            _FBRepo._ctx.SaveChanges();

            string respStr = resp.ToString();

            _logger.LogInformation($"Req id:{rnd}\n Time: {now}\n Resp: {respStr}\n");

            return(Content(respStr));
        }
Exemplo n.º 13
0
        private string Step9_InterviewCandidats_Result()
        {
            // 9. candidate interview outcome
            //Arrange
            string          result  = "";
            InterviewResult outcome = new InterviewResult()
            {
                Operate        = "Update",
                SchoolYear     = _schoolYear,
                PositionID     = _positionId.ToString(),
                UserID         = _principalId,
                CPNum          = _cpNum,
                Acceptance     = "1",
                OutCome        = "6", // interview
                Recommendation = "Principal interview comments from full testing process interview step 9",
                InterviewDate  = DateFC.YMD(DateTime.Now),
                EffectiveDate  = DateFC.YMD(DateTime.Now),
            };

            var parameter = new
            { Operate    = "IncludeAll",
              SchoolYear = _schoolYear,
              PositionID = _positionId };

            List <ApplicantListSelect> interviewlist = SelectCandidateExe.Applicants(parameter);

            foreach (ApplicantListSelect applicant in interviewlist)
            {
                string teachername = applicant.TeacherName;
                outcome.CPNum = applicant.CPNum;
                result        = InterviewProcessExe.Update(outcome);
            }

            //Act

            string expect = "Successfully";

            //Assert
            Assert.AreEqual(expect, result, $" Interview outcome update result ");


            return(expect);
        }
Exemplo n.º 14
0
        /// <summary>
        /// 讀取面談結果的Sheet
        /// </summary>
        /// <param name="sheet"></param>
        /// <returns></returns>
        private DataTable[] ReadInterviewResultSheet(Worksheet sheet)
        {
            DataTable[]              dt                   = new DataTable[2];
            int                      row                  = 2; ////紀錄目前在哪一行
            InterviewResult          interviewResult      = new InterviewResult();
            List <InterviewComments> interviewCommentList = new List <InterviewComments>();

            if (sheet.Range["B" + row].Value.Trim() != "任用評定")
            {
                throw new Exception("面談結果sheet格式不符合");
            }

            row = 5;
            interviewResult.Appointment = string.Empty;
            ////任用評定
            for (int i = 5; i <= 7; i++)
            {
                if (sheet.Range["B" + row].Value.Trim().StartsWith("■"))
                {
                    interviewResult.Appointment = sheet.Range["B" + row].Value.Trim().RemoveStartsWithDelimiter("■");
                    break;
                }
                row++;
            }

            row = 13;
            ////面談評語
            while (sheet.Range["B" + row].Value.Trim() != "備註")
            {
                InterviewComments interviewComments = new InterviewComments
                {
                    Interviewer = sheet.Range["C" + row].Value.Trim(),
                    Result      = sheet.Range["G" + row].Value.Trim()
                };

                if (!interviewComments.TResultIsEmtpty())
                {
                    interviewCommentList.Add(interviewComments);
                }
                row++;
                if (sheet.Range["B" + row].Value.Trim() == "備註")
                {
                    break;
                }

                row++;
            }

            row += 3;
            interviewResult.Results_Remark = sheet.Range["B" + row].Value.Trim();
            List <InterviewResult> interviewResultList = new List <InterviewResult>
            {
                interviewResult
            };

            if (interviewCommentList.Count == 0)
            {
                interviewCommentList.Add(new InterviewComments());
            }

            dt[1] = interviewResultList.ListToDataTable();
            dt[0] = interviewCommentList.ListToDataTable();

            return(dt);
        }
 public void UpdateExistingCandidateInterviewResults(InterviewResultViewModel interviewResultViewModel, ApplicationDbContext _context, InterviewResult interviewResult)
 {
     _context.Attach(interviewResult);
     interviewResult.GeneralComment = interviewResultViewModel.GeneralComment;
     interviewResult.Value          = interviewResultViewModel.Value;
     _context.SaveChanges();
 }
Exemplo n.º 16
0
        ///<summary>
        ///	GetInterview returns an HTML fragment suitable for inclusion in any standards-mode web page, which embeds a HotDocs interview
        ///	directly in that web page.
        ///</summary>
        /// <param name="template">The template for which to return an interview.</param>
        /// <param name="answers">The answers to use when building an interview.</param>
        /// <param name="settings">The <see cref="InterviewSettings"/> to use when building an interview.</param>
        /// <param name="markedVariables">The variables to highlight to the user as needing special attention.
        /// 	This is usually populated with <see cref="AssembleDocumentResult.UnansweredVariables" />
        /// 	from <see cref="AssembleDocument" />.</param>
        /// <include file="../Shared/Help.xml" path="Help/string/param[@name='logRef']"/>
        /// <returns>Returns the results of building the interview as an <see cref="InterviewResult"/> object.</returns>
        public InterviewResult GetInterview(Template template, TextReader answers, InterviewSettings settings, IEnumerable<string> markedVariables, string logRef)
        {
            // Validate input parameters, creating defaults as appropriate.
            string logStr = logRef == null ? string.Empty : logRef;

            if (template == null)
                throw new ArgumentNullException("template", string.Format(@"Local.Services.GetInterview: the ""template"" parameter passed in was null, logRef: {0}", logStr));

            if (settings == null)
                settings = new InterviewSettings();

            // HotDocs Server reads the following settings out of the registry all the time; therefore these items are ignored when running against Server:
            //		settings.AddHdMainDiv
            //		settings.AnswerSummary.*
            //		settings.DefaultDateFormat
            //		settings.DefaultUnansweredFormat
            //		settings.HonorCmpUnansweredFormat
            //		settings.DisableAnswerSummary

            // HotDocs Server does not include the following settings in its .NET or COM APIs, so Util.AppendSdkScriptBlock (below)
            // includes them with the interview script block:
            //		settings.Locale
            //		settings.NextFollowsOutline
            //		settings.ShowAllResourceButtons

            hdsi.interviewFormat fmt;
            switch (settings.Format)
            {
                case InterviewFormat.JavaScript:
                    fmt = hdsi.interviewFormat.javascript;
                    break;
                case InterviewFormat.Silverlight:
                    fmt = hdsi.interviewFormat.Silverlight;
                    break;
                default:
                    fmt = hdsi.interviewFormat.Unspecified;
                    break;
            }

            // Configure the interview options
            hdsi.HDInterviewOptions itvOpts = hdsi.HDInterviewOptions.intOptNoImages; // Instructs HDS not to return images used by the interview; we'll get them ourselves from the template folder.

            if (settings.DisableDocumentPreview)
                itvOpts |= hdsi.HDInterviewOptions.intOptNoPreview; // Disables (omits) the Document Preview button on the interview toolbar.
            if (settings.DisableSaveAnswers)
                itvOpts |= hdsi.HDInterviewOptions.intOptNoSave; // Disables (omits) the Save Answers button on the interview toolbar.
            if (settings.RoundTripUnusedAnswers)
                itvOpts |= hdsi.HDInterviewOptions.intOptStateless; // Prevents original answer file from being encrypted and sent to the interview and then posted back at the end.

            // Get the interview.
            InterviewResult result = new InterviewResult();

            StringBuilder htmlFragment;
            using (var ansColl = new HotDocs.Server.AnswerCollection())
            {
                if (answers != null)
                {
                    if (answers.Peek() == 0xFEFF)
                        answers.Read(); // discard BOM if present
                    ansColl.XmlAnswers = answers.ReadToEnd();
                }

                if (markedVariables == null)
                    _app.UnansweredVariablesList = new string[0];
                else
                    _app.UnansweredVariablesList = markedVariables;

                htmlFragment = new StringBuilder(
                    _app.GetInterview(
                        template.GetFullPath(),
                        template.Key,
                        fmt,
                        itvOpts,
                        settings.InterviewRuntimeUrl,
                        settings.StyleSheetUrl + "/" + settings.ThemeName + ".css",
                        ansColl,
                        settings.PostInterviewUrl,
                        settings.Title,
                        Util.GetInterviewDefinitionUrl(settings, template),
                        null, // the path to which HDS should copy interview images; also the path that may become part of the DocumentPreviewStateString & passed to document preview handler
                        Util.GetInterviewImageUrl(settings, template),
                        settings.SaveAnswersUrl,
                        settings.DocumentPreviewUrl)
                    );
            }
            Util.AppendSdkScriptBlock(htmlFragment, template, settings);

            result.HtmlFragment = htmlFragment.ToString();
            return result;
        }
Exemplo n.º 17
0
        public static string RecommendHire(InterviewResult operation, string positonID)
        {
            var myval = new PostingInterview();

            return(myval.InterviewOperation(operation, positonID));
        }
Exemplo n.º 18
0
        /// <summary>
        /// Returns an HTML fragment suitable for inclusion in any standards-mode web page, which embeds a HotDocs interview
        /// directly in that web page.
        /// </summary>
        /// <param name="template">The template for which the interview will be requested.</param>
        /// <param name="answers">The initial set of answers to include in the interview.</param>
        /// <param name="settings">Settings that define various interview behavior.</param>
        /// <param name="markedVariables">A collection of variables that should be marked with special formatting in the interview.</param>
        /// <param name="logRef">A string to display in logs related to this request.</param>
        /// <returns>An object which contains an HTML fragment to be inserted in a web page to display the interview.</returns>
        public InterviewResult GetInterview(Template template, TextReader answers, InterviewSettings settings, IEnumerable<string> markedVariables, string logRef)
        {
            // Validate input parameters, creating defaults as appropriate.
            string logStr = logRef == null ? string.Empty : logRef;

            if (template == null)
                throw new ArgumentNullException("template", string.Format(@"Cloud.Services.GetInterview: the ""template"" parameter passed in was null, logRef: {0}", logStr));

            if (settings == null)
                settings = new InterviewSettings();

            // Configure interview settings
            settings.Settings["OmitImages"] = "true"; // Instructs HDS not to return images used by the interview; we'll get them ourselves from the template folder.
            settings.Settings["OmitDefinitions"] = "true"; // Instructs HDS not to return interview definitions; we'll get them ourselves from the template folder.
            settings.Settings["TempInterviewUrl"] = Util.GetInterviewImageUrl(settings, template);
            settings.Settings["InterviewDefUrl"] = Util.GetInterviewDefinitionUrl(settings, template);
            settings.MarkedVariables = (string[])(markedVariables ?? new string[0]);

            // Get the interview.
            InterviewResult result = new InterviewResult();
            BinaryObject[] interviewFiles = null;
            using (var client = new SoapClient(_subscriberID, _signingKey, HostAddress, ProxyAddress))
            {
                interviewFiles = client.GetInterview(
                    template,
                    answers == null ? "" : answers.ReadToEnd(),
                    settings,
                    logRef
                );

                // Throw an exception if we do not have exactly one interview file.
                // Although interviewFiles could potentially contain more than one item, the only one we care about is the
                // first one, which is the HTML fragment. All other items, such as interview definitions (.JS and .DLL files)
                // or dialog element images are not needed, because we can get them out of the package file instead.
                // We enforce this by setting the OmitImages and OmitDefinitions values above, so we will always have exactly one item here.
                if (interviewFiles.Length != 1)
                    throw new Exception();

                StringBuilder htmlFragment = new StringBuilder(Util.ExtractString(interviewFiles[0]));

                Util.AppendSdkScriptBlock(htmlFragment, template, settings);
                result.HtmlFragment = htmlFragment.ToString();
            }

            return result;
        }
Exemplo n.º 19
0
        public static string CheckSignOffCount(InterviewResult operation, string positonID)
        {
            var myval = new PostingInterview();

            return(myval.InterviewOperation(operation, positonID));
        }
Exemplo n.º 20
0
        public static string CheckHiringProcessStatus(InterviewResult operation, string positonID)
        {
            var myval = new PostingInterview();

            return(myval.InterviewOperation(operation, positonID));
        }
        /// <summary>
        /// <c>GetInterview</c> returns an HTML fragment suitable for inclusion in any standards-mode web page, which embeds a HotDocs interview
        /// directly in that web page.
        /// </summary>
        /// <param name="template">An instance of the Template class, for which the interview will be requested.</param>
        /// <param name="answers">The initial set of answers to include in the interview.</param>
        /// <param name="settings">Settings that define various interview behaviors.</param>
        /// <param name="markedVariables">A collection of variables that should be marked with special formatting in the interview.</param>
        /// <param name="logRef">A string to display in logs related to this request.</param>
        /// <returns>An object which contains an HTML fragment to be inserted in a web page to display the interview.</returns>
        public InterviewResult GetInterview(Template template, TextReader answers, InterviewSettings settings, IEnumerable<string> markedVariables, string logRef)
        {
            // Validate input parameters, creating defaults as appropriate.
            string logStr = logRef == null ? string.Empty : logRef;

            if (template == null)
                throw new ArgumentNullException("template", string.Format(@"WebServices.Services.GetInterview: The ""template"" parameter passed in was null, logRef: {0}.", logStr));

            if (settings == null)
                settings = new InterviewSettings();

            // Configure interview options
            InterviewOptions itvOpts = InterviewOptions.OmitImages; // Instructs HDS not to return images used by the interview; we'll get them ourselves from the template folder.
            if (settings.DisableDocumentPreview)
                itvOpts |= InterviewOptions.NoPreview; // Disables (omits) the Document Preview button on the interview toolbar.
            if (settings.DisableSaveAnswers)
                itvOpts |= InterviewOptions.NoSave; // Disables (omits) the Save Answers button on the interview toolbar.
            if (!settings.RoundTripUnusedAnswers)
                itvOpts |= InterviewOptions.ExcludeStateFromOutput; // Prevents original answer file from being encrypted and sent to the interview and then posted back at the end.

            // Get the interview.
            InterviewResult result = new InterviewResult();
            BinaryObject[] interviewFiles = null;

            using (Proxy client = GetProxy())
            {
                string fileName = GetRelativePath(template.GetFullPath());
                interviewFiles = client.GetInterview(
                    fileName,
                    answers == null ? null : new BinaryObject[] { Util.GetBinaryObjectFromTextReader(answers) }, // answers
                    settings.Format,
                    itvOpts,
                    markedVariables != null ? markedVariables.ToArray<string>() : null, // variables to highlight as unanswered
                    settings.PostInterviewUrl, // page to which interview will submit its answers
                    settings.InterviewRuntimeUrl, // location (under this app's domain name) where HotDocs Server JS files are available
                    settings.StyleSheetUrl + "/" + settings.ThemeName + ".css", // URL of CSS stylesheet (typically called hdsuser.css).  hdssystem.css must exist in same directory.
                    Util.GetInterviewImageUrl(settings, template), // interview images will be requested from GetInterviewFile.ashx, which will stream them from the template directory
                    !settings.DisableSaveAnswers ? settings.SaveAnswersUrl : "", //for the save answers button; if this is null the "Save Answers" button does not appear
                    !settings.DisableDocumentPreview ? settings.DocumentPreviewUrl : "", // document previews will be requested from here; if null the "Document Preview" button does not appear
                    Util.GetInterviewDefinitionUrl(settings, template)); // Interview definitions (Silverlight or JavaScript) will be requested from here -- careful with relative URLs!!
                if (interviewFiles != null)
                {
                    StringBuilder interview = new StringBuilder(Util.ExtractString(interviewFiles[0]));
                    Util.AppendSdkScriptBlock(interview, template, settings);
                    result.HtmlFragment = interview.ToString();

                    // The Web Services do not have a way to set the title of the template--it always uses the title from the component file.
                    // So here we are replacing the title that was put in the html fragment with the template's title, which may have
                    // been set later and does not match its component file.
                    result.HtmlFragment = Regex.Replace(result.HtmlFragment, "HDTemplateName=\\\".+?\"", "HDTemplateName=\"" + settings.Title + "\"");

                }
                SafeCloseClient(client, logRef);
            }
            return result;
        }
Exemplo n.º 22
0
        ///<summary>
        ///	GetInterview returns an HTML fragment suitable for inclusion in any standards-mode web page, which embeds a HotDocs interview
        ///	directly in that web page.
        ///</summary>
        /// <param name="template">The template for which to return an interview.</param>
        /// <param name="answers">The answers to use when building an interview.</param>
        /// <param name="settings">The <see cref="InterviewSettings"/> to use when building an interview.</param>
        /// <param name="markedVariables">The variables to highlight to the user as needing special attention.
        ///     This is usually populated with <see cref="AssembleDocumentResult.UnansweredVariables" />
        ///     from <see cref="AssembleDocument" />.</param>
        /// <include file="../Shared/Help.xml" path="Help/string/param[@name='logRef']"/>
        /// <returns>Returns the results of building the interview as an <see cref="InterviewResult"/> object.</returns>
        public InterviewResult GetInterview(Template template, TextReader answers, InterviewSettings settings, IEnumerable <string> markedVariables, string logRef)
        {
            // Validate input parameters, creating defaults as appropriate.
            string logStr = logRef == null ? string.Empty : logRef;

            if (template == null)
            {
                throw new ArgumentNullException("template", string.Format(@"Local.Services.GetInterview: the ""template"" parameter passed in was null, logRef: {0}", logStr));
            }

            if (settings == null)
            {
                settings = new InterviewSettings();
            }

            // HotDocs Server reads the following settings out of the registry all the time; therefore these items are ignored when running against Server:
            //		settings.AddHdMainDiv
            //		settings.AnswerSummary.*
            //		settings.DefaultDateFormat
            //		settings.DefaultUnansweredFormat
            //		settings.HonorCmpUnansweredFormat
            //		settings.DisableAnswerSummary

            // HotDocs Server does not include the following settings in its .NET or COM APIs, so Util.AppendSdkScriptBlock (below)
            // includes them with the interview script block:
            //		settings.Locale
            //		settings.NextFollowsOutline
            //		settings.ShowAllResourceButtons

            hdsi.interviewFormat fmt;
            switch (settings.Format)
            {
            case InterviewFormat.JavaScript:
                fmt = hdsi.interviewFormat.javascript;
                break;

            case InterviewFormat.Silverlight:
                fmt = hdsi.interviewFormat.Silverlight;
                break;

            default:
                fmt = hdsi.interviewFormat.Unspecified;
                break;
            }

            // Configure the interview options
            hdsi.HDInterviewOptions itvOpts = hdsi.HDInterviewOptions.intOptNoImages;             // Instructs HDS not to return images used by the interview; we'll get them ourselves from the template folder.

            if (settings.DisableDocumentPreview)
            {
                itvOpts |= hdsi.HDInterviewOptions.intOptNoPreview;                 // Disables (omits) the Document Preview button on the interview toolbar.
            }
            if (settings.DisableSaveAnswers)
            {
                itvOpts |= hdsi.HDInterviewOptions.intOptNoSave;                 // Disables (omits) the Save Answers button on the interview toolbar.
            }
            if (settings.RoundTripUnusedAnswers)
            {
                itvOpts |= hdsi.HDInterviewOptions.intOptStateless;                 // Prevents original answer file from being encrypted and sent to the interview and then posted back at the end.
            }
            // Get the interview.
            InterviewResult result = new InterviewResult();

            StringBuilder htmlFragment;

            using (var ansColl = new HotDocs.Server.AnswerCollection())
            {
                if (answers != null)
                {
                    if (answers.Peek() == 0xFEFF)
                    {
                        answers.Read();                         // discard BOM if present
                    }
                    ansColl.XmlAnswers = answers.ReadToEnd();
                }

                if (markedVariables == null)
                {
                    _app.UnansweredVariablesList = new string[0];
                }
                else
                {
                    _app.UnansweredVariablesList = markedVariables;
                }

                htmlFragment = new StringBuilder(
                    _app.GetInterview(
                        template.GetFullPath(),
                        template.Key,
                        fmt,
                        itvOpts,
                        settings.InterviewRuntimeUrl,
                        settings.StyleSheetUrl + "/" + settings.ThemeName + ".css",
                        ansColl,
                        settings.PostInterviewUrl,
                        settings.Title,
                        Util.GetInterviewDefinitionUrl(settings, template),
                        null,                         // the path to which HDS should copy interview images; also the path that may become part of the DocumentPreviewStateString & passed to document preview handler
                        Util.GetInterviewImageUrl(settings, template),
                        settings.SaveAnswersUrl,
                        settings.DocumentPreviewUrl)
                    );
            }
            Util.AppendSdkScriptBlock(htmlFragment, template, settings);

            result.HtmlFragment = htmlFragment.ToString();
            return(result);
        }
Exemplo n.º 23
0
 public Interview(DateTime date, InterviewResult result)
 {
     Date   = date;
     Result = result;
 }
        /// <summary>
        /// <c>GetInterview</c> returns an HTML fragment suitable for inclusion in any standards-mode web page, which embeds a HotDocs interview
        /// directly in that web page.
        /// </summary>
        /// <param name="template">An instance of the Template class, for which the interview will be requested.</param>
        /// <param name="answers">The initial set of answers to include in the interview.</param>
        /// <param name="settings">Settings that define various interview behaviors.</param>
        /// <param name="markedVariables">A collection of variables that should be marked with special formatting in the interview.</param>
        /// <param name="logRef">A string to display in logs related to this request.</param>
        /// <returns>An object which contains an HTML fragment to be inserted in a web page to display the interview.</returns>
        public InterviewResult GetInterview(Template template, TextReader answers, InterviewSettings settings, IEnumerable <string> markedVariables, string logRef)
        {
            // Validate input parameters, creating defaults as appropriate.
            string logStr = logRef == null ? string.Empty : logRef;

            if (template == null)
            {
                throw new ArgumentNullException("template", string.Format(@"WebServices.Services.GetInterview: the ""template"" parameter passed in was null, logRef: {0}", logStr));
            }

            if (settings == null)
            {
                settings = new InterviewSettings();
            }

            // Configure interview options
            InterviewOptions itvOpts = InterviewOptions.OmitImages;             // Instructs HDS not to return images used by the interview; we'll get them ourselves from the template folder.

            if (settings.DisableDocumentPreview)
            {
                itvOpts |= InterviewOptions.NoPreview;                 // Disables (omits) the Document Preview button on the interview toolbar.
            }
            if (settings.DisableSaveAnswers)
            {
                itvOpts |= InterviewOptions.NoSave;                 // Disables (omits) the Save Answers button on the interview toolbar.
            }
            if (!settings.RoundTripUnusedAnswers)
            {
                itvOpts |= InterviewOptions.ExcludeStateFromOutput;                 // Prevents original answer file from being encrypted and sent to the interview and then posted back at the end.
            }
            // Get the interview.
            InterviewResult result = new InterviewResult();

            BinaryObject[] interviewFiles = null;

            using (Proxy client = new Proxy(_endPointName))
            {
                string fileName = GetRelativePath(template.GetFullPath());
                interviewFiles = client.GetInterview(
                    fileName,
                    answers == null ? null : new BinaryObject[] { Util.GetBinaryObjectFromTextReader(answers) },                     // answers
                    settings.Format,
                    itvOpts,
                    markedVariables != null ? markedVariables.ToArray <string>() : null, // variables to highlight as unanswered
                    settings.PostInterviewUrl,                                           // page to which interview will submit its answers
                    settings.InterviewRuntimeUrl,                                        // location (under this app's domain name) where HotDocs Server JS files are available
                    settings.StyleSheetUrl + "/" + settings.ThemeName + ".css",          // URL of CSS stylesheet (typically called hdsuser.css).  hdssystem.css must exist in same directory.
                    Util.GetInterviewImageUrl(settings, template),                       // interview images will be requested from GetInterviewFile.ashx, which will stream them from the template directory
                    !settings.DisableSaveAnswers ? settings.SaveAnswersUrl : "",         //for the save answers button; if this is null the "Save Answers" button does not appear
                    !settings.DisableDocumentPreview ? settings.DocumentPreviewUrl : "", // document previews will be requested from here; if null the "Document Preview" button does not appear
                    Util.GetInterviewDefinitionUrl(settings, template));                 // Interview definitions (Silverlight or JavaScript) will be requested from here -- careful with relative URLs!!
                if (interviewFiles != null)
                {
                    StringBuilder interview = new StringBuilder(Util.ExtractString(interviewFiles[0]));
                    Util.AppendSdkScriptBlock(interview, template, settings);
                    result.HtmlFragment = interview.ToString();

                    // The Web Services do not have a way to set the title of the template--it always uses the title from the component file.
                    // So here we are replacing the title that was put in the html fragment with the template's title, which may have
                    // been set later and does not match its component file.
                    result.HtmlFragment = Regex.Replace(result.HtmlFragment, "HDTemplateName=\\\".+?\"", "HDTemplateName=\"" + settings.Title + "\"");
                }
                SafeCloseClient(client, logRef);
            }
            return(result);
        }