Beispiel #1
0
        public IResult Add(Company company)
        {
            var result = _companyDal.GetAll(c => c.CompanyName == company.CompanyName);

            if (result.Count != 0)
            {
                return(new ErrorResult(Messages.CompanyAlreadyExist));
            }
            _companyDal.Add(company);
            return(new SuccessResult(Messages.ProductUnitAdded));
        }
 public ActionResult Add(int id)
 {
     if (_companyApplyDal.GetByID(id) != null)
     {
         CompanyApply companyApply = _companyApplyDal.GetByID(id);
         ICompanyDal  companyDal   = InstanceFactory.GetInstance <ICompanyDal>();
         Company      company      = new Company();
         company.CompanyName = companyApply.CompanyName;
         company.Email       = companyApply.EmailAddress;
         company.Password    = companyApply.Password;
         company.PhotoPath   = companyApply.PhotoPath;
         company.IsActive    = true;
         companyDal.Add(company);
         companyApply.IsActive = false;
         _companyApplyDal.Update(companyApply);
         return(RedirectToAction("Index"));
     }
     else
     {
         return(RedirectToAction("Error404", "Error"));
     }
 }
 public IResult Add(Company company)
 {
     _companyDal.Add(company);
     return(new SuccessResult(CompanyMessage.CompanyAddedSuccessfully));
 }
Beispiel #4
0
 public void Add(Company company)
 {
     _companyDal.Add(company);
 }
Beispiel #5
0
 public IResult Add(Company company)
 {
     _companyDal.Add(company);
     return(new SuccessResult(Messages.Company.AddSuccess));
 }
Beispiel #6
0
        public IResult Add(Company entity)
        {
            _companyDal.Add(entity);

            return(new SuccessResult());
        }
Beispiel #7
0
 public IResult Add(Company company)
 {
     companyDal.Add(company);
     return(new SuccessResult(company.Id.ToString()));
 }
Beispiel #8
0
 public IResult Add(Company company)
 {
     _companyDal.Add(company);
     return(new SuccessResult(MagicStrings.CastAdded));
 }
Beispiel #9
0
 public Company Add(Company company)
 {
     return(_companyDal.Add(company));
 }
Beispiel #10
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(thesis.model.Company model)
 {
     dal.Add(model);
 }
Beispiel #11
0
 public void Add(Entities.Company entity)
 {
     _companyDal.Add(entity);
 }
Beispiel #12
0
        public void Fill()
        {
            Company company = new Company();

            company.Id             = 1;
            company.Name           = "Bayram Galeri";
            company.City           = "Manisa";
            company.Address        = "İstiklal Mahallesi, Piyaleoğlu Cd. D:137, 45410 Turgutlu/Manisa";
            company.VehiclesNumber = 5;
            company.Star           = 10;

            User user = new User();

            user.Id           = 1;
            user.UserName     = "******";
            user.UserPassword = FormsAuthentication.HashPasswordForStoringInConfigFile("admin", "MD5");

            VehicleInformation vehicleInformation1 = new VehicleInformation();

            vehicleInformation1.Id               = 1;
            vehicleInformation1.Name             = "BMW";
            vehicleInformation1.Model            = "X6";
            vehicleInformation1.Address          = "Saadetdere Mahallesi 84. Sokak No:2/4 Avcılar/İstanbul";
            vehicleInformation1.MinLicenseAge    = 2;
            vehicleInformation1.MinAge           = 20;
            vehicleInformation1.DailyBorderKm    = 13350;
            vehicleInformation1.DailyLimitKm     = 5000;
            vehicleInformation1.Airbag           = true;
            vehicleInformation1.BaggageVolume    = 400;
            vehicleInformation1.SeatingCapacity  = 5;
            vehicleInformation1.DailyRentalPrice = 240;
            vehicleInformation1.CompanyID        = 1;
            vehicleInformation1.CustomerID       = 0;
            vehicleInformation1.isRentaled       = false;

            VehicleInformation vehicleInformation2 = new VehicleInformation();

            vehicleInformation2.Id               = 2;
            vehicleInformation2.Name             = "Mercedes";
            vehicleInformation2.Model            = "AMG G63";
            vehicleInformation2.Address          = "Mustafa Kemal Paşa Mahallesi Anafartalar Sokak No:80/40 Turgutlu/Manisa";
            vehicleInformation2.MinLicenseAge    = 2;
            vehicleInformation2.MinAge           = 20;
            vehicleInformation2.DailyBorderKm    = 25451;
            vehicleInformation1.DailyLimitKm     = 2000;
            vehicleInformation2.Airbag           = true;
            vehicleInformation2.BaggageVolume    = 380;
            vehicleInformation2.SeatingCapacity  = 5;
            vehicleInformation2.DailyRentalPrice = 220;
            vehicleInformation2.CompanyID        = 1;
            vehicleInformation2.CustomerID       = 0;
            vehicleInformation2.isRentaled       = false;

            VehicleInformation vehicleInformation3 = new VehicleInformation();

            vehicleInformation3.Id               = 3;
            vehicleInformation3.Name             = "Porsche";
            vehicleInformation3.Model            = "911 Turbo S Exclusive Series";
            vehicleInformation3.Address          = "Süleyman Seba Mahallesi Şeref Sokak No:19/03 Beşiktaş/İstanbul";
            vehicleInformation3.MinLicenseAge    = 2;
            vehicleInformation3.MinAge           = 20;
            vehicleInformation3.DailyBorderKm    = 4582;
            vehicleInformation1.DailyLimitKm     = 750;
            vehicleInformation3.Airbag           = true;
            vehicleInformation3.BaggageVolume    = 180;
            vehicleInformation3.SeatingCapacity  = 2;
            vehicleInformation3.DailyRentalPrice = 340;
            vehicleInformation3.CompanyID        = 1;
            vehicleInformation3.CustomerID       = 0;
            vehicleInformation3.isRentaled       = false;

            VehicleInformation vehicleInformation4 = new VehicleInformation();

            vehicleInformation4.Id               = 4;
            vehicleInformation4.Name             = "Lamborghini";
            vehicleInformation4.Model            = "Veneno";
            vehicleInformation4.Address          = "Şenol Güneş Mahallesi Şampiyon Sokak No:59/16 Konak/İzmir";
            vehicleInformation4.MinLicenseAge    = 2;
            vehicleInformation4.MinAge           = 20;
            vehicleInformation4.DailyBorderKm    = 1400;
            vehicleInformation1.DailyLimitKm     = 500;
            vehicleInformation4.Airbag           = true;
            vehicleInformation4.BaggageVolume    = 140;
            vehicleInformation4.SeatingCapacity  = 2;
            vehicleInformation4.DailyRentalPrice = 540;
            vehicleInformation4.CompanyID        = 1;
            vehicleInformation4.CustomerID       = 0;
            vehicleInformation4.isRentaled       = false;

            VehicleInformation vehicleInformation5 = new VehicleInformation();

            vehicleInformation5.Id               = 5;
            vehicleInformation5.Name             = "Tofaş";
            vehicleInformation5.Model            = "Şahin";
            vehicleInformation5.Address          = "Su Mahallesi 4. Sokak No:8/2 Kızılay/Ankara";
            vehicleInformation5.MinLicenseAge    = 0;
            vehicleInformation5.MinAge           = 18;
            vehicleInformation5.DailyBorderKm    = 85052;
            vehicleInformation1.DailyLimitKm     = 7000;
            vehicleInformation5.Airbag           = false;
            vehicleInformation5.BaggageVolume    = 200;
            vehicleInformation5.SeatingCapacity  = 5;
            vehicleInformation5.DailyRentalPrice = 50;
            vehicleInformation5.CompanyID        = 1;
            vehicleInformation5.CustomerID       = 0;
            vehicleInformation5.isRentaled       = false;

            companyDal.Add(company);
            userDal.Add(user);
            vehicleDal.Add(vehicleInformation1);
            vehicleDal.Add(vehicleInformation2);
            vehicleDal.Add(vehicleInformation3);
            vehicleDal.Add(vehicleInformation4);
            vehicleDal.Add(vehicleInformation5);
        }
Beispiel #13
0
 public void Add(Company entity)
 {
     _companyDal.Add(entity);
 }
Beispiel #14
0
 public IResult Add(Company company)
 {
     //İş Kodları
     _companyDal.Add(company);
     return(new SuccessResult(Messages.CompanyAdded));
 }