void ReleaseDesignerOutlets()
        {
            if (BackButton != null)
            {
                BackButton.Dispose();
                BackButton = null;
            }

            if (EnglishButton != null)
            {
                EnglishButton.Dispose();
                EnglishButton = null;
            }

            if (ModifyButton != null)
            {
                ModifyButton.Dispose();
                ModifyButton = null;
            }

            if (SpanishButton != null)
            {
                SpanishButton.Dispose();
                SpanishButton = null;
            }

            if (TitleViewLabel != null)
            {
                TitleViewLabel.Dispose();
                TitleViewLabel = null;
            }
        }
Exemplo n.º 2
0
 private void applyTraslations()
 {
     TitleViewLabel.Text = AppDelegate.LanguageBundle.GetLocalizedString("language_title");
     ModifyButton.SetTitle(AppDelegate.LanguageBundle.GetLocalizedString("language_modify"), UIControlState.Normal);
     SpanishButton.SetTitle(AppDelegate.LanguageBundle.GetLocalizedString("language_spanish"), UIControlState.Normal);
     EnglishButton.SetTitle(AppDelegate.LanguageBundle.GetLocalizedString("language_english"), UIControlState.Normal);
 }
        private void applyTraslations()
        {
            TitleViewLabel.Text = AppDelegate.LanguageBundle.GetLocalizedString("contact_data_title");

            EmailLabel.Text = AppDelegate.LanguageBundle.GetLocalizedString("contact_data_email");
            PhoneLabel.Text = AppDelegate.LanguageBundle.GetLocalizedString("contact_data_phone");
            ModifyButton.SetTitle(AppDelegate.LanguageBundle.GetLocalizedString("contact_data_modify"), UIControlState.Normal);
        }
        private void applyTraslations()
        {
            TitleViewLabel.Text = AppDelegate.LanguageBundle.GetLocalizedString("center_title");

            Label1.Text         = AppDelegate.LanguageBundle.GetLocalizedString("center_country");
            Label2.Text         = AppDelegate.LanguageBundle.GetLocalizedString("center_city");
            Label3.Text         = AppDelegate.LanguageBundle.GetLocalizedString("center_center");
            mandatoryLabel.Text = AppDelegate.LanguageBundle.GetLocalizedString("center_mandatory");
            ModifyButton.SetTitle(AppDelegate.LanguageBundle.GetLocalizedString("center_modify"), UIControlState.Normal);
        }
Exemplo n.º 5
0
        void ReleaseDesignerOutlets()
        {
            if (BackButton != null)
            {
                BackButton.Dispose();
                BackButton = null;
            }

            if (EmailLabel != null)
            {
                EmailLabel.Dispose();
                EmailLabel = null;
            }

            if (EmailTextField != null)
            {
                EmailTextField.Dispose();
                EmailTextField = null;
            }

            if (ModifyButton != null)
            {
                ModifyButton.Dispose();
                ModifyButton = null;
            }

            if (PhoneLabel != null)
            {
                PhoneLabel.Dispose();
                PhoneLabel = null;
            }

            if (PhoneTextField != null)
            {
                PhoneTextField.Dispose();
                PhoneTextField = null;
            }

            if (TitleViewLabel != null)
            {
                TitleViewLabel.Dispose();
                TitleViewLabel = null;
            }
        }
Exemplo n.º 6
0
        public void ModifySaveRemoveButtonButtonTest()
        {
            MainViewModel main = new MainViewModel(new ConsoleMessage());

            main.List      = new System.Collections.ObjectModel.ObservableCollection <Zadanie3.Employee>();
            main.Names     = new System.Collections.ObjectModel.ObservableCollection <Zadanie3.Person>();
            main.Employees = new MVVM.Model.Employees();
            SaveButton   save   = new SaveButton(main);
            ModifyButton modify = new ModifyButton(main);
            RemoveButton remove = new RemoveButton(main);

            main.CurrentPerson = new Zadanie3.Person();
            main.CurrentPerson.BusinessEntityID = 99999;
            main.CurrentPerson.FirstName        = "test";
            main.CurrentPerson.LastName         = "new";
            main.CurrentPerson.ModifiedDate     = DateTime.Today;
            main.CurrentPerson.rowguid          = Guid.NewGuid();
            main.CurrentPerson.NameStyle        = true;
            main.CurrentPerson.PersonType       = "EM";

            main.CurrentEmployee = new Zadanie3.Employee();
            main.CurrentEmployee.BusinessEntityID = 999999;
            main.CurrentEmployee.NationalIDNumber = "123456";
            main.CurrentEmployee.LoginID          = "987456";
            main.CurrentEmployee.JobTitle         = "test";
            main.CurrentEmployee.BirthDate        = DateTime.Parse("01-01-2000");
            main.CurrentEmployee.MaritalStatus    = 'S';
            main.CurrentEmployee.Gender           = 'M';
            main.CurrentEmployee.HireDate         = DateTime.Parse("01-01-2010");
            main.CurrentEmployee.SalariedFlag     = true;
            main.CurrentEmployee.VacationHours    = 0;
            main.CurrentEmployee.SickLeaveHours   = 0;
            main.CurrentEmployee.CurrentFlag      = true;
            main.CurrentEmployee.rowguid          = Guid.NewGuid();
            main.CurrentEmployee.ModifiedDate     = DateTime.Today;


            // Add new Employee
            save.Save.Execute(null);
            Thread.Sleep(3000);

            using (Zadanie3.DataBaseDataContext db = new DataBaseDataContext())
            {
                Person person = db.Person.Single(i => i.BusinessEntityID == 999999);
                Assert.AreEqual(person.FirstName, "test");
                Assert.AreEqual(person.LastName, "new");
                Assert.AreEqual(person.PersonType, "EM");

                Employee emp = db.Employee.Single(i => i.BusinessEntityID == 999999);
                Assert.AreEqual(emp.NationalIDNumber, "123456");
                Assert.AreEqual(emp.LoginID, "987456");
                Assert.AreEqual(emp.JobTitle, "test");
                Assert.AreEqual(emp.Gender, 'M');
                Assert.AreEqual(emp.MaritalStatus, 'S');
            }


            //Modify Employee in db
            main.CurrentPerson.FirstName          = "new firstname";
            main.CurrentPerson.LastName           = "new lastname";
            main.CurrentPerson.PersonType         = "IN";
            main.CurrentEmployee.NationalIDNumber = "132";
            main.CurrentEmployee.JobTitle         = "new";
            main.CurrentEmployee.Gender           = 'F';
            main.CurrentEmployee.MaritalStatus    = 'M';

            modify.Modify.Execute(null);
            Thread.Sleep(3000);

            using (Zadanie3.DataBaseDataContext db = new DataBaseDataContext())
            {
                Person res = db.Person.Single(i => i.BusinessEntityID == 999999);
                Assert.AreEqual(res.FirstName, "new firstname");
                Assert.AreEqual(res.LastName, "new lastname");
                Assert.AreEqual(res.PersonType, "IN");

                Employee res_e = db.Employee.Single(i => i.BusinessEntityID == 999999);
                Assert.AreEqual(res_e.NationalIDNumber, "132");
                Assert.AreEqual(res_e.JobTitle, "new");
                Assert.AreEqual(res_e.Gender, 'F');
                Assert.AreEqual(res_e.MaritalStatus, 'M');
            }

            //Remove from db
            remove.Remove.Execute(null);
            Thread.Sleep(3000);

            using (DataBaseDataContext db = new DataBaseDataContext())
            {
                IQueryable <Person> res_p_3 = db.Person.Where(i => i.BusinessEntityID == 999999);
                foreach (Person i in res_p_3)
                {
                    Assert.IsNull(i);
                }

                IQueryable <Employee> res_e_3 = db.Employee.Where(i => i.BusinessEntityID == 999999);
                foreach (Employee i in res_e_3)
                {
                    Assert.IsNull(i);
                }
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (BackButton != null)
            {
                BackButton.Dispose();
                BackButton = null;
            }

            if (CenterListTextField != null)
            {
                CenterListTextField.Dispose();
                CenterListTextField = null;
            }

            if (CiudadListTextField != null)
            {
                CiudadListTextField.Dispose();
                CiudadListTextField = null;
            }

            if (Label1 != null)
            {
                Label1.Dispose();
                Label1 = null;
            }

            if (Label2 != null)
            {
                Label2.Dispose();
                Label2 = null;
            }

            if (Label3 != null)
            {
                Label3.Dispose();
                Label3 = null;
            }

            if (mandatoryLabel != null)
            {
                mandatoryLabel.Dispose();
                mandatoryLabel = null;
            }

            if (ModifyButton != null)
            {
                ModifyButton.Dispose();
                ModifyButton = null;
            }

            if (PaisListTextField != null)
            {
                PaisListTextField.Dispose();
                PaisListTextField = null;
            }

            if (TitleViewLabel != null)
            {
                TitleViewLabel.Dispose();
                TitleViewLabel = null;
            }
        }
Exemplo n.º 8
0
 private void ModifyTButton_Click(object sender, EventArgs e)
 {
     ModifyButton.PerformClick();
 }