public async Task <ResponceModel> Add([FromBody] HeatingType model) { var identifier = User.Claims.FirstOrDefault(p => p.Type == "id"); if (identifier == null) { return(new ResponceModel(401, "FAILED", null, new string[] { "Yetkilendirme Hatası." })); } try { var heatingType = await heatingTypeService.Add(model); if (await heatingTypeService.SaveChangesAsync()) { return(new ResponceModel(200, "OK", heatingType, null)); } else { return(new ResponceModel(400, "ERROR", null, new string[] { "Veri eklenirken bir hata oluştu." })); } } catch (Exception ex) { await _logService.Add(new SystemLog() { Content = ex.Message, CreateDate = DateTime.Now, UserId = 0, EntityName = heatingTypeService.GetType().Name }); return(new ResponceModel(500, "ERROR", null, new string[] { "Veri eklenirken bir hata oluştu." })); } }
public IActionResult Update(HeatingType heatingType) { var result = _heatingTypeService.Update(heatingType); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
private static string GetHeatingType(HeatingType type) { switch (type) { case HeatingType.NetworkNaturalGas: return("ogrzewanie gazowe"); case HeatingType.LiquefiedNaturalGas: return("ogrzewanie gazowe"); case HeatingType.Biomass: return("kocioł opalany granulatem drzewnym, tzw. biomasą"); case HeatingType.Electricity: return("ogrzewanie elektryczne"); case HeatingType.NetworkHeat: return("podłączenie do sieci ciepłowniczej"); default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } }
public IResult Update(HeatingType heatingType) { _heatingTypeDal.Update(heatingType); return(new SuccessResult(Messages.HeatingTypeUpdated)); }
public IResult Delete(HeatingType heatingType) { _heatingTypeDal.Delete(heatingType); return(new SuccessResult(Messages.HeatingTypeDeleted)); }
public IResult Add(HeatingType heatingType) { _heatingTypeDal.Add(heatingType); return(new SuccessResult(Messages.HeatingTypeAdded)); }
public void Update(HeatingType model) { _uow.Repository <HeatingType>().Update(model); }
public async Task <HeatingType> Add(HeatingType model) { return(await _uow.Repository <HeatingType>().Insert(model)); }
public static object SetHeatingType(HeatingType? value) { return value; }
public IApartmentAdFactory WithOptions(bool hasParking, bool hasBasement, HeatingType heatingType) => WithOptions(new Options(hasParking, hasBasement, heatingType));
public CalculateCostsQuery(int buildingArea, HeatingType heatingType) { BuildingArea = buildingArea; HeatingType = heatingType; }
public HeatingType getHeatingType(int propertyTypeId) { HeatingType type = mediator.DataManager.getHeatingType(propertyTypeId); return(type); }