Example #1
0
        public IHttpActionResult ResponseCheckpointTP([FromBody] CheckPointTransitPass input)
        {
            var obj = new CreateCheckPointTransitPass
            {
                TransitPassId = input.TransitPassId,
                StationId     = input.StationId
            };

            int ctId = this.checkPointTransitPass.CreateCheckPointTransitPass(obj);
            var ct   = this.checkPointTransitPass.GetCheckPointTransitPass(ctId);

            return(Json(ct));
        }
        public int CreateCheckPointTransitPass(CreateCheckPointTransitPass input)
        {
            var obj = new CheckPointTransitPass
            {
                TransitPassId = input.TransitPassId,
                StationId     = input.StationId
                                //InspectionStatus = input.InspectionStatus,
                                //InspectorId = input.InspectorId,
                                //AdditionInformation = input.AdditionInformation
            };
            var objExist = this.repositoryCheckpointTransitpass.FirstOrDefault(a => a.StationId == input.StationId && a.TransitPassId == input.TransitPassId);

            if (objExist == null)
            {
                return(this.repositoryCheckpointTransitpass.InsertAndGetId(obj));
            }
            else
            {
                throw new UserFriendlyException("Item Alredy Inspected");
            }
        }