コード例 #1
0
ファイル: Form1.cs プロジェクト: pbirch16/Repos
        private void Form1_Load(object sender, EventArgs e)
        {
            LoadDB ld = new LoadDB(_dataset, "Northwnd", "Customers");

            //ld.DisplayData();
            _dataset = ld.dataSet;

            BindControls();
        }
コード例 #2
0
        public static ClientLoad Cast(LoadDB load)
        {
            var newLoad = new ClientLoad()
            {
                IdLoad                = load.IdLoad,
                Shipments             = Cast(load.Shipments),
                StopsLoad             = load.StopsLoad,
                TotalDistanceLoad     = load.TotalDistanceLoad,
                TruckLoad             = load.TruckLoad,
                QuantityShipmentsLoad = load.QuantityShipmentsLoad,
                TotalCostLoad         = load.TotalCostLoad
            };

            return(newLoad);
        }
コード例 #3
0
ファイル: Converter.cs プロジェクト: jorgemonas27/POC
        public static LoadDB Cast(LoadDTO load)
        {
            var newObject = new LoadDB()
            {
                IdLoad                = load.IdLoad,
                Shipments             = Cast(load.Shipments),
                StopsLoad             = load.StopsLoad,
                TotalDistanceLoad     = load.TotalDistanceLoad,
                TruckLoad             = load.TruckLoad,
                QuantityShipmentsLoad = load.QuantityShipmentsLoad,
                TotalCostLoad         = load.TotalCostLoad
            };

            return(newObject);
        }
コード例 #4
0
    void bump()
    {
        LoadDB load = GameObject.Find("GameObject").GetComponent <LoadDB>();

        Vector2 p1  = this.flag.transform.position;
        Vector2 p2  = this.bear.transform.position;
        Vector2 dir = p1 - p2;
        float   d   = dir.magnitude;
        float   r1  = 0.3f;
        float   r2  = 0.6f;

        if (d < r1 + r2)
        {
            //this.bear_up.SetActive (true);
            this.flag.transform.Translate(0, 0.05f, 0);
            StartCoroutine(load.LoadImg());
        }
    }
コード例 #5
0
        public static IList <LoadDB> Cast(IList <ClientLoad> loads)
        {
            var list = new List <LoadDB>();

            foreach (var load in loads)
            {
                var cast = new LoadDB()
                {
                    IdLoad                = load.IdLoad,
                    Shipments             = Cast(load.Shipments),
                    StopsLoad             = load.StopsLoad,
                    TotalDistanceLoad     = load.TotalDistanceLoad,
                    TruckLoad             = load.TruckLoad,
                    QuantityShipmentsLoad = load.QuantityShipmentsLoad,
                    TotalCostLoad         = load.TotalCostLoad
                };
                list.Add(cast);
            }

            return(list);
        }
コード例 #6
0
        /// <summary>
        /// The Build method will do the logic to group all the orders and retrieve a list of loads
        /// </summary>
        /// <returns>The <see cref="IList{LoadDTO}"/></returns>
        public IList <LoadDTO> Build()
        {
            var shipments = _shipmentRepo.GetAll();
            var group     = shipments.GroupBy(x => x.TotalWeigthOrders).Where(s => s.Key <= 2800);
            var list      = new List <LoadDB>();

            foreach (var item in group)
            {
                item.ToList().ForEach(x => x.Orders.ToList().ForEach(z =>
                {
                    x.IdLoad = _ids;
                    z.IdLoad = _ids;
                    z.Status = "Loaded";
                    stops.Append(z.DestinationCity).Append(",");
                    _totalCost += z.CostOrder;
                    _orderRepo.Update(z.IdOrder, z);
                    _shipmentRepo.Update(x.IdShipment, x);
                }));

                var newObj = new LoadDB()
                {
                    IdLoad                = _ids,
                    TotalDistanceLoad     = _distance + 500,
                    StopsLoad             = stops.ToString(),
                    TruckLoad             = _truck,
                    Shipments             = item.ToList(),
                    QuantityShipmentsLoad = item.ToList().Count,
                    TotalCostLoad         = _totalCost
                };

                list.Add(newObj);
                stops      = new StringBuilder();
                _totalCost = 0;
                _ids++;
            }

            _loadRepo.AddList(list);
            return(Converters.Converter.Cast(list));
        }
コード例 #7
0
ファイル: LoadDB.cs プロジェクト: leedaju/COCO
 void Awake()
 {        // 싱글턴 인스턴스 할당
     instance = this;
 }
コード例 #8
0
    // Update is called once per frame
    void Update()
    {
        LoadDB load = GameObject.Find("GameObject").GetComponent <LoadDB>();

        int a = load.i;


        if (a == 0)
        {
            if (count == 0)
            {
                if (this.p2.transform.position == this.Slot001.transform.position && count == 0)
                {
                    question.SetActive(false);
                    count++;
                    jump();
                }
                else if (this.p1.transform.position == this.Slot001.transform.position ||
                         this.p3.transform.position == this.Slot001.transform.position ||
                         this.p4.transform.position == this.Slot001.transform.position)
                {
                    question.SetActive(true);
                }
            }

            if (this.p3.transform.position == this.Slot002.transform.position && count == 1)
            {
                question.SetActive(false);
                count++;
                jump();
            }
            else if (this.p1.transform.position == this.Slot002.transform.position ||
                     this.p2.transform.position == this.Slot002.transform.position ||
                     this.p4.transform.position == this.Slot002.transform.position)
            {
                question.SetActive(true);
            }



            if (this.p1.transform.position == this.Slot003.transform.position && count == 2)
            {
                question.SetActive(false);
                count++;
                jump();
            }
            else if (this.p2.transform.position == this.Slot003.transform.position ||
                     this.p3.transform.position == this.Slot003.transform.position ||
                     this.p4.transform.position == this.Slot003.transform.position)
            {
                question.SetActive(true);
            }



            if (this.p4.transform.position == this.Slot004.transform.position && count == 3)
            {
                question.SetActive(false);
                count++;
                jump();
            }
            else if (this.p1.transform.position == this.Slot004.transform.position ||
                     this.p2.transform.position == this.Slot004.transform.position ||
                     this.p3.transform.position == this.Slot004.transform.position)
            {
                question.SetActive(true);
            }
            if (count == 4)
            {
                bump();
            }
        }
        else if (a == 1)
        {
            if (count == 0)
            {
                if (this.p4.transform.position == this.Slot001.transform.position && count == 0)
                {
                    question.SetActive(false);
                    count++;
                    jump();
                }
                else if (this.p1.transform.position == this.Slot001.transform.position ||
                         this.p2.transform.position == this.Slot001.transform.position ||
                         this.p3.transform.position == this.Slot001.transform.position)
                {
                    question.SetActive(true);
                }
            }

            if (this.p2.transform.position == this.Slot002.transform.position && count == 1)
            {
                question.SetActive(false);
                count++;
                jump();
            }
            else if (this.p1.transform.position == this.Slot002.transform.position ||
                     this.p3.transform.position == this.Slot002.transform.position ||
                     this.p4.transform.position == this.Slot002.transform.position)
            {
                question.SetActive(true);
            }



            if (this.p3.transform.position == this.Slot003.transform.position && count == 2)
            {
                question.SetActive(false);
                count++;
                jump();
            }
            else if (this.p1.transform.position == this.Slot003.transform.position ||
                     this.p2.transform.position == this.Slot003.transform.position ||
                     this.p4.transform.position == this.Slot003.transform.position)
            {
                question.SetActive(true);
            }



            if (this.p1.transform.position == this.Slot004.transform.position && count == 3)
            {
                question.SetActive(false);
                count++;
                jump();
            }
            else if (this.p2.transform.position == this.Slot004.transform.position ||
                     this.p3.transform.position == this.Slot004.transform.position ||
                     this.p4.transform.position == this.Slot004.transform.position)
            {
                question.SetActive(true);
            }
            if (count == 4)
            {
                bump();
            }
        }
    }