public static servi Ver_Servis(ref otosisdbEntities dbModel, int ServisID) { servi servis = null; servis = (from abc in dbModel.servis where abc.ServisID == ServisID select abc).FirstOrDefault(); if (servis != null) { dbModel.Refresh(RefreshMode.StoreWins, servis); } return(servis); }
public static int ekleServisKayit(int aracid) { otoservisdbEntities db = new otoservisdbEntities(); using (db) { var tarih = DateTime.Today; servi yenikayit = new servi(); yenikayit.aracID = aracid; yenikayit.servisGiris = tarih; db.servis.Add(yenikayit); db.SaveChanges(); return(yenikayit.servisID); } }