예제 #1
0
        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." }));
            }
        }
예제 #2
0
        public IActionResult Update(HeatingType heatingType)
        {
            var result = _heatingTypeService.Update(heatingType);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
 public IResult Update(HeatingType heatingType)
 {
     _heatingTypeDal.Update(heatingType);
     return(new SuccessResult(Messages.HeatingTypeUpdated));
 }
예제 #5
0
 public IResult Delete(HeatingType heatingType)
 {
     _heatingTypeDal.Delete(heatingType);
     return(new SuccessResult(Messages.HeatingTypeDeleted));
 }
예제 #6
0
        public IResult Add(HeatingType heatingType)
        {
            _heatingTypeDal.Add(heatingType);

            return(new SuccessResult(Messages.HeatingTypeAdded));
        }
예제 #7
0
 public void Update(HeatingType model)
 {
     _uow.Repository <HeatingType>().Update(model);
 }
예제 #8
0
 public async Task <HeatingType> Add(HeatingType model)
 {
     return(await _uow.Repository <HeatingType>().Insert(model));
 }
예제 #9
0
 public static object SetHeatingType(HeatingType? value)
 {
     return value;
 }
예제 #10
0
 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;
 }
예제 #12
0
        public HeatingType getHeatingType(int propertyTypeId)
        {
            HeatingType type = mediator.DataManager.getHeatingType(propertyTypeId);

            return(type);
        }