public int CompanyUpdate(Company company) { int id = 0; context.Entry(company).State = EntityState.Modified; context.SaveChanges(); id = company.CompanyID; return id; }
public Int32 GetCompanyID(string companyname,int countryid) { Int32 companyid = -1; companyid = SearchCompanyID(companyname); if (companyid > 0) { return companyid; } else { var company = new Company { Name = companyname, CountryID=countryid, CreatedTime = DateTime.Now, ModifiedTime = DateTime.Now }; context.Companies.Add(company); context.SaveChanges(); companyid = SearchCompanyID(companyname); return companyid; } }
public int CompanyUpdate(Company company) { return userRepository.CompanyUpdate(company); }