Exemplo n.º 1
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);
        }
        public ActionResult Interview([Bind(Prefix = "Item1")] List <ViewModels.Interview> Rating, FormCollection frm)
        {
            int       Id_Interviewed;
            DBManager db = new DBManager();

            ViewModels.Interview objInt      = new ViewModels.Interview();
            InterviewComments    IntComments = new InterviewComments();
            int ReqId  = Convert.ToInt32(TempData["ReqId"]);
            int TempId = Convert.ToInt32(TempData["TempId"]);

            Id_Interviewed = Convert.ToInt32(TempData["Id_Interviewed"]);
            TempData.Keep();
            objInt.status   = frm["status"];
            objInt.comments = frm["comments"];
            string swg = System.Web.HttpContext.Current.Session["swgId"].ToString();

            IntComments.InterviewerId = swg;
            IntComments.Comments      = frm["comments"];
            IntComments.Status        = frm["status"];
            IntComments.Datetime      = DateTime.Now;
            if (Id_Interviewed != 0)
            {
                //Update interview table(new comments)
                db.UPDATEInterviews(Id_Interviewed, swg, IntComments.Status);
            }
            else
            {
                Id_Interviewed = db.Interviews(swg, objInt);
                int f = db.SetCandidateMapping(TempId, ReqId, Id_Interviewed);
                foreach (ViewModels.Interview i in Rating)
                {
                    int rating = i.Rating;
                    int skill  = i.SkillId;
                    db.SetRating(Id_Interviewed, rating, skill);
                }
            }
            int f1 = db.Interviewcomments(Id_Interviewed, swg, IntComments, TempId, ReqId);
            int f2 = db.UpdateCommentCandidate(frm["status"], TempId);

            return(RedirectToAction("GetCandidates", "Candidate", new { ReqId = ReqId }));
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        //SEt Interviewcomments
        public static string InterviewcommentsQuery(int InterviewerId, string swg, InterviewComments interview)
        {
            String Query = "Insert into Interviewcomments (InterviewId,empid,comments,datetime,interviewstatus) values(" + InterviewerId + ",'" + swg + "','" + interview.Comments + "','" + interview.Datetime + "','" + interview.Status + "')";

            return(Query);
        }