Exemplo n.º 1
0
 private void AddCompanyBtn_Click(object sender, RoutedEventArgs e)
 {
     beforeEffects();
     addCompany = new AddCompany();
     addCompany.ShowDialog();
     if (addCompany.getSaveState())           //If a company was saved!
     {
         Company c = addCompany.getCompany(); //Get the saved comopany
         companies.Add(c);                    //Add the company to the list of companies
         Console.WriteLine("Saved: " + c.getName());
     }
     afterEffects();
 }
Exemplo n.º 2
0
        public async void AddCompany_Click()
        {
            if (FROM_SCRATCH == true)
            {
                selectCompany.CREATION_TYPE = "FROM_SCRATCH";
            }
            if (selectCompany.FROM_BACKUP == true)
            {
                selectCompany.CREATION_TYPE = "FROM_BACKUP";
            }
            if (selectCompany.CREATE_CONSOLIDATED == true)
            {
                selectCompany.CREATION_TYPE = "CREATE_CONSOLIDATED";
            }
            if (selectCompany.CREATE_DEMONSTRATION == true)
            {
                selectCompany.CREATION_TYPE = "CREATE_DEMONSTRATION";
            }

            App.Current.Properties["Creation_Type"] = selectCompany.CREATION_TYPE;


            //HttpClient client = new HttpClient();
            //client.DefaultRequestHeaders.Accept.Add(
            //    new MediaTypeWithQualityHeaderValue("application/json"));
            //client.BaseAddress = new Uri(GlobalData.gblApiAdress);
            //var response = await client.PostAsJsonAsync("api/MiscellaneousAPI/CreateMiscellaneous/", selectCompany);
            //if (response.StatusCode.ToString() == "OK")
            //{

            //    MessageBox.Show("Miscellaneous Data Added Successfully");
            Cancel_Company();
            AddCompany _CA = new AddCompany();

            _CA.ShowDialog();
            //Cancel_Company();
            //             }
        }