Esempio n. 1
0
        private void Copy()
        {
            Request R = new Request();
            Request R2;

            R2 = ICopy.Clone <Request>(R); /*  ICopy.Clone<Request>(   */
        }
Esempio n. 2
0
        /// <summary>
        /// </summary>
        ///

        void Searching_ByDistancePriority_New()
        {
            for (int i = 0; i < Static_Data.List_Request.Count(); i++)
            {
                Static_Data.List_Request[i].GetDistanceTo_TechnicianPosition(Static_Data.List_Tech[0]);

                #region  Deleting Requ From Route without Skills
                Boolean ToAdd = true;

                foreach (int Sk in Static_Data.List_Request[i].Skills)
                {
                    if (Static_Data.List_Tech[0].Skills.Contains(Sk) == false)
                    {
                        ToAdd = false;
                    }
                }
                #endregion
                #region  Searching The Need of Going Depot

                Boolean NeeDepot = false;
                foreach (int Tool in Static_Data.List_Request[i].List_Tools)
                {
                    if (Static_Data.List_Tech[0].List_Tools.Contains(Tool) == false)
                    {
                        NeeDepot = true; break;
                    }
                }
                foreach (int Tool_Ex in Static_Data.List_Request[i].List_Tool_Exchange)
                {
                    if (Static_Data.List_Tech[0].List_Tool_Exchange.Contains(Tool_Ex) == false)
                    {
                        NeeDepot = true; break;
                    }
                }
                #endregion


                if (ToAdd)
                {
                    Static_Data.List_Tech[0].UnRouted.Add(ICopy.Clone <Request>(Static_Data.List_Request[i]));
                }
            }
            Static_Data.List_Tech[0].UnRouted = ICopy.Clone <List <Request> >(Static_Data.List_Tech[0].UnRouted.OrderByDescending(x => x.Distance_To_Tech).ToList());
            Static_Data.List_Tech.[0].Routes.Add(ICopy.Clone <Request>(Static_Data.List_Tech[0].UnRouted[0]));