public ResponseSerializer Put(int id, [FromBody] GatewaySerializer gatewaySerializer)
 {
     return(new ResponseSerializer(
                200,
                "success",
                this._gatewayBus.UpdateGateway(id, gatewaySerializer)));
 }
예제 #2
0
        public GatewaySerializer GetGatewayById(int id)
        {
            GatewayModel      gateway = this._gatewayDao.GetById(id);
            GatewaySerializer result  = new GatewaySerializer(gateway);

            return(result);
        }
 public ResponseSerializer Post([FromBody] GatewaySerializer gatewaySerializer)
 {
     return(new ResponseSerializer(
                200,
                "success",
                this._gatewayBus.CreateNewGateway(gatewaySerializer)));
 }
예제 #4
0
        public String CreateNewGateway(GatewaySerializer gatewaySerializer)
        {
            GatewayModel gatewayModel = new GatewayModel();

            gatewayModel.HardwareGatewayId = gatewaySerializer.hardwareGatewayID;
            gatewayModel.GatewayName       = gatewaySerializer.gatewayName;
            gatewayModel.City         = gatewaySerializer.city;
            gatewayModel.Factory      = gatewaySerializer.factory;
            gatewayModel.Workshop     = gatewaySerializer.workshop;
            gatewayModel.GatewayType  = gatewaySerializer.gatewayType;
            gatewayModel.GatewayState = gatewaySerializer.gatewayState;
            gatewayModel.ImageUrl     = gatewaySerializer.imageUrl;
            gatewayModel.Remark       = gatewaySerializer.remark;
            return(this._gatewayDao.Create(gatewayModel));
        }