Esempio n. 1
0
        public ActionResult CreateTp(CreateTransitPassInput input, int[] StationId)
        {
            try
            {
                input.ExpireDate = input.IssuedDate.AddDays(input.ExpireDays);
                int TransitpassId = this.transitPass.CreateTransitPass(input);

                for (int i = 0; i < StationId.Count(); i++)
                {
                    var checkpointObj = new CreateCheckPointTransitPass
                    {
                        TransitPassId = TransitpassId,
                        StationId     = StationId[i]
                    };

                    int checkpointTP = this.checkPointTransitPass.CreateCheckPointTransitPass(checkpointObj);
                }

                return(RedirectToAction("getBill", new { Id = TransitpassId }));
            }
            catch
            {
                return(View());
            }
        }
Esempio n. 2
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");
            }
        }