Esempio n. 1
0
    static public List <DetailController> GetDetailsList(String userid, Int32 record_id)
    {
        List <DetailController> detaillist       = new List <DetailController>();
        RecordController        selectController = null;
        List <RecordController> recordlist       = HistoryController.GetHistoryRecords(userid);

        foreach (RecordController tmp in recordlist)
        {
            if (tmp.Id == record_id)
            {
                selectController = tmp;
                break;
            }
        }

        if (selectController != null)
        {
            List <HistoryRecordModel> detailmodels = selectController.m_pModel.Details;
            foreach (HistoryRecordModel tmp in detailmodels)
            {
                DetailController c = new DetailController(tmp);
                detaillist.Insert(0, c);
            }
        }

        return(detaillist);
    }
 ICollection <DetailModel> InterfaceDetailController.SearchByValue(string value)
 {
     using (var service = new DetailController())
     {
         return(service.SearchByValue(value).ToList().Select(a => a.GetModel()).ToList());
     }
 }
Esempio n. 3
0
        static void Main(string[] args)
        {
            var carController          = new CarController();
            var detailController       = new DetailController();
            var manufacturerController = new ManufacturerCollection();
            var manufacturerService    = new ManufacturerService();

            var allDetailsController = detailController.GetAll();
            //detailController.Add(null);
            //detailController.Delete(24);
            //var fifthDetail = detailController.GetById(9);
            //detailController.Update(null);

            //var allCarViewModels = carController.GetAll();
            //carController.Add(null);
            //carController.Delete(6);
            //var secondCar = carController.GetCarById(1);
            //carController.Update(null);

            var allManuf      = manufacturerController.GetAll();
            var mostexpensive = manufacturerService.GetMostExpensive();


            Console.ReadKey();
        }
 DetailModel InterfaceDetailController.GetDetailsByPhotoId(int id)
 {
     using (var service = new DetailController())
     {
         return(service.GetDetailByPhotoId(id).GetModel());
     }
 }
 public void UpdateDetail(DetailModel detail)
 {
     using (var service = new DetailController())
     {
         service.Update(detail.GetData());
     }
 }
 ICollection <DetailModel> InterfaceDetailController.GetDetail()
 {
     using (var service = new DetailController())
     {
         return(service.GetDetail().ToList().Select(a => a.GetModel()).ToList());
     }
 }
 void InterfaceDetailController.DeleteDetail(int id)
 {
     using (var service = new DetailController())
     {
         service.Delete(id);
     }
 }
 public int CreateDetail(DetailModel detail)
 {
     using (var service = new DetailController())
     {
         return(service.Create(detail.GetData()));
     }
 }
Esempio n. 9
0
        static void Main(string[] args)
        {
            ICarController    carController    = new CarController();
            IDetailController detailController = new DetailController();

            //var lamborgini = new CarViewModel() { Id = 5, Name = "Lamborgini" };
            ////var seat = new DetailViewModel() {Id=5, CarID = 4, Name = "Seat" };
            ////detailController.Create(seat);
            //carController.Create(lamborgini);

            carController.GetById(1);

            foreach (var res in carController.GetСars())
            {
                Console.WriteLine($"Name:{res.Name}, Id:{res.Id}");
                foreach (var item in res.Details)
                {
                    Console.WriteLine($"{item.Id} {item.Name} {item.CarID}");
                }
            }



            Console.ReadKey();
        }
Esempio n. 10
0
 static DetailImplementaion()
 {
     //Arrange
     baseController = new DetailController
     {
         Request       = new HttpRequestMessage(),
         Configuration = new HttpConfiguration()
     };
 }
Esempio n. 11
0
        private void InitController()
        {
            var view = FindViewById <DetailView>(Resource.Id.viewDetail);

            var controller = new DetailController(view);

            controller.SetData(_id);
            controller.OnReturn += GoBack;
        }
Esempio n. 12
0
        static void Main(string[] args)
        {
            ICarController    carsControllers   = new CarController();
            IDetailController detailControllers = new DetailController();

            var result = from resC in carsControllers.GetСars()
                         join resD in detailControllers.GetDetails()
                         on resC.Id equals resD.Cars_Id
                         select new { AutomobileName = resC.NameCar, CarID = resC.Id, Detail = resD.NameDetail };

            foreach (var obj in result)
            {
                Console.WriteLine(obj);
            }
            Console.ReadKey();
        }
Esempio n. 13
0
        static void Main(string[] args)
        {
            var connection = Connection.DetabaseConnection();

            ICarRepository    car    = new CarRepository(connection);
            IDetailRepository detail = new DetailRepository(connection);

            ICarService    carModel    = new CarService(car);
            IDetailService detailModel = new DetailService(detail);

            ICarController    carViewModel    = new CarController(carModel);
            IDetailController detailViewModel = new DetailController(detailModel);

            var detaildetail = detailViewModel.GetCar(3);

            var carCar = carViewModel.GetDetails(1);

            Console.ReadKey();
        }
Esempio n. 14
0
        static void Main(string[] args)
        {
            IRepository <Car>    car    = new CarRepository();
            IRepository <Detail> detail = new DetailRepository();

            ICarService    carService    = new CarService(car);
            IDetailService detailService = new DetailService(detail);

            ICarController    carController    = new CarController(carService);
            IDetailController detailController = new DetailController(detailService);

            var allCars = carController.GetAll();

            var carDetails = carController.GetCarDetailsById(1);

            var detailCar = carController.GetDetailCar(1);

            var allDetails = detailController.GetAll();

            Console.ReadKey();
        }
Esempio n. 15
0
        static void Main(string[] args)
        {
            var carController    = new CarController();
            var detailController = new DetailController();


            var allDetailsController = detailController.GetAll();

            detailController.Add(null);
            detailController.Delete(24);
            var fifthDetail = detailController.GetById(9);

            detailController.Update(null);

            var allCarViewModels = carController.GetAll();

            carController.Add(null);
            carController.Delete(6);
            var secondCar = carController.GetCarById(1);

            carController.Update(null);

            Console.ReadKey();
        }
Esempio n. 16
0
 void Main()
 {
     Instance = this;
 }
	void Awake()
	{
		instance = this;

	}