Ejemplo n.º 1
0
 public ActionResult GetPostaKodsByMahalleId(string MahalleId)
 {
     if (String.IsNullOrEmpty(MahalleId))
     {
         throw new ArgumentNullException("MahalleId");
     }
     int id = 0;
     bool isValid = Int32.TryParse(MahalleId, out id);
     IlceSemt iss = new IlceSemt();
     using (motobulvarEntities ent = new motobulvarEntities())
     {
         var postakods = iss.GetAllPostaKodsByByMahalleId(id);
         var result = (from i in postakods
                       select new
                       {
                           id = i.pkID,
                           name = i.kod
                       }).ToList();
         return Json(result, JsonRequestBehavior.AllowGet);
     }
 }
 public ActionResult GetAltKategorisByKategoriId(string KategoriId)
 {
     if (String.IsNullOrEmpty(KategoriId))
     {
         throw new ArgumentNullException("KategoriId");
     }
     int id = 0;
     bool isValid = Int32.TryParse(KategoriId, out id);
     KategoriAltKategori iss = new KategoriAltKategori();
     using (motobulvarEntities ent = new motobulvarEntities())
     {
         var altKategoris = iss.GetAllAltKategorisByKategoriId(id);
         var result = (from i in altKategoris
                       select new
                       {
                           id = i.Id,
                           name = i.AltKategoriAdi
                       }).ToList();
         return Json(result, JsonRequestBehavior.AllowGet);
     }
 }
Ejemplo n.º 3
0
 public ActionResult GetMahallesBySemtId(string SemtId)
 {
     if (String.IsNullOrEmpty(SemtId))
     {
         throw new ArgumentNullException("SemtId");
     }
     int id = 0;
     bool isValid = Int32.TryParse(SemtId, out id);
     IlceSemt iss = new IlceSemt();
     using (motobulvarEntities ent = new motobulvarEntities())
     {
         var mahalles = iss.GetAllMahallesByBySemtId(id);
         var result = (from i in mahalles
                       select new
                       {
                           id = i.mahalleID,
                           name = i.ad
                       }).ToList();
         return Json(result, JsonRequestBehavior.AllowGet);
     }
 }
Ejemplo n.º 4
0
 public ActionResult GetMotModelsByMarkaId(string MotMarkaId)
 {
     if (String.IsNullOrEmpty(MotMarkaId))
     {
         throw new ArgumentNullException("MotMarkaId");
     }
     int id = 0;
     bool isValid = Int32.TryParse(MotMarkaId, out id);
     MotorMarkaModel iss = new MotorMarkaModel();
     using (motobulvarEntities ent = new motobulvarEntities())
     {
         var models = iss.GetAllModelsByMarkaId(id);
         var result = (from i in models
                       select new
                       {
                           id = i.Id,
                           name = i.Model
                       }).ToList();
         return Json(result, JsonRequestBehavior.AllowGet);
     }
 }