public IHttpActionResult AddCallsToCalibration([FromBody] EndPointData action)
        {
            CalibrationLayer calibrationLayer = new CalibrationLayer();

            calibrationLayer.AddCallsToCalibration(action);
            return(Ok());
        }
Esempio n. 2
0
 private EndPointData getEndpointData(IPEndPoint ipEndPoint)
 {
     if (!_endpoints.TryGetValue(ipEndPoint, out var endPointdata))
     {
         endPointdata           = new EndPointData(ipEndPoint);
         _endpoints[ipEndPoint] = endPointdata;
     }
     return(endPointdata);
 }
        public ButtonAction RecreateCall(EndPointData endPointData)
        {
            ButtonAction objButtonAction = new ButtonAction();

            try
            {
                objButtonAction = objCCInternalLayer.RecreateCall(endPointData);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objButtonAction);
        }
        public ButtonAction ReassignNotification(EndPointData endPointData)
        {
            ButtonAction objButtonAction = new ButtonAction();

            try
            {
                objButtonAction = objCCInternalLayer.ReassignNotification(endPointData);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objButtonAction);
        }
        public ButtonAction AddDispute(EndPointData endPointData)
        {
            ButtonAction objButtonAction = new ButtonAction();

            try
            {
                objButtonAction = objCCInternalLayer.AddDispute(endPointData);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objButtonAction);
        }
Esempio n. 6
0
 /// <summary>
 /// Creates the computer node.
 /// </summary>
 /// <param name="endPointData">The end point data.</param>
 /// <returns>DirectoryNode.</returns>
 private DirectoryNode CreateComputerNode(EndPointData endPointData)
 {
     return(new DirectoryNode
     {
         NodeId = endPointData.EndpointId,
         Title = endPointData.SystemName,
         IsFolder = false,
         ComputerType = endPointData.ComputerType ?? 0,
         NodeColor = endPointData.PowerState == 0 ? CommonConstants.POWERSTATE_ONLINE_ENDPOINT : CommonConstants.POWERSTATE_OFFLINE_ENDPOINT,
         //NodeColor = endPointData.ColorCode == "0" ? CommonConstants.POWERSTATE_OFFLINE_ENDPOINT : endPointData.ColorCode == "1" ? CommonConstants.POWERSTATE_ONLINE_ENDPOINT : CommonConstants.POWERSTATE_OFFLINE_ENDPOINT,
         IsNoAgent = string.IsNullOrEmpty(endPointData.Id),
         NodeWidth = ApplicationContext.GridRightOriginalWidth,
         Guid = Guid.NewGuid(),
         ImagePath = EndPoint.GetImages(endPointData.ComputerType.ToString(), endPointData.ColorCode, true)
     });
 }
        public EndPointsPackage GetEndpoints(string versionKey)
        {
            EndPointsPackage endPoints = new EndPointsPackage();

            //Get All WebGets
            {
                List <MethodInfo> methods = this.GetType().GetMethods().Where(c => c.GetCustomAttributes(typeof(WebGetAttribute), false).Count() > 0).ToList();
                foreach (MethodInfo method in methods)
                {
                    WebGetAttribute webGet = method.GetCustomAttributes(typeof(WebGetAttribute), false)[0] as WebGetAttribute;
                    if (webGet != null && webGet.UriTemplate.StartsWith(versionKey))
                    {
                        EndPointData newEndPoint = new EndPointData();
                        newEndPoint.Type   = "Get";
                        newEndPoint.Link   = string.Format("{0}/{1}", m_ServiceHostData.ServiceHostUri, webGet.UriTemplate);
                        newEndPoint.Format = webGet.ResponseFormat.ToString();

                        endPoints.Add(newEndPoint);
                    }
                }
            }

            //Get all WebInvokes
            {
                List <MethodInfo> methods = this.GetType().GetMethods().Where(c => c.GetCustomAttributes(typeof(WebInvokeAttribute), false).Count() > 0).ToList();
                foreach (MethodInfo method in methods)
                {
                    WebInvokeAttribute webInvoke = method.GetCustomAttributes(typeof(WebGetAttribute), false)[0] as WebInvokeAttribute;
                    if (webInvoke != null && webInvoke.UriTemplate.StartsWith(versionKey))
                    {
                        EndPointData newEndPoint = new EndPointData();
                        newEndPoint.Type   = webInvoke.Method;
                        newEndPoint.Link   = string.Format("{0}/{1}", m_ServiceHostData.ServiceHostUri, webInvoke.UriTemplate);
                        newEndPoint.Format = webInvoke.ResponseFormat.ToString();

                        endPoints.Add(newEndPoint);
                    }
                }
            }

            return(endPoints);
        }
Esempio n. 8
0
    private void SetDeadZone()
    {
        endpointData.Clear();
        //Debug.Log("SetDeadZone==========> ");
        GameObject[] objZone = GameObject.FindGameObjectsWithTag(TagKeys.Zone);//zoneObject.GetComponentsInChildren<Transform>();
        //Debug.Log("OBJ Zone length "+objZone.Length);
        foreach (var gameObj in objZone)
        {
            var trans = gameObj.GetComponentsInChildren <Transform>();
            Debug.Log("Child length " + trans.Length);
            foreach (var item in trans)
            {
                if (item.gameObject.tag == TagKeys.ZonePoint)
                {
                    var deadZoneTarget = item.Find(deadZone);
                    var respawnTarget  = item.Find(respawnZone);
                    Debug.Log("deadZoneTarget = " + deadZoneTarget.GetInstanceID());
                    Debug.Log("respawnTarget = " + respawnTarget.position);
                    if (!respawnData.ContainsKey(deadZoneTarget.GetInstanceID()))
                    {
                        respawnData.Add(deadZoneTarget.GetInstanceID(), respawnTarget.position);
                    }
                }
                if (item.gameObject.tag == TagKeys.ENDPOINT)
                {
                    var endpoint = item.gameObject.GetComponent <Collider>();
                    // print(Depug.Log("Get in object name "+item.name,Color.blue));
                    // print(Depug.Log("instanceid "+item.transform.GetInstanceID(),Color.red));
                    if (!endpointData.ContainsKey(item.transform.GetInstanceID()))
                    {
                        var rawdata = new EndPointData {
                            instanceId = item.transform.GetInstanceID(),
                            isPass     = false,
                            collider   = endpoint,
                            position   = item.position.x
                        };
                        //print(Depug.Log("endpoint raw data "+rawdata.position,Color.white));
                        endpointData.Add(item.transform.GetInstanceID(), rawdata);
                    }
                }
            }
        }
        //Debug.Log("SetDeadZone 1 ");
        var sort          = from enrty in endpointData orderby enrty.Value.position ascending select enrty;
        var firstEndPoint = sort.ElementAtOrDefault(0);
        var lastEndpoint  = sort.ElementAtOrDefault(sort.Count() - 1);

        if (lastEndpoint.Value != null && firstEndPoint.Value != null)
        {
            startPoint  = firstEndPoint.Value.position;
            finishPoint = lastEndpoint.Value.position;
            //OnSetDirection.OnNext(new Vector2(firstEndPoint.Value.position,lastEndpoint.Value.position));
        }
        else
        {
            Debug.LogError("Cannot found firstEndpoint or last endpoint");
        }
        //Debug.Log("SetDeadZone 2  Endpoint DAta "+endpointData.Count);
        GameplayManager.Instance.SetTotalRound(endpointData.Count);

        // foreach (var item in respawnData)
        // {
        //     Debug.Log(string.Format("Key {0} Value {1}",item.Key,item.Value));
        // }
        // Debug.Log("TotalCount "+respawnData.Count);
    }
 public void Add(EndPointData endPoint)
 {
     EndPoints.Add(endPoint);
 }
Esempio n. 10
0
        /// <summary>
        /// AddCallsToCalibration calibration layer
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        public string AddCallsToCalibration(EndPointData action)
        {
            string userName = "";

            if (HttpContext.Current.Request.UrlReferrer.Host.Contains("localhost") && HttpContext.Current.Request.UrlReferrer.Port == 51268)
            {
                userName = "******";// HttpContext.Current.User.Identity.Name;
            }
            else
            {
                userName = HttpContext.Current.User.Identity.Name;
            }

            var preparedLst = new StringBuilder();

            if (action.ids != null && (action.ids.Count > 0))
            {
                foreach (var value in action.ids)
                {
                    preparedLst.Append(("'" + (value + "',")));
                }
            }

            try
            {
                using (var sqlCon = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["CC_ProdConn"].ConnectionString))
                {
                    sqlCon.Open();
                    SqlCommand reply = new SqlCommand(@"select appname, scorecard,scorecard_name, f_id from vwForm where f_id in (" + preparedLst.ToString().Trim(',') + ")", sqlCon);
                    reply.CommandTimeout = 60;
                    reply.CommandType    = CommandType.Text;
                    SqlDataReader reader    = reply.ExecuteReader();
                    var           callsInfo = new List <CallsInfo>();
                    while (reader.Read())
                    {
                        if (reader.HasRows)
                        {
                            Scorecard scorecard = new Scorecard()
                            {
                                scorecardId   = int.Parse(reader.GetValue(reader.GetOrdinal("scorecard")).ToString()),
                                scorecardName = reader.GetValue(reader.GetOrdinal("scorecard_name")).ToString()
                            };
                            callsInfo.Add(new CallsInfo()
                            {
                                appname   = reader.GetValue(reader.GetOrdinal("appname")).ToString(),
                                scorecard = scorecard,
                                id        = int.Parse(reader.GetValue(reader.GetOrdinal("f_id")).ToString())
                            });
                        }
                    }
                    SqlCommand sqlCommandInsert = new SqlCommand();
                    sqlCommandInsert.Connection     = sqlCon;
                    sqlCommandInsert.CommandTimeout = 60;
                    sqlCommandInsert.CommandType    = CommandType.Text;
                    SqlDataReader insertReader;
                    string        nextStep = "";
                    try
                    {
                        insertReader = sqlCommandInsert.ExecuteReader();
                    }
                    catch { }
                    string selected_by = "";
                    foreach (var info in callsInfo)
                    {
                        if (action.side == "external")//"external"//"internal"
                        {
                            selected_by = "Client";

                            sqlCommandInsert = new SqlCommand
                                                   (@"insert into cali_pending_client (bad_value, form_id, reviewer, review_type, week_ending, appname, assigned_to, cpc_who_added) select '"
                                                   + selected_by + " Selected','" + info.id +
                                                   @"',(select reviewer from form_score3 where id = " + info.id +
                                                   @"),'Client Selected',convert(date, dateadd(d, 7 - datepart(weekday, dbo.getMTDate()), dbo.getMTDate())),'" + info.appname +
                                                   @"', userapps.username,'" + userName +
                                                   @"' from userextrainfo join userapps on userextrainfo.username = userapps.username where user_role 
                                in ('Supervisor','Client','Manager', 'Client Calibrator') and user_scorecard = (select scorecard from vwForm where f_id = '" + info.id + "'); " +

                                                   @" insert into calibration_pending (bad_value, form_id, reviewer, review_type, week_ending, appname, cp_who_added, client_start, isrecal, sc_id) " +
                                                   @" select 'Client Selected','" + info.id + "',(select reviewer from form_score3 where id = " + info.id + "),'Client Selected',convert(date, dateadd(d, 7 - datepart(weekday, dbo.getMTDate()), dbo.getMTDate())),'" + info.appname + "','" + userName + "', dbo.getMTDate(),1,(select scorecard from vwForm where f_id = " + info.id + ") where 0 = (select count(*) from calibration_pending where form_id = " + info.id + " and isrecal = 1);  " +
                                                   @" update top (1) calibration_pending set client_start = dbo.getMTdate() where form_id = '" + info.id + "' and Client_Review_Completed is null; " +
                                                   @" select count(*) from calibration_pending where form_id = " + info.id + " and isrecal = 1;", sqlCon);

                            insertReader = sqlCommandInsert.ExecuteReader();
                        }
                        else if (action.side == "internal")
                        {
                            //var A = ("select count(*) from calibration_pending where form_id = " + info.id + " and isrecal = 0");

                            nextStep = ("insert into calibration_pending (bad_value, form_id, reviewer, review_type, week_ending, appname, cp_who_added, client_start, isrecal, sc_id) select '" +
                                        selected_by + " Selected','" +
                                        info.id + "',(select reviewer from form_score3 where id = " + info.id + "),'" +
                                        selected_by +
                                        " Selected',convert(date, dateadd(d, 7 - datepart(weekday, dbo.getMTDate()), dbo.getMTDate())),'" + info.appname + "','" + userName +
                                        "', dbo.getMTDate(),0,'" + info.scorecard.scorecardId + "'"
                                        + "       update calibration_pending set client_start = dbo.getMTDate() where form_id = " + info.id);


                            sqlCommandInsert = new SqlCommand(nextStep, sqlCon);
                            insertReader     = sqlCommandInsert.ExecuteReader();
                            //{
                            //    var B = ("insert into calibration_pending (bad_value, form_id, reviewer, review_type, week_ending, appname, cp_who_added, client_start, isrecal, sc_id) select '" + selected_by + " Selected','" + info.id + "',(select reviewer from form_score3 where id = " + info.id + "),'" + selected_by + " Selected',convert(date, dateadd(d, 7 - datepart(weekday, dbo.getMTDate()), dbo.getMTDate())),'" + info.appname + "','" + userName + "', dbo.getMTDate(),0,'" + info.scorecard + "'");
                            //}
                            //var BQ = ("update calibration_pending set client_start = dbo.getMTDate() where form_id = " + info.id);
                        }
                    }
                    sqlCon.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return("OK");
        }
Esempio n. 11
0
	void SetSessionMembers(MatchingResult result, int memberNum, EndPointData[] endPoints)
	{
		Debug.Log("StartSessionNotify");

		string str = "MemberNum:" + memberNum + " result:" + result;
		Debug.Log(str);

		m_memberNum = memberNum;

		for (int i = 0; i < memberNum; ++i) {

			MemberList member = new MemberList();

			member.node = i;
			member.endPoint = new IPEndPoint(IPAddress.Parse(endPoints[i].ipAddress), endPoints[i].port);

			sessionMembers[i] = member;

			str = "member[" + i + "]:" + member.endPoint.Address.ToString() + " : " + endPoints[i].port;
			Debug.Log(str);
		}
	}