Example #1
0
 public BuyRecordRepo()
 {
     _context = new CarMangerContext();
     Persons  = new Dictionary <int, BuyRecords>();
     lss      = _context.BuyRecords.Include(a => a.Buy).Include(a => a.AfterBuyExpencess).ToList();
     lss.ForEach(async r => await AddBuyRecords(r));
 }
Example #2
0
 public IncomeRepo()
 {
     _context = new CarMangerContext();
     Persons  = new Dictionary <int, Income>();
     lss      = _context.Income.ToList();
     lss.ForEach(async r => await AddIncome(r));
 }
Example #3
0
 public CapitalshareRepo()
 {
     _context = new CarMangerContext();
     Persons  = new Dictionary <int, CapitalShare>();
     lss      = _context.CapitalShare.ToList();
     lss.ForEach(a => addcc(a));
 }
Example #4
0
 public carInfo()
 {
     _context = new CarMangerContext();
     Persons  = new Dictionary <int, BUYACARINFO>();
     lss      = _context.BuyRecords.Include(a => a.AfterBuyExpencess).Include(a => a.Buy).Include(a => a.Outcome).Include(a => a.Partner).Select(a => new BUYACARINFO()
     {
         CarOwener       = a.Buy.Car.Owener,
         CarID           = a.Buy.Car.CarId,
         cashes          = a.Outcome.Cash,
         checks          = a.Outcome.Check,
         DateOfBuy       = a.Buy.Date,
         IdPhoto         = a.Buy.Customer.IdPhoto,
         IDNumber        = a.Buy.Customer.Idnumber,
         Insurance       = a.Buy.Car.Insurance,
         ManufactureName = a.Buy.Car.Model.Manufacture.Name,
         ModelName       = a.Buy.Car.Model.Name,
         moreDetails     = a.Buy.Car.MoreDetails,
         PriceOutcome    = a.Outcome.Price,
         SaleAdress      = a.Buy.Customer.Adress,
         SaleName        = a.Buy.Customer.Name,
         SalePhone       = a.Buy.Customer.Phone,
         caridd          = a.Buy.CarId
     }).ToList();
     lss.ForEach(r => AddBuyRecords(r));
 }
Example #5
0
 public CustomerRepo()
 {
     _context = new CarMangerContext();
     Persons  = new Dictionary <int, Customer>();
     lss      = _context.Customer.ToList();
     lss.ForEach(async r => await AddCustomer(r));
 }
Example #6
0
 public AfterSellExpencessRepo()
 {
     _context = new CarMangerContext();
     Persons  = new Dictionary <int, AfterSellExpncess>();
     lss      = _context.AfterSellExpncess.OrderBy(a => a.Date).ToList();
     lss.ForEach(action: async r => await AddAfterSellExpncess(r));
 }
Example #7
0
 public SalepersonRepos()
 {
     _context = new CarMangerContext();
     Persons  = new Dictionary <int, SalePerson>();
     lss      = _context.SalePerson.ToList();
     lss.ForEach(async r => await AddSalePerson(r));
 }
Example #8
0
 public SellRecordRepo()
 {
     _context = new CarMangerContext();
     Persons  = new Dictionary <int, SellRecords>();
     lss      = _context.SellRecords.Include(a => a.AfterSellExpncess).Include(a => a.Sale).ToList();
     lss.ForEach(async r => await AddsellRecords(r));
 }
Example #9
0
        public ModelRepo()
        {
            _context = new CarMangerContext();
            Persons  = new Dictionary <int, Model>();
            lss      = _context.Model.ToList <Model>();

            lss.ForEach(async r => await AddModel(r));
        }
Example #10
0
 public CashRepo(UserManager <IdentityUser> userManager)
 {
     cc           = new callproc();
     _userManager = userManager;
     _context     = new CarMangerContext();
     Persons      = new Dictionary <int, Cash>();
     lss          = _context.Cash.ToList();
     lss.ForEach(async r => await AddCashAsync(r));
 }
Example #11
0
 public CheckRepo(IHostingEnvironment hostingEnvironment)
 {
     cc = new callproc();
     this._hostingEnvironment = hostingEnvironment;
     _context = new CarMangerContext();
     Persons  = new Dictionary <int, Check>();
     lss      = _context.Check.ToList();
     lss.ForEach(r => AddCheck(r));
 }
Example #12
0
        public ManufactureRepo()
        {
            _context = new CarMangerContext();
            Persons  = new Dictionary <int, Manufacture>();
            lss      = _context.Manufacture.Include(c => c.Model).
                       Select(b => new Manufacture
            {
                Id    = b.Id,
                Name  = b.Name,
                Model = b.Model.ToList()
            }).ToList <Manufacture>();

            lss.ForEach(r => AddManufacture(r));
        }
Example #13
0
 public BuyRepos()
 {
     _context = new CarMangerContext();
     Persons  = new Dictionary <int, Buy>();
     lss      = _context.Buy.OrderBy(i => i.Id).Include(c => c.BuyRecords).Include(a => a.Car).Include(b => b.BuyRecords).Include(d => d.Customer).Select(y => new Buy
     {
         Id         = y.Id,
         Customer   = y.Customer,
         BuyRecords = y.BuyRecords,
         Car        = y.Car,
         CarId      = y.CarId,
         CustomerId = y.CustomerId,
         Date       = y.Date
     }).ToList();
     lss.ForEach(async r => await AddBuy(r));
 }
Example #14
0
 public SaleRepo()
 {
     _context = new CarMangerContext();
     Persons  = new Dictionary <int, Sale>();
     lss      = _context.Sale.OrderBy(i => i.Id).Include(c => c.SellRecords).Include(a => a.Car).Include(d => d.Customer).Select(y => new Sale
     {
         Car         = y.Car,
         SellRecords = y.SellRecords,
         CarId       = y.CarId,
         Commission  = y.Commission,
         Customer    = y.Customer,
         CustomerId  = y.CustomerId,
         Date        = y.Date,
         Id          = y.Id
     }).ToList();
     lss.ForEach(async r => await Addsale(r));
 }
Example #15
0
 public CarRepo()
 {
     _context = new CarMangerContext();
     Persons  = new Dictionary <int, Car>();
     lss      = _context.Car.AsNoTracking().OrderBy(i => i.Id).Include(a => a.Model.Manufacture).Include(a => a.Model).Include(b => b.Buy).Include(e => e.Sale).Select(y => new Car
     {
         Id          = y.Id,
         Buy         = y.Buy,
         Sale        = y.Sale,
         CarId       = y.CarId,
         Model       = y.Model,
         Insurance   = y.Insurance,
         ModelId     = y.ModelId,
         MoreDetails = y.MoreDetails,
         Owener      = y.Owener,
         Sold        = y.Sold
     });
     lss.ToList().ForEach(async r => await AddCar(r));
 }