public void Create(BustoIslaidosViewModel bustoIslaidos) { var entity = new BustoIslaidos(); entity.MetaiId = bustoIslaidos.Metai.Id; if (entity.MetaiId == null) { entity.MetaiId = 1; } if (bustoIslaidos.Metai == null) { entity.MetaiId = bustoIslaidos.Metai.Id; } entity.MenuoId = bustoIslaidos.Menesiai.Id; entity.SavaiteId = bustoIslaidos.Savaites.Id; entity.DienaId = bustoIslaidos.Dienos.Id; entity.Data = bustoIslaidos.Data; entity.Paskola = bustoIslaidos.Paskola; entity.MalgozatosTelefonas = bustoIslaidos.MalgozatosTelefonas; entity.JuliausTelefonas = bustoIslaidos.JuliausTelefonas; entity.Elektra = bustoIslaidos.Elektra; entity.Vanduo = bustoIslaidos.Vanduo; entity.Šildymas = bustoIslaidos.Šildymas; entity.TvIrInterntetas = bustoIslaidos.TvIrInterntetas; entity.BendriMokesciai = bustoIslaidos.BendriMokesciai; entity.Kita = bustoIslaidos.Kita; entities.BustoIslaidos.Add(entity); entities.SaveChanges(); bustoIslaidos.Id = entity.Id; }
public void Destroy(BustoIslaidosViewModel bustoIslaidos) { var entity = new BustoIslaidos(); entity.Id = bustoIslaidos.Id; entities.BustoIslaidos.Attach(entity); entities.BustoIslaidos.Remove(entity); entities.SaveChanges(); }
public bool ValidateBustoIslaidos(BustoIslaidos bustoIslaidos) { return _modelStateDictionary.IsValid; }
public BustoIslaidos FillBustoIslaidos(BustoIslaidos model) { throw new System.NotImplementedException(); }