public JsonResult InsertWayBillData(List <WayBills> wayBillData)
        {
            TritonDataCalls _TritonData = new TritonDataCalls();

            bool UpdatedStatus = false;

            try
            {
                foreach (WayBills waybill in wayBillData)
                {
                    try
                    {
                        if (waybill.Id > 0)
                        {
                            UpdatedStatus = _TritonData.InsertWayBills(waybill);
                        }
                    }
                    catch (Exception ex)
                    {
                        //Log errors
                    }
                }
                return(Json(new { SuccessData = true }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                //log errors
                return(Json(new { SuccessData = false }, JsonRequestBehavior.AllowGet));
            }
        }
        public JsonResult UpdateVehicleData(List <Vehicle> vehicleData)
        {
            TritonDataCalls _TritonData = new TritonDataCalls();

            bool UpdatedStatus = false;

            try
            {
                foreach (Vehicle veh in vehicleData)
                {
                    try
                    {
                        if (veh.Id > 0)
                        {
                            UpdatedStatus = _TritonData.UpdateVehicle(veh);
                        }
                    }
                    catch (Exception ex)
                    {
                        //Log errors
                    }
                }
                return(Json(new { SuccessData = true }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { SuccessData = false }, JsonRequestBehavior.AllowGet));
            }
        }
        public ActionResult WayBills()
        {
            TritonDataCalls _TritonData  = new TritonDataCalls();
            var             WayBillsList = _TritonData.ReadAllWayBillsList().ToList();

            var wayBillsList = WayBillsList.Select(i => new { i.Id, i.weight, i.NoOfParcels, i.VehicleId }).ToList();

            JsonResult json = Json(new { data = wayBillsList });

            json.MaxJsonLength = int.MaxValue;

            return(json);
        }
        public ActionResult Vehicle()
        {
            TritonDataCalls _TritonData = new TritonDataCalls();
            var             VehicleList = _TritonData.ReadAllVehicleList().ToList();

            var vehicleL = VehicleList.Select(i => new { i.Id, i.Name, i.Type, i.Branch }).ToList();

            JsonResult json = Json(new { data = vehicleL });

            json.MaxJsonLength = int.MaxValue;

            return(json);
        }
Example #5
0
        public IEnumerable <WayBills> GetAllWayBills()
        {
            List <WayBills> waybills = new List <WayBills>();

            try
            {
                TritonDataCalls contourVoucher = new TritonDataCalls();

                waybills = (List <WayBills>)contourVoucher.ReadAllWayBillsList();
            }
            catch (Exception ex)
            {
                //Log Errors
            }
            return(waybills);
        }
Example #6
0
        public IEnumerable <Vehicle> GetAllVehicles()
        {
            List <Vehicle> veh = new List <Vehicle>();

            try
            {
                TritonDataCalls contourVoucher = new TritonDataCalls();

                veh = (List <Vehicle>)contourVoucher.ReadAllVehicleList();
            }
            catch (Exception ex)
            {
                //Log Errors
            }
            return(veh);
        }