public string Get_VehicleclassificationByCode(string code)
        {
            Model_VehicleClassification _model = _VCRepo.Get_Model_VehicleClassificationByCode(code.ToLower());
            string myjsonresult = new JavaScriptSerializer().Serialize(_model);

            return(myjsonresult);
        }
        public string Check_VehicleClassification(string code)
        {
            string json = string.Empty;
            Model_VehicleClassification v = _VCRepo.Get_Model_VehicleClassificationByCode(code.ToLower());

            if (v.Id > 0)
            {
                json = new JavaScriptSerializer().Serialize(v);
            }
            return(json);
        }
示例#3
0
        //Get vehicleclassification by code
        public Model_VehicleClassification Get_Model_VehicleClassificationByCode(string code)
        {
            var data = db.VehicleClassifications.Where(x => x.ClassificationCode == code && x.IsDeleted == false).FirstOrDefault();
            Model_VehicleClassification _model = new Model_VehicleClassification();

            if (data != null)
            {
                _model.Id = data.Id;
                _model.ClassificationCode = data.ClassificationCode;
                _model.Make            = data.Make;
                _model.Model           = data.Model;
                _model.NoOfAxies       = data.NoOfAxies;
                _model.BodyType        = data.BodyType;
                _model.KerbWT          = data.KerbWt;
                _model.ManufactureYear = data.ManufactureYear;
                _model.GrossWeight     = data.GrossWeight;
                _model.UOMWeight       = data.UOMWeight;
            }
            return(_model);
        }