Пример #1
0
        public int CompanyUpdate(Company company)
        {
            int id = 0;
                context.Entry(company).State = EntityState.Modified;
                context.SaveChanges();
                id = company.CompanyID;

            return id;
        }
Пример #2
0
        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;
            }
        }
Пример #3
0
 public int CompanyUpdate(Company company)
 {
     return  userRepository.CompanyUpdate(company);
 }