public void AddBus(Company company, Bus bus) { bus.Company = company; company.Busses.Add(bus); this.companyRepository.Update(company); this.unitOfWork.Commit(); }
public ActionResult Register(Company company) { //if (!ModelState.IsValid) //{ // return View(company); //} this.cs.CreateCompany(company); return this.View(company); }
public void CreateCompany(Company company) { // test we add a bus var bus = new Bus { Company = company, Capacity = 65, Number = "T345ABG" }; company.Busses.Add(bus); this.companyRepository.Insert(company); this.unitOfWork.Commit(); }
/// <summary> /// The register. /// </summary> /// <returns> /// The <see cref="ActionResult"/>. /// </returns> public ActionResult Register() { var company = new Company(); return this.View(company); }
public ActionResult Payment(int id, Company company) { return this.SendRequestResult("Data saved", RequestResultType.Success); }
public ActionResult UpdateCompanyInfo(Company company) { var badFields = new StringBuilder(); //if (!ModelState.IsValid) //{ // foreach (var k in this.ModelState.Keys.Where(k => !this.ModelState.IsValidField(k))) // { // badFields.Append(k); // badFields.Append(" "); // } // return this.SendRequestResult(string.Format("Please correct the errors in {0} and submit again", badFields.ToString()), RequestResultType.Warning); //} try { //this.cs.EditCompany(company); return this.SendJsonRequestResult("Data saved", true, null); } catch (Exception ex) { return this.SendJsonRequestResult(ex.Message, false, null); } }
public void DeleteCompany(Company company) { this.companyRepository.Delete(company); this.unitOfWork.Commit(); }
public void EditCompany(Company company) { this.companyRepository.Update(company); this.unitOfWork.Commit(); }