Exemplo n.º 1
0
        private void AssemblyAviaCompanyList()
        {
            aviaCompanyList = new AviaCompanyList();
            aviaCompanyList.Load();
            foreach (RawBulkCompany rawCompany in rawCompanyList)
            {
                try
                {
                    if (rawCompany.isaviacompany.Data == "1")
                    {
                        AviaCompany aviacompany = aviaCompanyList.Create();
                        aviacompany.FullName = rawCompany.name.Data;

                        if (!rawCompany.phone1.IsEmpty)
                        {
                            aviacompany.Description = " Phone1: " + rawCompany.phone1.Data;
                        }

                        if (!rawCompany.phone2.IsEmpty)
                        {
                            aviacompany.Description = " Phone2: " + rawCompany.phone2.Data;
                        }

                        if (!rawCompany.email1.IsEmpty)
                        {
                            aviacompany.Description = " Email1: " + rawCompany.email1.Data;
                        }

                        if (!rawCompany.email2.IsEmpty)
                        {
                            aviacompany.Description = " Email2: " + rawCompany.email2.Data;
                        }

                        if (!rawCompany.number.IsEmpty)
                        {
                            aviacompany.Description = " Number: " + rawCompany.number.Data;
                        }

                        if (!rawCompany.officialname.IsEmpty)
                        {
                            aviacompany.Description = " Official name: " + rawCompany.officialname.Data;
                        }

                        aviacompany.Save();
                    }

                    rawCompany.IsHandled = true;
                }
                catch
                {
                    failedCompany.Add(rawCompany);
                }
            }
        }
Exemplo n.º 2
0
        public ActionResult SaveAviacompany(int id, string Name, string ICAO, string Note)
        {
            AviaCompany ac = mappingController.settingsData.aviaCompanyList.Find(item => item.ID == id);

            if (ac == null)
            {
                ac = mappingController.settingsData.aviaCompanyList.Create();
            }

            ac.FullName    = Name;
            ac.ICAO        = ICAO;
            ac.Description = Note;

            ac.Save();

            return(Json(""));
        }