Exemple #1
0
        public ActionResult JoinAviaCompanyUnion(int idAC, string nameACU, bool status)
        {
            AviaCompany      ac  = mappingController.settingsData.aviaCompanyList.Find(item => item.ID == idAC);
            AviaCompanyUnion acu = mappingController.settingsData.aviaCompanyUnionList.Find(item => item.Name == nameACU);

            if ((ac != null) & (acu != null))
            {
                ac.Load();
                acu.Load();

                if (status)
                {
                    if (ac.aviaCompanyUnionList.Find(item => item.ID == acu.ID) == null)
                    {
                        ac.aviaCompanyUnionList.AddElement(ac, acu);
                    }
                }
                else
                {
                    if (ac.aviaCompanyUnionList.Find(item => item.ID == acu.ID) != null)
                    {
                        ac.aviaCompanyUnionList.RemoveElement(ac, acu);
                    }
                }

                ac.Load();
                acu.Load();
            }

            return(Json(""));
        }
Exemple #2
0
        public ActionResult FindAviacompany(int id)
        {
            AviaCompany ac = mappingController.settingsData.aviaCompanyList.Find(item => item.ID == id);

            ac.Load();
            return(Json(ac));
        }