예제 #1
0
        public void AddBus(Company company, Bus bus)
        {
            bus.Company = company;
            company.Busses.Add(bus);

           this.companyRepository.Update(company);
           this.unitOfWork.Commit();
        }
예제 #2
0
        public ActionResult Register(Company company)
        {
            //if (!ModelState.IsValid)
            //{
            //    return View(company);
            //}

            this.cs.CreateCompany(company);

            return this.View(company);
        }
예제 #3
0
        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(); 
        }
예제 #4
0
        /// <summary>
        /// The register.
        /// </summary>
        /// <returns>
        /// The <see cref="ActionResult"/>.
        /// </returns>
        public ActionResult Register()
        {
            var company = new Company();

            return this.View(company);
        }
예제 #5
0
        public ActionResult Payment(int id, Company company)
        {

            return this.SendRequestResult("Data saved", RequestResultType.Success);
        }
예제 #6
0
        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);
            }

        }
예제 #7
0
 public void DeleteCompany(Company company)
 {
     this.companyRepository.Delete(company);
     this.unitOfWork.Commit();
 }
예제 #8
0
 public void EditCompany(Company company)
 {
     this.companyRepository.Update(company);
     this.unitOfWork.Commit();
 }