Ejemplo n.º 1
0
        public ResponseStatus DeletePersonFace(FaceAPIReg _FaceAPIReg)
        {
            ResponseStatus Response = new ResponseStatus {
                statusCode = "999", message = "unable to Connect to server"
            };

            try
            {
                Response = _FaceAPIs.DeletePersonFaceRequest(_FaceAPIReg.AWCCode, _FaceAPIReg.PersonID, _FaceAPIReg.PersistedFaceID);
                using (var db = new DBEntities())
                {
                    if (Response.statusCode == "000")
                    {
                        Response.Result = db.SpUpdatePersonFaceDeleted(_FaceAPIReg.StateCode, _FaceAPIReg.DistrictCode, _FaceAPIReg.ProjectCode, _FaceAPIReg.SectorCode, _FaceAPIReg.AWCCode, _FaceAPIReg.BeneCode, _FaceAPIReg.UserCode, 1).FirstOrDefault();
                        if (Response.Result != "1")
                        {
                            Response.statusCode = "999";
                            Response.message    = "Person Face Deleted Successfully at Smart Attendance but failed to Update at EPGM";
                            return(Response);
                        }
                        else
                        {
                            //On Sucessfull Person Register and Enroll --Train PerosnGroup(AWC)
                            ResponseStatus TrainRespone = _FaceAPIs.TrainGroupRequest(_FaceAPIReg.AWCCode);
                            return(Response);
                        }
                    }
                    else
                    {
                        Response.statusCode = "999";
                        Response.message    = Response.message;
                        return(Response);
                    }
                }
            }
            catch (Exception ex)
            {
                Response.statusCode = "999";
                Response.message    = ex.Message.ToString();
                return(Response);
            }
        }
Ejemplo n.º 2
0
        public ResponseStatus ActivateHierarchy(string StateCode, string AWCCode)
        {
            ResponseStatus Response = new ResponseStatus {
                statusCode = "999", message = "unable to Connect to server"
            };

            try
            {
                Response = _FaceAPIs.TrainGroupRequest(AWCCode);
                using (var db = new DBEntities())
                {
                    if (Response.statusCode.ToString() == "000")
                    {
                        Response.Result = db.SpUpdateHierarchyTrainStatus(StateCode, AWCCode, 1).FirstOrDefault();
                        if (Response.Result != "1")
                        {
                            Response.statusCode = "999";
                            Response.message    = "Hierachy Activated Successfully at Smart Attendance but failed to Update Status at Growth Monitoring";
                            return(Response);
                        }
                        else
                        {
                            return(Response);
                        }
                    }
                    else
                    {
                        Response.statusCode = "999";
                        Response.message    = Response.message;
                        return(Response);
                    }
                }
            }
            catch (Exception ex)
            {
                Response.statusCode = "999";
                Response.message    = ex.Message.ToString();
                return(Response);
            }
        }