예제 #1
0
        public override Task <Empty> DeleteCompanyLocation(CompanyLocationPayload request, ServerCallContext context)
        {
            CompanyLocationPoco poco = _logic.Get(Guid.Parse(request.Id));

            _logic.Delete(new CompanyLocationPoco[] { poco });
            return(new Task <Empty>(() => new Empty()));
        }
예제 #2
0
 public override Task <Empty> DeleteCompanyLocation(CompanyLocationPayload request, ServerCallContext context)
 {
     _ = _logic.Get(Guid.Parse(request.Id)) ??
         throw new ArgumentNullException("No Company Location Record with this Id Found ");
     _logic.Delete(new CompanyLocationPoco[] { _logic.Get(Guid.Parse(request.Id)) });
     return(null);
 }
        public override Task <Empty> DeleteCompanyLocation(CompanyLocationPayload request, ServerCallContext context)
        {
            CompanyLocationPoco[] pocos = new CompanyLocationPoco[1];
            pocos[0].Id          = Guid.Parse(request.Id);
            pocos[0].Company     = Guid.Parse(request.Company);
            pocos[0].CountryCode = request.CountryCode;
            pocos[0].Province    = request.Province;
            pocos[0].Street      = request.Street;
            pocos[0].City        = request.City;
            pocos[0].PostalCode  = request.PostalCode;

            _logic.Delete(pocos);
            return(new Task <Empty>(null));
        }
예제 #4
0
 public override Task <Empty> UpdateCompanyLocation(CompanyLocationPayload request, ServerCallContext context)
 {
     CompanyLocationPoco[] pocos = { new CompanyLocationPoco()
                                     {
                                         Id          = Guid.Parse(request.Id),
                                         Company     = Guid.Parse(request.Company),
                                         Street      = request.Street,
                                         City        = request.City,
                                         Province    = request.Province,
                                         CountryCode = request.CountryCode,
                                         PostalCode  = request.PostalCode
                                     } };
     _logic.Update(pocos);
     return(new Task <Empty>(() => new Empty()));
 }
 public override Task <Empty> UpdateCompanyLocation(CompanyLocationPayload request, ServerCallContext context)
 {
     CompanyLocationPoco[] pocos = new CompanyLocationPoco[1];
     foreach (var poco in pocos)
     {
         poco.Id          = Guid.Parse(request.Id);
         poco.Company     = Guid.Parse(request.Company);
         poco.CountryCode = request.CountryCode;
         poco.Province    = request.Province;
         poco.Street      = request.Street;
         poco.City        = request.City;
         poco.PostalCode  = request.PostalCode;
     }
     _logic.Update(pocos);
     return(new Task <Empty>(() => new Empty()));
 }
예제 #6
0
        public override Task <Empty> CreateCompanyLocation(CompanyLocationPayload request, ServerCallContext context)
        {
            CompanyLocationPoco poco = new CompanyLocationPoco()
            {
                Id          = Guid.Parse(request.Id),
                Company     = Guid.Parse(request.Company),
                Street      = request.Street,
                City        = request.City,
                Province    = request.Province,
                CountryCode = request.CountryCode,
                PostalCode  = request.PostalCode,
            };

            _logic.Add(new CompanyLocationPoco[] { poco });
            return(null);
        }
예제 #7
0
        public CompanyLocationPoco[] GetArray(CompanyLocationPayload request)
        {
            CompanyLocationPoco poco = new CompanyLocationPoco()
            {
                Id          = Guid.Parse(request.Id),
                Company     = Guid.Parse(request.Company),
                CountryCode = request.CountryCode,
                Province    = request.Province,
                Street      = request.Street,
                City        = request.City,
                PostalCode  = request.PostalCode
            };

            CompanyLocationPoco[] pocos = new CompanyLocationPoco[1];
            pocos[0] = poco;
            return(pocos);
        }
예제 #8
0
        public override Task <Empty> UpdateCompanyLocation(CompanyLocationPayload request, ServerCallContext context)
        {
            _ = _logic.Get(Guid.Parse(request.Id)) ?? throw new ArgumentNullException("No Company Location Record with this Id Found");

            var poco = new CompanyLocationPoco()
            {
                Id          = Guid.Parse(request.Id),
                Company     = Guid.Parse(request.Company),
                Street      = request.Street,
                City        = request.City,
                Province    = request.Province,
                CountryCode = request.CountryCode,
                PostalCode  = request.PostalCode,
            };

            _logic.Update(new CompanyLocationPoco[] { poco });
            return(null);
        }
예제 #9
0
 public override Task <Empty> DeleteCompanyLocation(CompanyLocationPayload request, ServerCallContext context)
 {
     _logic.Delete(GetArray(request));
     return(new Task <Empty>(null));
 }