コード例 #1
0
        public IlceDTO Map(Ilce ent)
        {
            var ilce = new IlceDTO();

            ilce.ilceAdi = ent.ilceAdi;
            ilce.ilceID  = ent.ilceID;
            ilce.ilID    = ent.ilID;
            return(ilce);
        }
コード例 #2
0
ファイル: IlceController.cs プロジェクト: sabriaraz/OzelDers
        public async Task <JsonResult> Sil([FromBody] IlceDTO ilceDTO)
        {
            Ilce ilce = new Ilce();

            ilce = map.Map(ilceDTO, ilce);
            ilceRep.Delete(ilce);
            await ilceRep.Commit();

            return(Json(ilceDTO));
        }
コード例 #3
0
ファイル: IlceController.cs プロジェクト: sabriaraz/OzelDers
        public async Task <JsonResult> Ekle([FromBody] IlceDTO ilceDTO)
        {
            Ilce ilce = new Ilce();

            ilce    = map.Map(ilceDTO, ilce);
            ilce.Id = 0;
            ilceRep.Add(ilce);
            await ilceRep.Commit();

            return(Json(ilceDTO));
        }
コード例 #4
0
        public List <IlceDTO> MapAll(List <Ilce> model)
        {
            var Ilceler = new List <IlceDTO>();

            foreach (var ent in model.ToList())
            {
                var ilce = new IlceDTO();
                ilce.ilceAdi = ent.ilceAdi;
                ilce.ilceID  = ent.ilceID;
                ilce.ilID    = ent.ilID;

                Ilceler.Add(ilce);
            }
            return(Ilceler);
        }
コード例 #5
0
        public IActionResult Edit(int id)
        {
            Record record = _parkcontext.Records.FirstOrDefault(x => x.ID == id);

            RecordDTO model = new RecordDTO();

            model._id                              = record.ID;
            model.ParkID                           = record.ParkID;
            model.ParkAdi                          = record.ParkAdi;
            model.LokasyonAdi                      = record.LokasyonAdi;
            model.LokasyonKodu                     = record.LokasyonKodu;
            model.ParkTipi                         = record.ParkTipi;
            model.ParkKapasitesi                   = record.ParkKapasitesi;
            model.CalismaSaatleri                  = record.CalismaSaatleri;
            model.Bolge                            = record.Bolge;
            model.AltBolge                         = record.AltBolge;
            model.Ilce                             = record.Ilce;
            model.Adres                            = record.Adres;
            model.Enlem_Boylam                     = record.Enlem_Boylam;
            model.Polygon_Verisi                   = record.Polygon_Verisi;
            model.Boylam                           = record.Boylam;
            model.Enlem                            = record.Enlem;
            model.Aylik_Abonelik_Ucreti            = record.Aylik_Abonelik_Ucreti;
            model.Ucretsiz_Parklanma_Suresi_dakika = record.Ucretsiz_Parklanma_Suresi_dakika;
            model.Tarifesi                         = record.Tarifesi;
            model.Park_Et_Devam_Et_Noktasi         = record.Park_Et_Devam_Et_Noktasi;


            List <Record> records = _parkcontext.Records.ToList();

            List <AltBolgeDTO> altBolgeDTOs = new List <AltBolgeDTO>();

            foreach (var item in records)
            {
                var recordControl = altBolgeDTOs.FirstOrDefault(x => x.AltBolgeAd == item.AltBolge);

                if (recordControl == null)
                {
                    AltBolgeDTO modelaltbolge = new AltBolgeDTO();

                    modelaltbolge.AltBolgeAd = item.AltBolge;
                    altBolgeDTOs.Add(modelaltbolge);
                }
            }

            model.AltBolgeDTOs = altBolgeDTOs;



            List <IlceDTO> IlceDTOs = new List <IlceDTO>();

            foreach (var item in records)
            {
                var recordControl = IlceDTOs.FirstOrDefault(x => x.IlceAd == item.Ilce);

                if (recordControl == null)
                {
                    IlceDTO modelılce = new IlceDTO();

                    modelılce.IlceAd = item.Ilce;
                    IlceDTOs.Add(modelılce);
                }
            }

            model.IlceDTOs = IlceDTOs;


            List <ParkTipiDTO> parkTipiDTOs = new List <ParkTipiDTO>();

            foreach (var item in records)
            {
                var recordControl = parkTipiDTOs.FirstOrDefault(x => x.ParkTipiAd == item.ParkTipi);

                if (recordControl == null)
                {
                    ParkTipiDTO modelparktipi = new ParkTipiDTO();

                    modelparktipi.ParkTipiAd = item.ParkTipi;
                    parkTipiDTOs.Add(modelparktipi);
                }
            }

            model.ParkTipiDTOs = parkTipiDTOs;


            return(View(model));
        }