コード例 #1
0
        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;
        }
コード例 #2
0
        public void Destroy(BustoIslaidosViewModel bustoIslaidos)
        {
            var entity = new BustoIslaidos();

            entity.Id = bustoIslaidos.Id;
            entities.BustoIslaidos.Attach(entity);
            entities.BustoIslaidos.Remove(entity);
            entities.SaveChanges();
        }
コード例 #3
0
 public bool ValidateBustoIslaidos(BustoIslaidos bustoIslaidos)
 {
     return _modelStateDictionary.IsValid;
 }
コード例 #4
0
 public BustoIslaidos FillBustoIslaidos(BustoIslaidos model)
 {
     throw new System.NotImplementedException();
 }