コード例 #1
0
ファイル: Candidates.cs プロジェクト: r3plica/Boomerang
        public static int Create(Candidate pCandidate)
        {
            Candidate oCandidate = new Candidate();
            SqlCommand SQLCmd = new SqlCommand();
            SQLCmd.CommandType = CommandType.StoredProcedure;
            SQLCmd.CommandText = "CreateCandidate";
            SQLCmd.Parameters.Add("Forename", SqlDbType.NVarChar, 255).Value = pCandidate.Forename;
            SQLCmd.Parameters.Add("Surname", SqlDbType.NVarChar, 255).Value = pCandidate.Surname;
            SQLCmd.Parameters.Add("Telephone", SqlDbType.NVarChar, 50).Value = pCandidate.Telephone;
            SQLCmd.Parameters.Add("Mobile", SqlDbType.NVarChar, 50).Value = pCandidate.Mobile;
            SQLCmd.Parameters.Add("Email", SqlDbType.NVarChar, 255).Value = pCandidate.Email;
            SQLCmd.Parameters.Add("DOB", SqlDbType.Date).Value = pCandidate.DOB;
            SQLCmd.Parameters.Add("Active", SqlDbType.Bit).Value = pCandidate.Active;
            SQLCmd.Parameters.Add("LastContactDate", SqlDbType.Date).Value = pCandidate.LastContactDate;
            SQLCmd.Parameters.Add("NiNumber", SqlDbType.NVarChar, 50).Value = pCandidate.NiNumber;
            SQLCmd.Parameters.Add("CRB", SqlDbType.Bit).Value = pCandidate.CRB;
            SQLCmd.Parameters.Add("References", SqlDbType.Bit).Value = pCandidate.References;
            SQLCmd.Parameters.Add("Interviewed", SqlDbType.Bit).Value = pCandidate.Interviewed;
            SQLCmd.Parameters.Add("TransportId", SqlDbType.Int).Value = pCandidate.TransportId;
            SQLCmd.Parameters.Add("UserId", SqlDbType.UniqueIdentifier).Value = new Guid(pCandidate.UserId);
            SQLCmd.Parameters.Add("Id", SqlDbType.Int).Direction = ParameterDirection.Output;
            BaseDataAccess.OpenConnection(SQLCmd);
            BaseDataAccess.ExecuteNonSelect(SQLCmd);
            BaseDataAccess.CloseConnection();

            return Convert.ToInt32(SQLCmd.Parameters["Id"].Value);
        }
コード例 #2
0
        public void Assess(Candidate candidate, Evaluation evaluation)
        {
            if (!candidate.Email.IsValid ())
                throw new InvalidEmailException ();

            var valueApprove = 7;
            var frontend = (evaluation.HTML >= valueApprove
                           && evaluation.CSS >= valueApprove
                           && evaluation.JavaScript >= valueApprove);
            var backend = (evaluation.Django >= valueApprove
                        && evaluation.Python >= valueApprove);

            var mobile = (evaluation.DevelopmentiOS >= valueApprove
                         || evaluation.DevelopmentAndroid >= valueApprove);

            if (frontend)
                Notify (candidate, JobType.Frontend);

            if (backend)
                Notify (candidate, JobType.BackEnd);

            if (mobile)
                Notify (candidate, JobType.Mobile);

            if (!frontend && !backend && !mobile)
                Notify (candidate, JobType.Generic);
        }
コード例 #3
0
    public void nextLevel()
    {
        contractshown = false;
        if(currentJob>=jobs.Count){
            Application.LoadLevel("End");
        }
        else{
       
            job = jobs[currentJob];

            CVGenerator cvGenerator = new CVGenerator();

            cvList = new List<CV>();
            int numberOfCVs = Random.Range(4, 7);
            for (int num = 0; num < numberOfCVs; num++)
            {
                Candidate candidate = new Candidate(ref maleSprites, ref femaleSprites);
                cvList.Add(cvGenerator.generateCV(candidate));
            }

            currentCV = 0;

            renderCV();
            showJob();
            refreshHUD();
        }
    }
コード例 #4
0
        private IEnumerable<decimal> GetScores(Candidate candidate)
        {
            Option option;
            try
            {
                option = candidate.Options.First();
            }
            catch (ArgumentNullException)
            {
                throw new ArgumentException("Candidate has no option.");
            }

            var combinations = new[] { option.MajorSubjectCombination,
                                       option.MajorSubjectCombination1,
                                       option.MajorSubjectCombination2,
                                       option.MajorSubjectCombination3 };

            decimal bonus = 0;
            if (candidate.HasPrivilege)
                bonus += 1;
            bonus += candidate.Region.Bonus;
            bonus += candidate.Beneficiary.Bonus;

            foreach (var combination in combinations)
                if (combination != null)
                    yield return ScoreFromCombination(candidate, combination.SubjectCombination) + bonus;
                else
                    yield break;
        }
コード例 #5
0
        public List<Candidate> ShowCandidates()
        {
            connection.Open();
            string query = string.Format("SELECT * FROM t_Candidate");
            SqlCommand aCommand = new SqlCommand(query, connection);
            SqlDataReader aReader = aCommand.ExecuteReader();

            List<Candidate> candidates = new List<Candidate>();
            if (aReader.HasRows)
            {

                while (aReader.Read())
                {
                    Candidate aCandidate = new Candidate();

                    aCandidate.CandidateID = (int)aReader[0];
                    aCandidate.Name = aReader[1].ToString();
                    aCandidate.Symbol = aReader[2].ToString();

                    candidates.Add(aCandidate);
                }

            }
            connection.Close();
            return candidates;
        }
コード例 #6
0
    private void generateFervorHobbySkill(Candidate candidate)
    {
        int value = candidate.getPerceivedStat("fervor");
        List<string[]> options = new List<string[]>();
        if (value > 70)
        {
            options.Add(checkSecondaryStat(candidate, "physique", "Dancing", true));
            options.Add(checkSecondaryStat(candidate, "morality", "Pyromania", false));
            options.Add(checkSecondaryStat(candidate, "ambition", "Voodoo", true));
            options.Add(entry("skill", "Chanting"));

        }
        else if (value > 50)
        {
            options.Add(entry("hobby", "Meditation"));
            options.Add(entry("hobby", "Chanting"));
            options.Add(entry("hobby", "Sedative Experimentation"));
        }
        else
        {
            options.Add(entry("skill", "Meditation"));
            options.Add(entry("skill", "Sedative Experimentation"));
            options.Add(checkSecondaryStat(candidate, "ambition", "Sitting Quietly", false));
        }
        addOptionToOutputs(options[Random.Range(0, options.Count)]);
    }
コード例 #7
0
 public void Save(Candidate obj)
 {
     if (obj.Id == 0)
         context.Entry(obj).State = System.Data.Entity.EntityState.Added;
     else
         context.Entry(obj).State = System.Data.Entity.EntityState.Modified;
     context.SaveChanges();
 }
コード例 #8
0
 public Dictionary<string, string> generateSkillsHobbies(Candidate candidate)
 {
     foreach (string stat in candidate.statNames)
     {
         generateHobbySkillForStat(stat, candidate);
     }
     return outputs;
 }
コード例 #9
0
ファイル: Sphere.cs プロジェクト: renketsu0/oculus_data_vis
 public void Initialize(Score extScore)
 {
     score = extScore;
     candidate = score.candidate;
     //		candidate.color = ColorPicker.colors.Dequeue();
     transform.localScale = new Vector3(1,1,1) * 0.01f * score.percent;
     // assign or access candidate's color
 }
コード例 #10
0
        public EnrollingCandidate(Candidate candidate, IEnumerable<EnrollingMajor> options, IEnumerable<decimal> scores)
        {
            this.options = options.ToArray();
            this.scores = scores.ToArray();

            this.candidate = candidate;

            currentOption = -1;
        }
コード例 #11
0
ファイル: Session.cs プロジェクト: NosDeveloper2/RecruitGenie
 public Session( User user, Candidate candidate, bool isError,
     string displayError, string error)
 {
     User = user;
     Candidate = candidate;
     IsError = isError;
     DisplayError = displayError;
     Error = error;
 }
コード例 #12
0
        static bool IsEFCodeFirstConventionalKey(Candidate candidate) {
            var member = candidate.Member;
            var memberName = member.Name;

            if(String.Compare(memberName, "id", true) != 0 && String.Compare(memberName, member.DeclaringType.Name + "id", true) != 0)
                return false;

            return ORDERED_SORTABLE_TYPES.Contains(candidate.Type);
        }
コード例 #13
0
ファイル: CV.cs プロジェクト: Scythus/InhumanResources
    public CV(Candidate candidate, string cvContents, Sprite cvPic)
    {

        this.candidate = candidate;

        // Generate a CV
        this.cvText = cvContents;
        this.cvPic = cvPic;
    }
コード例 #14
0
ファイル: Vote.cs プロジェクト: yuxuanchen1997/VotePlusPlus
 public Vote(VoteEvent myVoteEvent, Voter v, int uid)
 {
     this.v = v;
     this.c = myVoteEvent.GetCandidateByUid(uid);
     if (this.c == null)
     {
         Log myLog = new Log("The Candidate is null");
         LogStore.LogList.Add(myLog);
     }
 }
        public void Candidate(User user, Candidate candidate)
        {
            AcademyLoginProvider.Instance.LoginUser(user);
            this.LoginPage.WaitForUserName();
            this.LoginPage.Validator.ValidateUserName(user.Username);

            this.CandidateFormPage.Navigate();

            this.CandidateFormPage.Candidate(candidate);
        }
コード例 #16
0
    private string makeHeader(Candidate candidate)
    {
        string dob = Random.Range(1, 28).ToString() + "/";
        dob += Random.Range(1, 12).ToString() + "/";
        dob += calculateDOB(candidate);

        string headerText = "Date of Birth: " + dob + "\n";
        headerText += "Gender: " + candidate.getGender()+ "\n\n";

        return headerText;
    }
コード例 #17
0
 public void ShowCandidatesSymbolInComboBox()
 {
     Candidate aCandidate = new Candidate();
     List<Candidate> candidates = aCandidateEntryBll.ShowCandidates();
     foreach (Candidate candidate in candidates)
     {
         selectSymbolOfCandidateComboBox.Items.Add(candidate);
     }
     selectSymbolOfCandidateComboBox.ValueMember = "CandidateID";
     selectSymbolOfCandidateComboBox.DisplayMember = "Symbol";
 }
コード例 #18
0
    protected void btn_Login_Click(object sender, EventArgs e)
    {
        try
        {
            if (IsValidEmail(txt_LoginName.Text) && IsValidPassword(txt_Password.Text))
            {
                //Utils.csIsSystemUser = false;

                Candidate oCandidate = new Candidate();
                CandidateBO oCandidateBO = new CandidateBO();
                Result oResult = new Result();

                oCandidate.CandidateEmail = txt_LoginName.Text;
                oCandidate.CandidatePassword = txt_Password.Text;
                oCandidate.CandidateLoginTime = DateTime.Now;

                try
                {
                    oResult = oCandidateBO.CandidateLogin(oCandidate);

                    if (oResult.ResultIsSuccess)
                    {
                        Utils.SetSession(SessionManager.csLoggedUser, (CandidateForExam)oResult.ResultObject);

                        Response.Redirect(ContainerManager.csMasterContainerCandidate + "?option=" + OptionManager.csExamProcess);
                    }
                    else
                    {
                        lbl_Error.ForeColor = Color.Red;
                        lbl_Error.Text = oResult.ResultMessage;
                    }
                }
                catch (Exception oEx)
                {
                    lbl_Error.ForeColor = Color.Red;
                    lbl_Error.Text = "Login Failed.";
                }
            }
            else
            {
                lbl_Error.ForeColor = Color.Red;
                lbl_Error.Text = "Email & Password Required.";
            }

        }
        catch (Exception oEx2)
        {
            lbl_Error.ForeColor = Color.Red;
            lbl_Error.Text = "Login Failed.";
        }
    }
コード例 #19
0
        public string Save(Candidate aCandidate)
        {
            connection.Open();
            string query = string.Format("INSERT INTO t_Candidate VALUES('{0}','{1}')", aCandidate.Name,
                aCandidate.Symbol);

               SqlCommand aCommand = new SqlCommand(query, connection);
               int affectedRow =  aCommand.ExecuteNonQuery();
            connection.Close();
            if (affectedRow>0)

                return "Save Successful";
            return "Save Failed.";
        }
コード例 #20
0
 private string makeJobHistory(Candidate candidate)
 {
     // Get the job history for a candidate
     int numJobs = calculateNumberOfJobs(candidate.getAge());
     string jobList = "";
     for (int x=0; x<numJobs; x++)
     {
         string job = generateJob(candidate);
         jobList += job;
         jobList += "\n";
     }
     string jobOutput = "Employment History:\n";
     jobOutput += jobList;
     return jobOutput;
 }
コード例 #21
0
    private void LoadMenuBarByPermission(SystemUser oSystemUser, Candidate oCandidate)
    {
        String sJSMenu = String.Empty;
        String sLoadedControlName = String.Empty;

        try
        {
            PanelHorizontalMenu.Controls.Clear();

            sLoadedControlName = Utils.GetSession(SessionManager.csLoadedPage).ToString();

            if (oSystemUser != null && oCandidate == null)
            {
                //lbl_ControlName.Text = sLoadedControlName.Substring(0,sLoadedControlName.IndexOf("."));

                if (oSystemUser.SystemUserName.ToLower().Equals(LoginManager.csAdministrator))
                {
                    if (sLoadedControlName.Equals(ControlManager.csSystemUserMainPage) || sLoadedControlName.Equals(ControlManager.csCategoryEntry) || sLoadedControlName.Equals(ControlManager.csCategoryModification) || sLoadedControlName.Equals(ControlManager.csChangePassword) || sLoadedControlName.Equals(ControlManager.csExamEntry) || sLoadedControlName.Equals(ControlManager.csQuestionModification) || sLoadedControlName.Equals(ControlManager.csSystemUserEntry) || sLoadedControlName.Equals(ControlManager.csSystemUserModification) || sLoadedControlName.Equals(ControlManager.csQuestionEntry) || sLoadedControlName.Equals(ControlManager.csExamMofication) || sLoadedControlName.Equals(ControlManager.csLabelEntryAndModification))
                    {
                        sJSMenu = File.ReadAllText(DirectoryManager.csJSMenuBarDirectory + FileManager.csAdminSystemUserMenuFile, System.Text.Encoding.Default);
                        PanelHorizontalMenu.Controls.Add(new LiteralControl(sJSMenu));
                    }
                    else if (sLoadedControlName.Equals(ControlManager.csCandidateSetup) || sLoadedControlName.Equals(ControlManager.csCandidateModification) || sLoadedControlName.Equals(ControlManager.csEvaluateCandidate) || sLoadedControlName.Equals(ControlManager.csExamineProcess) || sLoadedControlName.Equals(ControlManager.csQuestionSetup) || sLoadedControlName.Equals(ControlManager.csQuestionSetupRemove) || sLoadedControlName.Equals(ControlManager.csQuestionReportForAnExam) || sLoadedControlName.Equals(ControlManager.csResultView) || sLoadedControlName.Equals(ControlManager.csCandidateExtend))
                    {
                        sJSMenu = File.ReadAllText(DirectoryManager.csJSMenuBarDirectory + FileManager.csAdminSystemUserSetupMenuFile, System.Text.Encoding.Default);
                        PanelHorizontalMenu.Controls.Add(new LiteralControl(sJSMenu));
                    }
                }
                else //some controls will not shown for the Non Admin
                {
                    if (sLoadedControlName.Equals(ControlManager.csSystemUserMainPage) || sLoadedControlName.Equals(ControlManager.csChangePassword) || sLoadedControlName.Equals(ControlManager.csQuestionModification) || sLoadedControlName.Equals(ControlManager.csQuestionEntry))
                    {
                        sJSMenu = File.ReadAllText(DirectoryManager.csJSMenuBarDirectory + FileManager.csNonAdminSystemUserMenuFile, System.Text.Encoding.Default);
                        PanelHorizontalMenu.Controls.Add(new LiteralControl(sJSMenu));
                    }
                    else if (sLoadedControlName.Equals(ControlManager.csEvaluateCandidate) || sLoadedControlName.Equals(ControlManager.csExamineProcess) || sLoadedControlName.Equals(ControlManager.csQuestionSetup) || sLoadedControlName.Equals(ControlManager.csQuestionSetupRemove) || sLoadedControlName.Equals(ControlManager.csQuestionReportForAnExam) || sLoadedControlName.Equals(ControlManager.csResultView))
                    {
                        sJSMenu = File.ReadAllText(DirectoryManager.csJSMenuBarDirectory + FileManager.csNonAdminSystemUserSetupMenuFile, System.Text.Encoding.Default);
                        PanelHorizontalMenu.Controls.Add(new LiteralControl(sJSMenu));
                    }
                }
            }
        }
        catch (Exception oEx)
        {

        }
    }
コード例 #22
0
 public static bool Received(AuthenticationServer form, PacketContent pc, Candidate c)
 {
     _form = form;
     PlayerRecvPackets msgType = (PlayerRecvPackets)pc.GetMsgType();
     bool ret = true;
     switch (msgType)
     {
         case PlayerRecvPackets.Login:
             ret = CheckCredentials(pc, c);
             break;
         case PlayerRecvPackets.ServerSelect:
             ret = PassNewPlayerToServer(pc, c);
             break;
     }
     return ret;
 }
コード例 #23
0
ファイル: Candidates.cs プロジェクト: r3plica/Boomerang
 public static Candidate Get(int Id)
 {
     Candidate oCandidate = new Candidate();
     SqlCommand SQLCmd = new SqlCommand();
     SQLCmd.CommandType = CommandType.StoredProcedure;
     SQLCmd.CommandText = "GetCandidate";
     SQLCmd.Parameters.Add("Id", SqlDbType.Int).Value = Id;
     BaseDataAccess.OpenConnection(SQLCmd);
     SqlDataReader dr = SQLCmd.ExecuteReader(CommandBehavior.CloseConnection);
     while (dr.Read())
     {
         oCandidate = Parse(dr);
     }
     dr.Close();
     return oCandidate;
 }
コード例 #24
0
ファイル: CandidateLogDao.cs プロジェクト: vuchannguyen/lg-py
        /// <summary>
        /// Write Log For Employee
        /// </summary>
        /// <param name="oldInfo"></param>
        /// <param name="newInfo"></param>
        /// <param name="action"></param>
        public void WriteLogForCandidate(Candidate oldInfo, Candidate newInfo, ELogAction action)
        {
            try
            {
                if (newInfo == null)
                {
                    return;
                }

                MasterLog objMasterLog = new MasterLog();

                string logId = commonDao.UniqueId;

                switch (action)
                {
                    case ELogAction.Insert:
                        // Insert to Master Log
                        commonDao.InsertMasterLog(logId, newInfo.CreatedBy, ELogTable.Candidate.ToString(), action.ToString());
                        // Write Insert Log
                        WriteInsertLogForCandidate(newInfo, logId);
                        break;
                    case ELogAction.Update:
                        // Insert to Master Log
                        commonDao.InsertMasterLog(logId, newInfo.UpdatedBy, ELogTable.Candidate.ToString(), action.ToString());
                        // Write Update Log
                        bool isUpdated = WriteUpdateLogForCandidate(newInfo, logId);
                        if (!isUpdated)
                        {
                            commonDao.DeleteMasterLog(logId);
                        }
                        break;
                    case ELogAction.Delete:
                        // Insert to Master Log
                        commonDao.InsertMasterLog(logId, newInfo.UpdatedBy, ELogTable.Candidate.ToString(), action.ToString());
                        // Write Delete Log
                        string key = newInfo.ID.ToString() + " [" + newInfo.FirstName + " " + newInfo.MiddleName + " " + newInfo.LastName + "]";
                        commonDao.InsertLogDetail(logId, "ID", "Key for Delete", key, null);
                        break;
                }

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #25
0
 private List<string> generateSkillHobbies(Candidate candidate)
 {
     HobbyGenerator hg = new HobbyGenerator();
     Dictionary<string, string> skillHobbies = hg.generateSkillsHobbies(candidate);
     string skills = "\nSkills:\n";
     string hobbies = "\nHobbies:\n";
     foreach (string item in skillHobbies.Keys)
     {
         if (skillHobbies[item] == "skill")
         {
             skills += item + "\n";
         } else
         {
             hobbies += item + "\n";
         }
     }
     return new List<string> { skills, hobbies };
 }
コード例 #26
0
 public void generateHobbySkillForStat(string stat, Candidate candidate)
 {
     if (stat == "intelligence")
     {
         generateIntelligenceHobbySkill(candidate);
     } else if (stat == "morality")
     {
         generateMoralityHobbySkill(candidate);
     } else if (stat == "ambition")
     {
         generateAmbitionHobbySkill(candidate);
     } else if (stat == "fervor")
     {
         generateFervorHobbySkill(candidate);
     } else if (stat == "physique")
     {
         generatePhysiqueHobbySkill(candidate);
     }
 }
コード例 #27
0
	public CV generateCV(Candidate candidate)
    {
        // Generate a CV object for a given candidate
        string cvText = "";
        cvText += makeHeader(candidate);
        cvText += makeJobHistory(candidate);

        List<string> skillHobbies = generateSkillHobbies(candidate);
        if(skillHobbies[0].Length != 9)
            cvText += skillHobbies[0];
        if(skillHobbies[1].Length != 9)
            cvText += skillHobbies[1];

        cvText += doctorsNote(candidate);

        Sprite cvPic = candidate.getCVPic();

        CV cv = new CV(candidate, cvText, cvPic);
        return cv;
    }
コード例 #28
0
        public void Test_candidate_7_in_HTML_CSS_and_Javascript_Python_Django()
        {
            var address = "*****@*****.**";

            Candidate candidate = new Candidate ();
            candidate.Email = new Email(address);
            candidate.Nome = "Bernardo Bruning";

            Evaluation evaluation = new Evaluation ();
            evaluation.HTML = 7;
            evaluation.CSS = 7;
            evaluation.JavaScript = 7;
            evaluation.Python = 7;
            evaluation.Django = 7;

            _service.Assess (candidate, evaluation);

            VerifySendEmailService ("message_frontend", address);
            VerifySendEmailService ("message_backend", address);
        }
コード例 #29
0
ファイル: Storyteller.cs プロジェクト: fgeraci/CS195-Core
    private static string FormatStory(Candidate candidate)
    {
        string output = "";
        foreach (ExplorationEdge edge in candidate.Path)
        {
            TransitionEvent evt = edge.Events[0];
            EventDescriptor desc = evt.Descriptor;
            string name = desc.Name;

            string[] members = new string[evt.Participants.Length];
            for (int i = 0; i < members.Length; i++)
                members[i] = FormatId(evt.Participants[i]);

            output += FormatLine(name, members);
            if (desc.Sentiments.Length > 0)
              output += " (" + string.Join(", ", desc.Sentiments) + ")";
            output += "\n";
        }
        return output;
    }
コード例 #30
0
 public static void ShellSort(Candidate[] inputArray)
 {
     uint j = 0;
     Candidate temp = new Candidate();
     uint increment = (uint)(inputArray.Length) / 2;
     while (increment > 0)
     {
         for (uint index = 0; index < inputArray.Length; index++)
         {
             j = index;
             temp = inputArray[index];
             while ((j >= increment) && inputArray[j - increment].Votes < temp.Votes)
             {
                 inputArray[j] = inputArray[j - increment];
                 j = j - increment;
             }
             inputArray[j] = temp;
         }
         increment /= 2;
     }
 }
コード例 #31
0
        private XmlResource CreateUpdatedResource(Enums.ResourceType resourceType, string id,
                                                  string fieldAlias, string fieldValue)
        {
            XmlResource result = null;

            switch (resourceType)
            {
            case Enums.ResourceType.Client:
                result = new Client()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Activity:
                result = new Activity()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Sales:
                result = new Sales()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Contract:
                result = new Contract()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Process:
                result = new Process()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Job:
                result = new Job()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Recruiter:
                result = new Recruiter()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Resume:
                result = new Resume()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;

            case Enums.ResourceType.Candidate:
                result = new Candidate()
                {
                    Id = id
                };
                result.DictionaryValues[fieldAlias] = fieldValue;
                break;
            }
            return(result);
        }
コード例 #32
0
 public void SaveCandidate(Candidate candidate)
 {
     CandidateDb.Add(candidate);
     SaveChanges();
 }
コード例 #33
0
 public void Post([FromBody] Candidate candidate)
 {
     candidateList.Add(candidate);
 }
コード例 #34
0
        /// <summary>
        /// 將 Log 存入 DB
        /// </summary>
        /// <param name="candidate">描述待處理檔案的資訊</param>
        /// <param name="target">byte[]</param>
        private void SaveLogToDB(Candidate candidate, byte[] target)
        {
            DBLogHandler logHandler = new DBLogHandler();

            logHandler.Perform(candidate, target);
        }
コード例 #35
0
        private float[] performMultipleAnnotationAssignment(String annotationType)
        {
            float[] statistics = new float[3] {
                0, 0, 0
            };                                             //[0] = recall, [1] = precision, [2]  total
            int totalMatch = 0;

            annotationType = annotationType.ToUpper();
            if (annotationType != "WHO" && annotationType != "WHEN" && annotationType != "WHERE")
            {
                return(statistics);
            }

            String          strAnnotation    = "";
            Action <string> assignmentMethod = null;

            string[] arrAnnotations         = null;
            bool     foundMatchingCandidate = false;

            switch (annotationType)
            {
            case "WHO":
                strAnnotation = annotationCurrent.Who;
                if (strAnnotation != null)
                {
                    //System.Console.WriteLine("WHO Annotation: " + strAnnotation);
                    assignmentMethod = annotation =>
                    {
                        foreach (var candidate in listWhoCandidates)
                        {
                            if (candidate.Value == annotation)
                            {
                                candidate.IsWho        = true;
                                foundMatchingCandidate = true;
                                //System.Console.WriteLine("WHO\nBEFORE: " + (((candidate.Position - 2) >= 0) ? listLatestTokenizedArticle[candidate.Position - 2].Value : "N/A"));
                                //string[] temp = candidate.Value.Split(' ');
                                //System.Console.WriteLine("AFTER: " + (((candidate.Position + temp.Length - 1) <= listLatestTokenizedArticle.Count()) ? listLatestTokenizedArticle[candidate.Position + temp.Length - 1].Value : "N/A"));
                                break;
                            }
                            else if (annotation.Contains(candidate.Value))
                            {
                                //System.Console.WriteLine("'WHO' Under-extracted: " + candidate.Value + " - " + annotation);
                            }
                            else if (candidate.Value.Contains(annotation))
                            {
                                //System.Console.WriteLine("'WHO' Over-extracted: " + candidate.Value + " - " + annotation);
                            }
                            else
                            {
                                //System.Console.WriteLine("'WHO' Complete Mismatch: " + candidate.Value + " - " + annotation);
                            }
                        }
                    };
                }
                break;

            case "WHEN":
                strAnnotation = annotationCurrent.When;
                if (strAnnotation != null)
                {
                    //System.Console.WriteLine("WHEN Annotation: " + strAnnotation);
                    assignmentMethod = annotation =>
                    {
                        foreach (var candidate in listWhenCandidates)
                        {
                            if (candidate.Value == annotation)
                            {
                                candidate.IsWhen       = true;
                                foundMatchingCandidate = true;
                                //System.Console.WriteLine("WHEN\nBEFORE: " + (((candidate.Position - 2) >= 0) ? listLatestTokenizedArticle[candidate.Position - 2].Value : "N/A"));
                                //string[] temp = candidate.Value.Split(' ');
                                //System.Console.WriteLine("AFTER: " + (((candidate.Position + temp.Length - 1) <= listLatestTokenizedArticle.Count()) ? listLatestTokenizedArticle[candidate.Position + temp.Length - 1].Value : "N/A"));
                                break;
                            }
                            else if (annotation.Contains(candidate.Value))
                            {
                                //System.Console.WriteLine("'WHEN' Under-extracted: " + candidate.Value + " - " + annotation);
                            }
                            else if (candidate.Value.Contains(annotation))
                            {
                                //System.Console.WriteLine("'WHEN' Over-extracted: " + candidate.Value + " - " + annotation);
                            }
                            else
                            {
                                //System.Console.WriteLine("'WHEN' Complete Mismatch: " + candidate.Value + " - " + annotation);
                            }
                        }
                    };
                }
                break;

            case "WHERE":
                strAnnotation = annotationCurrent.Where;
                if (strAnnotation != null)
                {
                    //System.Console.WriteLine("WHERE Annotation: " + strAnnotation);
                    assignmentMethod = annotation =>
                    {
                        foreach (var candidate in listWhereCandidates)
                        {
                            if (candidate.Value == annotation)
                            {
                                candidate.IsWhere      = true;
                                foundMatchingCandidate = true;
                                //System.Console.WriteLine("WHERE\nBEFORE: " + (((candidate.Position - 2) >= 0) ? listLatestTokenizedArticle[candidate.Position - 2].Value : "N/A"));
                                //string[] temp = candidate.Value.Split(' ');
                                //System.Console.WriteLine("AFTER: " + (((candidate.Position + temp.Length - 1) <= listLatestTokenizedArticle.Count()) ? listLatestTokenizedArticle[candidate.Position + temp.Length - 1].Value : "N/A"));
                                break;
                            }
                            else if (annotation.Contains(candidate.Value))
                            {
                                //System.Console.WriteLine("'WHERE' Under-extracted: " + candidate.Value + " - " + annotation);
                            }
                            else if (candidate.Value.Contains(annotation))
                            {
                                //System.Console.WriteLine("'WHERE' Over-extracted: " + candidate.Value + " - " + annotation);
                            }
                            else
                            {
                                //System.Console.WriteLine("'WHERE' Complete Mismatch: " + candidate.Value + " - " + annotation);
                            }
                        }
                    };
                }
                break;
            }

            if (strAnnotation.Count() <= 0 || strAnnotation == "N/A")
            {
                return(statistics);
            }

            arrAnnotations = strAnnotation.Split(';');

            for (int r = 0; r < arrAnnotations.Length; r++)
            {
                if (arrAnnotations[r].Length > 0 && arrAnnotations[r][0] == ' ')
                {
                    arrAnnotations[r] = arrAnnotations[r].Substring(1);
                }

                ////System.Console.WriteLine(annotationType + " ANNOTATIONS-" + arrAnnotations[r]);
                if (assignmentMethod != null)
                {
                    assignmentMethod(arrAnnotations[r]);
                }

                if (!foundMatchingCandidate)
                {
                    int      i = -1;
                    String[] wordForWordAnnotation = arrAnnotations[r].Split(' ');
                    for (int ctr = 0; ctr < listLatestTokenizedArticle.Count; ctr++)
                    {
                        if (wordForWordAnnotation[0].Contains(listLatestTokenizedArticle[ctr].Value))
                        {
                            i = ctr;
                            break;
                        }
                    }

                    if (i > -1)
                    {
                        //add as candidate
                        int startIndex = i;
                        int tempWs     = listLatestTokenizedArticle[i].Frequency;

                        for (int ctr = startIndex; ctr < startIndex + wordForWordAnnotation.Count(); ctr++)
                        {
                            if (ctr < listLatestTokenizedArticle.Count && listLatestTokenizedArticle[ctr].Frequency > tempWs)
                            {
                                tempWs = listLatestTokenizedArticle[ctr].Frequency;
                            }
                        }

                        var newToken = new Candidate(arrAnnotations[r], listLatestTokenizedArticle[startIndex].Position, startIndex + wordForWordAnnotation.Count() - 1);
                        newToken.Sentence     = listLatestTokenizedArticle[i].Sentence;
                        newToken.NamedEntity  = listLatestTokenizedArticle[i].NamedEntity;
                        newToken.PartOfSpeech = listLatestTokenizedArticle[i].PartOfSpeech;
                        newToken.Frequency    = tempWs;
                        switch (annotationType)
                        {
                        case "WHO":
                            newToken.IsWho = true;
                            listWhoCandidates.Add(newToken);
                            break;

                        case "WHEN":
                            newToken.IsWhen = true;
                            listWhenCandidates.Add(newToken);
                            break;

                        case "WHERE":
                            newToken.IsWhere = true;
                            listWhereCandidates.Add(newToken);
                            break;
                        }
                    }
                }
                else
                {
                    totalMatch            += 1;
                    foundMatchingCandidate = false;
                }
            }

            //System.Console.WriteLine("Annotations Count: {0}", arrAnnotations.GetLength(0));
            statistics[2] += 1;
            statistics[0]  = (float)totalMatch / arrAnnotations.GetLength(0);
            switch (annotationType)
            {
            case "WHO":
                statistics[1] = (float)totalMatch / listWhoCandidates.Count;
                //System.Console.WriteLine("Total Match: {0}, Who Candidates Count: {1}", totalMatch, listWhoCandidates.Count);
                break;

            case "WHEN":
                statistics[1] = (float)totalMatch / listWhenCandidates.Count;
                //System.Console.WriteLine("Total Match: {0}, When Candidates Count: {1}", totalMatch, listWhenCandidates.Count);
                break;

            case "WHERE":
                statistics[1] = (float)totalMatch / listWhereCandidates.Count;
                //System.Console.WriteLine("Total Match: {0}, Where Candidates Count: {1}", totalMatch, listWhereCandidates.Count);
                break;
            }
            return(statistics);
        }
コード例 #36
0
 private bool handleDeleteCandidate(Candidate c, TabPage tab)
 {
     question.Candidates.Remove(c);
     candidateTabControl.TabPages.Remove(tab);
     return(false);
 }
コード例 #37
0
 public async Task AddAsync(Candidate candidate)
 {
     await _context.Candidates.AddAsync(candidate);
 }
コード例 #38
0
 private static void UpdateCandidate(Candidate candidate, EducationLevel?highestEducationLevel)
 {
     candidate.HighestEducationLevel = highestEducationLevel;
 }
コード例 #39
0
 private static void UpdateCandidate(Candidate candidate, ContactDetailsMemberModel memberModel)
 {
     candidate.VisaStatus = memberModel.VisaStatus;
 }
コード例 #40
0
ファイル: OverloadResolution.cs プロジェクト: ikvm/NRefactory
        void CheckApplicability(Candidate candidate)
        {
            // C# 4.0 spec: §7.5.3.1 Applicable function member

            // Test whether parameters were mapped the correct number of arguments:
            int[] argumentCountPerParameter = new int[candidate.ParameterTypes.Length];
            foreach (int parameterIndex in candidate.ArgumentToParameterMap)
            {
                if (parameterIndex >= 0)
                {
                    argumentCountPerParameter[parameterIndex]++;
                }
            }
            for (int i = 0; i < argumentCountPerParameter.Length; i++)
            {
                if (candidate.IsExpandedForm && i == argumentCountPerParameter.Length - 1)
                {
                    continue;                     // any number of arguments is fine for the params-array
                }
                if (argumentCountPerParameter[i] == 0)
                {
                    if (candidate.Parameters[i].IsOptional)
                    {
                        candidate.HasUnmappedOptionalParameters = true;
                    }
                    else
                    {
                        candidate.AddError(OverloadResolutionErrors.MissingArgumentForRequiredParameter);
                    }
                }
                else if (argumentCountPerParameter[i] > 1)
                {
                    candidate.AddError(OverloadResolutionErrors.MultipleArgumentsForSingleParameter);
                }
            }

            candidate.ArgumentConversions = new Conversion[arguments.Length];
            // Test whether argument passing mode matches the parameter passing mode
            for (int i = 0; i < arguments.Length; i++)
            {
                int parameterIndex = candidate.ArgumentToParameterMap[i];
                if (parameterIndex < 0)
                {
                    continue;
                }

                ByReferenceResolveResult brrr = arguments[i] as ByReferenceResolveResult;
                if (brrr != null)
                {
                    if ((brrr.IsOut && !candidate.Parameters[parameterIndex].IsOut) || (brrr.IsRef && !candidate.Parameters[parameterIndex].IsRef))
                    {
                        candidate.AddError(OverloadResolutionErrors.ParameterPassingModeMismatch);
                    }
                }
                else
                {
                    if (candidate.Parameters[parameterIndex].IsOut || candidate.Parameters[parameterIndex].IsRef)
                    {
                        candidate.AddError(OverloadResolutionErrors.ParameterPassingModeMismatch);
                    }
                }
                IType      parameterType = candidate.ParameterTypes[parameterIndex];
                Conversion c             = conversions.ImplicitConversion(arguments[i], parameterType);
                candidate.ArgumentConversions[i] = c;
                if (IsExtensionMethodInvocation && parameterIndex == 0)
                {
                    // First parameter to extension method must be an identity, reference or boxing conversion
                    if (!(c == Conversion.IdentityConversion || c == Conversion.ImplicitReferenceConversion || c == Conversion.BoxingConversion))
                    {
                        candidate.AddError(OverloadResolutionErrors.ArgumentTypeMismatch);
                    }
                }
                else
                {
                    if (!c)
                    {
                        candidate.AddError(OverloadResolutionErrors.ArgumentTypeMismatch);
                    }
                }
            }
        }
コード例 #41
0
ファイル: OverloadResolution.cs プロジェクト: ikvm/NRefactory
        /// <summary>
        /// Returns 1 if c1 is better than c2; 2 if c2 is better than c1; or 0 if neither is better.
        /// </summary>
        int BetterFunctionMember(Candidate c1, Candidate c2)
        {
            // prefer applicable members (part of heuristic that produces a best candidate even if none is applicable)
            if (c1.ErrorCount == 0 && c2.ErrorCount > 0)
            {
                return(1);
            }
            if (c1.ErrorCount > 0 && c2.ErrorCount == 0)
            {
                return(2);
            }

            // C# 4.0 spec: §7.5.3.2 Better function member
            bool c1IsBetter = false;
            bool c2IsBetter = false;

            for (int i = 0; i < arguments.Length; i++)
            {
                int p1 = c1.ArgumentToParameterMap[i];
                int p2 = c2.ArgumentToParameterMap[i];
                if (p1 >= 0 && p2 < 0)
                {
                    c1IsBetter = true;
                }
                else if (p1 < 0 && p2 >= 0)
                {
                    c2IsBetter = true;
                }
                else if (p1 >= 0 && p2 >= 0)
                {
                    switch (conversions.BetterConversion(arguments[i], c1.ParameterTypes[p1], c2.ParameterTypes[p2]))
                    {
                    case 1:
                        c1IsBetter = true;
                        break;

                    case 2:
                        c2IsBetter = true;
                        break;
                    }
                }
            }
            if (c1IsBetter && !c2IsBetter)
            {
                return(1);
            }
            if (!c1IsBetter && c2IsBetter)
            {
                return(2);
            }

            // prefer members with less errors (part of heuristic that produces a best candidate even if none is applicable)
            if (c1.ErrorCount < c2.ErrorCount)
            {
                return(1);
            }
            if (c1.ErrorCount > c2.ErrorCount)
            {
                return(2);
            }

            if (!c1IsBetter && !c2IsBetter)
            {
                // we need the tie-breaking rules

                // non-generic methods are better
                if (!c1.IsGenericMethod && c2.IsGenericMethod)
                {
                    return(1);
                }
                else if (c1.IsGenericMethod && !c2.IsGenericMethod)
                {
                    return(2);
                }

                // non-expanded members are better
                if (!c1.IsExpandedForm && c2.IsExpandedForm)
                {
                    return(1);
                }
                else if (c1.IsExpandedForm && !c2.IsExpandedForm)
                {
                    return(2);
                }

                // prefer the member with less arguments mapped to the params-array
                int r = c1.ArgumentsPassedToParamsArray.CompareTo(c2.ArgumentsPassedToParamsArray);
                if (r < 0)
                {
                    return(1);
                }
                else if (r > 0)
                {
                    return(2);
                }

                // prefer the member where no default values need to be substituted
                if (!c1.HasUnmappedOptionalParameters && c2.HasUnmappedOptionalParameters)
                {
                    return(1);
                }
                else if (c1.HasUnmappedOptionalParameters && !c2.HasUnmappedOptionalParameters)
                {
                    return(2);
                }

                // compare the formal parameters
                r = MoreSpecificFormalParameters(c1, c2);
                if (r != 0)
                {
                    return(r);
                }

                // prefer non-lifted operators
                ILiftedOperator lift1 = c1.Member as ILiftedOperator;
                ILiftedOperator lift2 = c2.Member as ILiftedOperator;
                if (lift1 == null && lift2 != null)
                {
                    return(1);
                }
                if (lift1 != null && lift2 == null)
                {
                    return(2);
                }
            }
            return(0);
        }
コード例 #42
0
 public wCandidateInformations(Candidate c)
 {
     InitializeComponent();
     candidate = c;
 }
コード例 #43
0
 public ActionResult Preview(int id)
 {
     return(View(Candidate.GetCandidateById(id)));
 }
コード例 #44
0
        public void UpdateCandidateStatus(Candidate candidate)
        {
            var repo = new CandidateRepository(_connectionString);

            repo.UpdateCandidate(candidate);
        }
コード例 #45
0
 private void UpdateCandidate(Candidate candidate, Profession?recentProfession, Seniority?recentSeniority, IEnumerable <Guid> industryIds)
 {
     candidate.RecentProfession = recentProfession;
     candidate.RecentSeniority  = recentSeniority;
     candidate.Industries       = industryIds == null ? null : _industriesQuery.GetIndustries(industryIds);
 }
コード例 #46
0
ファイル: OverloadResolution.cs プロジェクト: ikvm/NRefactory
        void RunTypeInference(Candidate candidate)
        {
            IMethod method = candidate.Member as IMethod;

            if (method == null || method.TypeParameters.Count == 0)
            {
                if (explicitlyGivenTypeArguments != null)
                {
                    // method does not expect type arguments, but was given some
                    candidate.AddError(OverloadResolutionErrors.WrongNumberOfTypeArguments);
                }
                return;
            }
            ParameterizedType parameterizedDeclaringType = candidate.Member.DeclaringType as ParameterizedType;
            IList <IType>     classTypeArguments;

            if (parameterizedDeclaringType != null)
            {
                classTypeArguments = parameterizedDeclaringType.TypeArguments;
            }
            else
            {
                classTypeArguments = null;
            }
            // The method is generic:
            if (explicitlyGivenTypeArguments != null)
            {
                if (explicitlyGivenTypeArguments.Length == method.TypeParameters.Count)
                {
                    candidate.InferredTypes = explicitlyGivenTypeArguments;
                }
                else
                {
                    candidate.AddError(OverloadResolutionErrors.WrongNumberOfTypeArguments);
                    // wrong number of type arguments given, so truncate the list or pad with UnknownType
                    candidate.InferredTypes = new IType[method.TypeParameters.Count];
                    for (int i = 0; i < candidate.InferredTypes.Length; i++)
                    {
                        if (i < explicitlyGivenTypeArguments.Length)
                        {
                            candidate.InferredTypes[i] = explicitlyGivenTypeArguments[i];
                        }
                        else
                        {
                            candidate.InferredTypes[i] = SpecialType.UnknownType;
                        }
                    }
                }
            }
            else
            {
                TypeInference ti = new TypeInference(compilation, conversions);
                bool          success;
                candidate.InferredTypes = ti.InferTypeArguments(candidate.TypeParameters, arguments, candidate.ParameterTypes, out success, classTypeArguments);
                if (!success)
                {
                    candidate.AddError(OverloadResolutionErrors.TypeInferenceFailed);
                }
            }
            // Now substitute in the formal parameters:
            var substitution = new ConstraintValidatingSubstitution(classTypeArguments, candidate.InferredTypes, this);

            for (int i = 0; i < candidate.ParameterTypes.Length; i++)
            {
                candidate.ParameterTypes[i] = candidate.ParameterTypes[i].AcceptVisitor(substitution);
            }
            if (!substitution.ConstraintsValid)
            {
                candidate.AddError(OverloadResolutionErrors.ConstructedTypeDoesNotSatisfyConstraint);
            }
        }
コード例 #47
0
 private void UpdateCandidate(Candidate candidate, Action <Candidate> updateCandidate)
 {
     updateCandidate(candidate);
     _candidatesCommand.UpdateCandidate(candidate);
 }
コード例 #48
0
        private void OnSceneGUI(SceneView sceneView)
        {
            if (propertyPicking == null)
            {
                StopPicking();
                return;
            }

            // Make sure we update the sceneview whenever the mouse moves.
            if (Event.current.type == EventType.MouseMove)
            {
                bestCandidate = FindBestCandidate(sceneView);
                FindNearbyCandidates(sceneView);

                sceneView.Repaint();
            }

            // Draw the current best candidate.
            if (bestCandidate.IsValid)
            {
                Vector3 objectPosWorld = bestCandidate.Position;
                Vector2 mousePosGui    = Event.current.mousePosition;
                Vector3 mouseWorld     = HandleUtility.GUIPointToWorldRay(mousePosGui)
                                         .GetPoint(10);

                Handles.color = new Color(1, 1, 1, 0.75f);
                Handles.DrawDottedLine(objectPosWorld, mouseWorld, 2.0f);
                Handles.color = Color.white;

                Handles.BeginGUI();

                string text = bestCandidate.Name;

                // The 'nearby candidates' includes the best candidate, if there's more than one, there are others.
                if (nearbyCandidates.Count > 1)
                {
                    text += " + " + (nearbyCandidates.Count - 1) + " nearby";
                }

                Vector2 labelSize = PickingTextStyle.CalcSize(new GUIContent(text));
                labelSize += Vector2.one * 4;
                Rect nameRect = new Rect(
                    Event.current.mousePosition + Vector2.down * 10 - labelSize * 0.5f, labelSize);

                // Draw shadow.
                GUI.backgroundColor = new Color(0, 0, 0, 1.0f);
                PickingTextStyle.normal.textColor = Color.black;
                EditorGUI.LabelField(nameRect, text, PickingTextStyle);

                // Draw white text.
                nameRect.position  += new Vector2(-1, -1);
                GUI.backgroundColor = new Color(0, 0, 0, 0);
                PickingTextStyle.normal.textColor = Color.white;
                EditorGUI.LabelField(nameRect, text, PickingTextStyle);

                Handles.EndGUI();
            }

            // This makes sure that clicks are not handled by the scene itself.
            if (Event.current.type == EventType.Layout)
            {
                controlID = GUIUtility.GetControlID(FocusType.Passive);
                HandleUtility.AddDefaultControl(controlID);
                return;
            }

            if (Event.current.type != EventType.MouseDown || Event.current.alt ||
                Event.current.control)
            {
                return;
            }

            // Left click to pick a candidate, every other button is a cancel.
            if (Event.current.button == 0)
            {
                PickCandidate(bestCandidate);
            }
            else if (Event.current.button == 2 && nearbyCandidates.Count > 1)
            {
                PickNearbyCandidate();
            }
            else
            {
                StopPicking();
            }

            Event.current.Use();
        }
コード例 #49
0
 public void Remove(Candidate candidate)
 {
     _context.Candidates.Remove(candidate);
 }
コード例 #50
0
        // Returns 1 if prefferred, -1 if dispreferred, and 0 if tied
        public int getRankPreference(Candidate subjectCandidate, Candidate objectCandidate)
        {
            if (preferredCandidateList.Contains(subjectCandidate))
            {
                if (preferredCandidateList.Contains(objectCandidate))
                {
                    // First in the list is the winning candidate
                    foreach (Candidate candidate in preferredCandidateList)
                    {
                        if (candidate == subjectCandidate)
                        {
                            return(1);
                        }

                        if (candidate == objectCandidate)
                        {
                            return(-1);
                        }
                    }

                    throw new Exception("Somehow got to the bottom of a list without finding a winning candidate");
                }

                return(1);
            }

            if (dispreferredCandidateList.Contains(subjectCandidate))
            {
                if (dispreferredCandidateList.Contains(objectCandidate))
                {
                    // First in the list is the losing candidate
                    foreach (Candidate candidate in dispreferredCandidateList)
                    {
                        if (candidate == subjectCandidate)
                        {
                            return(-1);
                        }

                        if (candidate == objectCandidate)
                        {
                            return(1);
                        }
                    }

                    throw new Exception("Somehow got to the bottom of a list without finding a losing candidate");
                }

                return(-1);
            }

            // Subject candidate is in neither list
            if (preferredCandidateList.Contains(objectCandidate))
            {
                return(-1);
            }

            // Subject candidate is in neither list
            if (dispreferredCandidateList.Contains(objectCandidate))
            {
                return(1);
            }

            return(0);
        }
コード例 #51
0
        public IActionResult Nominate()
        {
            Candidate c = new Candidate();

            return(View("Nominate", c));
        }
コード例 #52
0
 // Returns the number of votes for the subject candidate over the object candidate
 public int getScorePreference(Candidate subjectCandidate, Candidate objectCandidate)
 {
     return(candidateScoreLookup[subjectCandidate.index].score - candidateScoreLookup[objectCandidate.index].score);
 }
コード例 #53
0
        /// <summary>
        /// 將備份檔存入 DB
        /// </summary>
        /// <param name="candidate">描述待處理檔案的資訊</param>
        /// <param name="target">byte[]</param>
        private void SaveBackupToDB(Candidate candidate, byte[] target)
        {
            DBBackupHandler backupHandler = new DBBackupHandler();

            backupHandler.Perform(candidate, target);
        }
コード例 #54
0
 public void DepartmentChange(Candidate candidate)
 {
 }
コード例 #55
0
        private static double RankReinforcementsFleet(Candidate candidate)
        {
            var destination = candidate.Destination;

            return(RankPlanet(destination) / RankPlanet(candidate.MyTopPlanet));
        }
コード例 #56
0
        private static double RankAttackFleet(Candidate candidate)
        {
            var destination = candidate.Destination;

            return(RankPlanet(destination) / RankPlanet(candidate.TopPlanet));
        }
コード例 #57
0
 public Candidate AddCandidate(Candidate candidate)
 {
     _votingContext.Candidates.Add(candidate);
     _votingContext.SaveChanges();
     return(candidate);
 }
コード例 #58
0
 private static double Rank(Candidate candidate)
 {
     return(candidate.Source.OwnerId == candidate.Destination.OwnerId
         ? RankReinforcementsFleet(candidate)
         : RankAttackFleet(candidate));
 }
コード例 #59
0
 private void SetUserCookies(Candidate candidate, params string[] roles)
 {
     _authenticationTicketService.SetAuthenticationCookie(_httpContext.Response.Cookies, candidate.EntityId.ToString(), roles);
 }
コード例 #60
0
        private bool HasMaximumNumberPhonesByCandidate(Candidate candidate)
        {
            int MAXIMUM_NUMBER_PHONES_BY_CANDIDATE = _settings.AppConfig.MaximumNumberPhoneByCandidate;

            return(candidate.PhoneCount() >= MAXIMUM_NUMBER_PHONES_BY_CANDIDATE);
        }