public static int Insert(Company company) { var db = DataBaseHelper.Open(); company.Id = LastIdSvc.GetNextTableId("Companies"); db.Companies.Insert(company); return company.Id; }
public CompanyEditModel(Company company) : this() { this.Id = company.Id; this.CompanyName = company.CompanyName; this.CompanyType = company.CompanyType; this.ProvinceId = company.Province.Id; this.CityId = company.City.Id; this.DistrictId = company.Dictrict.Id; this.Email = company.Email; this.Address = company.Address; this.Telephone = company.Telephone; this.CityList = Utilts.LoadCityByProvinceId(this.ProvinceId); this.DistrictList = Utilts.LoadDistrictByCityId(this.CityId); }
public static void Update(Company company) { var db = DataBaseHelper.Open(); db.Companies.Update(company); }