Beispiel #1
0
        public ServiceResult Delete(UnitOfMeasure n)
        {
            if (n == null || string.IsNullOrWhiteSpace(n.UUID))
            {
                return(ServiceResponse.Error("Invalid account was sent."));
            }

            UnitOfMeasureManager UnitsOfMeasureManager = new UnitOfMeasureManager(Globals.DBConnectionKey, this.GetAuthToken(Request));

            return(UnitsOfMeasureManager.Delete(n));
        }
        public ServiceResult Delete(UnitOfMeasure n)
        {
            if (n == null || string.IsNullOrWhiteSpace(n.UUID))
            {
                return(ServiceResponse.Error("Invalid account was sent."));
            }

            UnitOfMeasureManager UnitsOfMeasureManager = new UnitOfMeasureManager(Globals.DBConnectionKey, Request.Headers?.Authorization?.Parameter);

            return(UnitsOfMeasureManager.Delete(n));
        }
        public ServiceResult Delete(string uuid)
        {
            if (string.IsNullOrWhiteSpace(uuid))
            {
                return(ServiceResponse.Error("Invalid id was sent."));
            }

            UnitOfMeasureManager UnitsOfMeasureManager = new UnitOfMeasureManager(Globals.DBConnectionKey, Request.Headers?.Authorization?.Parameter);

            UnitOfMeasure fa = (UnitOfMeasure)UnitsOfMeasureManager.GetBy(uuid);

            if (fa == null)
            {
                return(ServiceResponse.Error("Could not find measure."));
            }

            return(UnitsOfMeasureManager.Delete(fa));
        }
Beispiel #4
0
        public ServiceResult Delete(string uuid)
        {
            if (string.IsNullOrWhiteSpace(uuid))
            {
                return(ServiceResponse.Error("Invalid id was sent."));
            }

            UnitOfMeasureManager UnitsOfMeasureManager = new UnitOfMeasureManager(Globals.DBConnectionKey, this.GetAuthToken(Request));
            var res = UnitsOfMeasureManager.Get(uuid);

            if (res.Code != 200)
            {
                return(res);
            }

            UnitOfMeasure fa = (UnitOfMeasure)res.Result;

            return(UnitsOfMeasureManager.Delete(fa));
        }