Пример #1
0
        public ActionResult Create([Bind(Include = "Id,Year,Make,Model,QTY,VehicleId,FuelTankCapacity,Rating")] Vehicles vehicles)
        {
            if (ModelState.IsValid)
            {
                db.Vehicles.Add(vehicles);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(vehicles));
        }
Пример #2
0
        public ActionResult Create([Bind(Include = "Id,Type")] VehicleTypes vehicleTypes)
        {
            if (ModelState.IsValid)
            {
                db.VehicleTypes.Add(vehicleTypes);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(vehicleTypes));
        }
 public void Create(Tasadof t)
 {
     using (var db = new CarDB())
     {
         db.Tasadofat.Add(t);
         db.SaveChanges();
     }
 }
 public void Create(FanniOperation t)
 {
     using (var db = new CarDB())
     {
         db.FanniOperations.Add(t);
         db.SaveChanges();
     }
 }
 public void Create(Driver t)
 {
     using (var db = new CarDB())
     {
         db.Drivers.Add(t);
         db.SaveChanges();
     }
 }
Пример #6
0
 public void Create(Fuel t)
 {
     using (var db = new CarDB())
     {
         db.Fuels.Add(t);
         db.SaveChanges();
     }
 }
 public void Delete(int id)
 {
     using (var db = new CarDB())
     {
         var f = db.FanniOperations.Find(id);
         db.FanniOperations.Remove(f);
         db.SaveChanges();
     }
 }
Пример #8
0
        public void Create(Models.Car t)
        {
            using (var db = new CarDB())
            {
                db.Cars.Add(t);

                db.SaveChanges();
            }
        }
 public void Delete(int id)
 {
     using (var db = new CarDB())
     {
         var b = db.Bimeha.Find(id);
         b.Deleted = true;
         db.SaveChanges();
     }
 }
 public void Delete(int id)
 {
     using (var db = new CarDB())
     {
         var a = db.Tasadofat.Find(id);
         db.Tasadofat.Remove(a);
         db.SaveChanges();
     }
 }
Пример #11
0
        public void Create(Avarez t)
        {
            using (var db = new CarDB())
            {
                db.Avarezha.Add(t);

                db.SaveChanges();
            }
        }
        public void Create(Mamoriat t)
        {
            using (var db = new CarDB())
            {
                db.Mamoriatha.Add(t);

                db.SaveChanges();
            }
        }
 public void UpdateLoginDate(int uId)
 {
     using (var db = new CarDB())
     {
         var u = db.Users.Find(uId);
         u.LastLoginDateTime = DateTime.UtcNow;
         db.SaveChanges();
     }
 }
        public void Create(Bimeh t)
        {
            using (var db = new CarDB())
            {
                db.Bimeha.Add(t);

                db.SaveChanges();
            }
        }
Пример #15
0
 public void Delete(int id)
 {
     using (var db = new CarDB())
     {
         var a = db.Avarezha.Find(id);
         a.Deleted = true;
         db.SaveChanges();
     }
 }
 public void Delete(int id)
 {
     using (var db = new CarDB())
     {
         var m = db.Mamoriatha.Find(id);
         m.Deleted = true;
         db.SaveChanges();
     }
 }
 public void Delete(int id)
 {
     using (var db = new CarDB())
     {
         var m = db.PersonalCars.Find(id);
         m.Deleted = true;
         db.SaveChanges();
     }
 }
        public void Create(PersonalCar t)
        {
            using (var db = new CarDB())
            {
                db.PersonalCars.Add(t);

                db.SaveChanges();
            }
        }
        public void DeleteByOperationId(int fId)
        {
            using (var db = new CarDB())
            {
                var op = db.FanniOperationDetails.Where(p => p.FanniOperationId == fId);
                db.FanniOperationDetails.RemoveRange(op);

                db.SaveChanges();
            }
        }
 public void Update(FanniOperation t)
 {
     using (var db = new CarDB())
     {
         var f = db.FanniOperations.Find(t.Id);
         f.CarId       = t.CarId;
         f.Description = t.Description;
         f.Price       = t.Price;
         f.Tarikh      = t.Tarikh;
         db.SaveChanges();
     }
 }
Пример #21
0
 public void Update(Avarez t)
 {
     using (var db = new CarDB())
     {
         var a = db.Avarezha.Find(t.Id);
         a.CarId   = t.CarId;
         a.Rahgiri = t.Rahgiri;
         a.Deleted = t.Deleted;
         a.Price   = t.Price;
         a.Tarikh  = t.Tarikh;
         db.SaveChanges();
     }
 }
        public void Update(Tasadof t)
        {
            using (var db = new CarDB())
            {
                var m = db.Tasadofat.Find(t.Id);
                m.CarId    = t.CarId;
                m.DriverId = t.DriverId;
                m.Price    = t.Price;
                m.Tarikh   = t.Tarikh;

                db.SaveChanges();
            }
        }
        public void EndMamoriat(int id)
        {
            using (var db = new CarDB())
            {
                var m = db.PersonalCars.Find(id);
                if (m != null)
                {
                    m.Finished = true;
                }

                db.SaveChanges();
            }
        }
        public void Update(Driver t)
        {
            using (var db = new CarDB())
            {
                var m = db.Drivers.Find(t.Id);
                m.CellPhone = t.CellPhone;
                m.MelliCode = t.MelliCode;
                m.Name      = t.Name;


                db.SaveChanges();
            }
        }
Пример #25
0
        public void Update(Fuel t)
        {
            using (var db = new CarDB())
            {
                var a = db.Fuels.Find(t.Id);
                a.CarId          = t.CarId;
                a.FactorNumber   = t.FactorNumber;
                a.Kilometer      = t.Kilometer;
                a.Mablagh        = t.Mablagh;
                a.FuelTypeId     = t.FuelTypeId;
                a.TarikhPardakht = t.TarikhPardakht;

                db.SaveChanges();
            }
        }
        public void Update(Bimeh t)
        {
            using (var db = new CarDB())
            {
                var b = db.Bimeha.Find(t.Id);
                b.CarId         = t.CarId;
                b.Type          = t.Type;
                b.Name          = t.Name;
                b.Price         = t.Price;
                b.Shomareh      = t.Shomareh;
                b.TarikhEngheza = t.TarikhEngheza;
                b.TarikhSodour  = t.TarikhSodour;

                db.SaveChanges();
            }
        }
        public void Update(PersonalCar t)
        {
            using (var db = new CarDB())
            {
                var m = db.PersonalCars.Find(t.Id);

                m.CarId             = t.CarId;
                m.DriverId          = t.DriverId;
                m.KilometerBargasht = t.KilometerBargasht;
                m.KilometerRaft     = t.KilometerRaft;
                m.Finished          = t.Finished;

                m.ShomareNameh   = t.ShomareNameh;
                m.TarikhBargasht = t.TarikhBargasht;
                m.TarikhRaft     = t.TarikhRaft;

                db.SaveChanges();
            }
        }
        public void Update(Mamoriat t)
        {
            using (var db = new CarDB())
            {
                var m = db.Mamoriatha.Find(t.Id);
                m.Mabda             = t.Mabda;
                m.CarId             = t.CarId;
                m.DriverId          = t.DriverId;
                m.Maghsad           = t.Maghsad;
                m.ShomareNameh      = t.ShomareNameh;
                m.TarikhBargasht    = t.TarikhBargasht;
                m.TarikhRaft        = t.TarikhRaft;
                m.KilometerBargasht = t.KilometerBargasht;
                m.KilometerRaft     = t.KilometerRaft;
                m.Finished          = t.Finished;

                m.ZamanBargasht = t.ZamanBargasht;
                m.ZamanRaft     = t.ZamanRaft;

                db.SaveChanges();
            }
        }