Esempio n. 1
0
        public async Task <HttpResponseMessage> Put(OrphanageDataModel.RegularData.Family family)
        {
            var ret = false;

            ret = await _FamilyDBService.SaveFamily(family);

            if (ret)
            {
                return(_httpMessageConfiguerer.OK());
            }
            else
            {
                return(_httpMessageConfiguerer.NothingChanged());
            }
        }
        public async Task <HttpResponseMessage> Put(OrphanageDataModel.Persons.Father father)
        {
            var ret = 0;

            ret = await _FatherDBService.SaveFather(father);

            if (ret > 0)
            {
                return(_httpMessageConfiguerer.OK());
            }
            else
            {
                return(_httpMessageConfiguerer.NothingChanged());
            }
        }
Esempio n. 3
0
        public async Task <HttpResponseMessage> Put(object account)
        {
            var accountEntity = JsonConvert.DeserializeObject <OrphanageDataModel.FinancialData.Account>(account.ToString());
            var ret           = false;

            ret = await _accountDbService.SaveAccount(accountEntity);

            if (ret)
            {
                return(_httpMessageConfiguerer.OK());
            }
            else
            {
                return(_httpMessageConfiguerer.NothingChanged());
            }
        }
        public async Task <HttpResponseMessage> Put(object guarantor)
        {
            var guarantorEntity = JsonConvert.DeserializeObject <OrphanageDataModel.Persons.Guarantor>(guarantor.ToString());
            var ret             = false;

            ret = await _GuarantorDBService.SaveGuarantor(guarantorEntity);

            if (ret)
            {
                return(_httpMessageConfiguerer.OK());
            }
            else
            {
                return(_httpMessageConfiguerer.NothingChanged());
            }
        }
        public async Task <HttpResponseMessage> Post(object orphan)
        {
            var orp = JsonConvert.DeserializeObject <OrphanageDataModel.Persons.Orphan>(orphan.ToString());

            OrphanageDataModel.Persons.Orphan ret = null;

            ret = await _OrphanDBService.AddOrphan(orp);

            if (ret != null)
            {
                return(Request.CreateResponse(System.Net.HttpStatusCode.Created, ret));
            }
            else
            {
                return(_httpMessageConfigurere.OK());
            }
        }
Esempio n. 6
0
        public async Task <HttpResponseMessage> Delete(int UId)
        {
            var ret = await _userDBService.DeleteUser(UId);

            if (ret)
            {
                return(_httpResponseMessageConfiguerer.OK());
            }
            else
            {
                return(_httpResponseMessageConfiguerer.NothingChanged());
            }
        }