private void UpdateCompanyDetails(object sender, BasicDeliverEventArgs e)
        {
            var         body = e.Body.ToArray();
            var         json = Encoding.UTF8.GetString(body);
            Company2Dto Dto  = JsonConvert.DeserializeObject <Company2Dto>(json);

            service.UpdateCompanyDetailsFromMS2(Dto);
        }
Ejemplo n.º 2
0
        public bool UpdateCompanyDetailsFromMS2(Company2Dto dto)
        {
            var companies = from obj in context.Company
                            where obj.Id == dto.CompanyId
                            select obj;

            foreach (var company in companies)
            {
                company.CompanyCode = dto.CompanyCode;
                company.CompanyName = dto.CompanyName;
            }
            var RowsAffected = context.SaveChanges();

            return(RowsAffected > 0);
        }
 public bool UpdateCompanyDetailsFromMS2(Company2Dto dto)
 {
     return(repository.UpdateCompanyDetailsFromMS2(dto));
 }