Exemplo n.º 1
0
 public double GetMyManagerScore(int userId, int poeid, int managerId)
 {
     using (var context = DataContextFactory.GetIntelliSetDataContext())
     {
         var managerscore = context.GetMyManagerScore(poeid, userId, managerId).FirstOrDefault();
         if (managerscore != null)
         {
             string fbid         = managerscore.POEFeedbackId.ToString();
             var    standing     = new Standing.StandingDataAccess();
             var    managerStand = standing.GetAvgStandingScore(fbid, poeid).WcsiScore;
             return(managerStand);
         }
         else
         {
             return(0);
         }
     }
 }
Exemplo n.º 2
0
        public double GetLatestSelfScore(int userid, int poeid)
        {
            var    selfFbid = 0.0;
            double wcsi     = 0;

            using (var context = DataContextFactory.GetIntelliSetDataContext())
            {
                var v3GetLatestSelfFeedbackResult = context.GetLatestSelfFeedback(userid, poeid).FirstOrDefault();

                if (v3GetLatestSelfFeedbackResult != null)
                {
                    selfFbid = v3GetLatestSelfFeedbackResult.POEFeedbackId;
                    var standing = new Standing.StandingDataAccess();
                    wcsi = standing.GetAvgStandingScore(selfFbid.ToString(), poeid).WcsiScore;
                }
            }
            return(wcsi);
        }
Exemplo n.º 3
0
        //End Path finders

        //Start Standing
        public DashboardStanding GetStandingDataDashBoard(int poeid, int userid, int subid, string domain)
        {
            var standing         = new Standing.StandingDataAccess();
            var yourmanagerScore = standing.GetYouFbidString(poeid, userid.ToString(CultureInfo.InvariantCulture), subid, 2, domain);
            //string managerids = GetMyManagerIdString(poeid, userid);
            //var you = GetYouFbidString(poeid, userid.ToString(CultureInfo.InvariantCulture), subid, 1, domain);
            int managerSync = Convert.ToInt32(GetLatestSelfScore(userid, poeid));
            var community   = standing.GetRestFbidString(poeid, userid.ToString(CultureInfo.InvariantCulture), domain, 1);
            //int userTenure = GetTenureForuser(userid, poeid);
            //string tenurecol = string.Empty;
            //if (userTenure <= 12)
            //{
            //    tenurecol = standing.GetTenureFbidString(poeid, userid.ToString(CultureInfo.InvariantCulture), domain, 1, 0, 13);
            //}
            //else if (userTenure > 12 && userTenure <= 36)
            //{
            //    tenurecol = standing.GetTenureFbidString(poeid, userid.ToString(CultureInfo.InvariantCulture), domain, 1, 13, 37);
            //}
            //else
            //{
            //    tenurecol = standing.GetTenureFbidString(poeid, userid.ToString(CultureInfo.InvariantCulture), domain, 1, 37, 260);
            //}

            var teamFbid = standing.GetTeamFbidString(poeid, userid.ToString(CultureInfo.InvariantCulture), 1, domain);
            // var youStand = GetAvgStandingScore(you, poeid);
            var managerStand   = standing.GetAvgStandingScore(yourmanagerScore, poeid).WcsiScore;
            var communityStand = standing.GetAvgStandingScore(community, poeid).WcsiScore;
            //var tenureStand = standing.GetAvgStandingScore(tenurecol, poeid).WcsiScore;
            var teamStand = standing.GetAvgStandingScore(teamFbid, poeid).WcsiScore;
            //var users = GetDashboardUsers(managerids).ToList();
            var standingscore = new DashboardStanding
            {
                YourComunity = managerStand - communityStand,
                YourTeam     = managerStand - teamStand,
                //YourTenure = managerStand - tenureStand,
                YourStanding  = managerStand,
                StandingUsers = GetMyAllManagersList(userid, poeid).ToList(),
                ManagerSync   = managerSync
                                //TenureForUser = userTenure
            };

            return(standingscore);
        }