public NewMeetTest(String Token, String id = "-1")
        {
            token = Token;

            WCFServiceWebRole1.BL.Bl_imp Bl = WCFServiceWebRole1.BL.Bl_imp.Instance;

            if (id != "-1")
            {
                x        = Bl.ShowTest(Token, id).Clone();
                idupDate = id;
            }
            else
            {
                x = def.defMeetTest.Clone();
            }

            if (id == "-1")
            {
                x.Time = DateTime.Now.AddDays(3);
            }

            InitializeComponent();

            //student LIst init
            StudentList.ItemsSource = from x in Bl.GetListStudents(Token) select x.Id + " " + x.FirstName + " " + x.LastName;

            stackPanel.DataContext = x;

            //select old object Id student
            try
            {
                StudentList.SelectedItem = (from y in Bl.GetListStudents(Token) where x.StudentId == y.Id select y.Id + " " + y.FirstName + " " + y.LastName).ToList <String>().FirstOrDefault();
            }
            catch { StudentList.SelectedIndex = 0; }

            Hour.Text       = x.Time.Hour.ToString();
            IntefaceAC.Text = x.TestAddress.city;
            IntefaceAS.Text = x.TestAddress.street;
            IntefaceAN.Text = x.TestAddress.num.ToString();

            //init to dictionary problems
            dicNumber.Add("Time", console);
            dicNumber.Add("TestId", console1);
            dicNumber.Add("TeacherId", console2);
            dicNumber.Add("StudentId", console3);
            dicNumber.Add("TestAddress.city", console4);
            dicNumber.Add("TestAddress.street", console5);
            dicNumber.Add("TestAddress.num", console6);
        }
Beispiel #2
0
        public NewStudent(String Token, String id = "-1")
        {
            token = Token;
            WCFServiceWebRole1.BL.Bl_imp Bl = WCFServiceWebRole1.BL.Bl_imp.Instance;
            if (id != "-1")
            {
                x = Bl.ShowStudent(Token, id).Clone(); idupDate = id;
            }
            else
            {
                x = def.defstudent.Clone();
            }
            //x.adress = new address("ass", 5, "sd");
            InitializeComponent();
            stackPanel.DataContext = x;

            IntefaceAC.Text = x.Adress.city;
            IntefaceAS.Text = x.Adress.street;
            IntefaceAN.Text = x.Adress.num.ToString();
            //IntefaceBD.Text = x.BirthDay.ToString();
            Gear.ItemsSource           = Enum.GetValues(typeof(gearbox)).Cast <gearbox>();
            Gear.SelectedIndex         = (int)x.Gear;
            GenderSelect.ItemsSource   = Enum.GetValues(typeof(Gender)).Cast <Gender>();
            GenderSelect.SelectedIndex = (int)x.gender;
            Car.ItemsSource            = Enum.GetValues(typeof(typecar)).Cast <typecar>();
            Car.SelectedIndex          = (int)x.CarType;
            //GenderSelect.SelectedValue = x.g

            dicNumber.Add("Id", console);
            dicNumber.Add("FirstName", console1);
            dicNumber.Add("LastName", console2);
            dicNumber.Add("Adress.city", console4);
            dicNumber.Add("Adress.street", console5);
            dicNumber.Add("Adress.num", console6);
            dicNumber.Add("PhoneNumber", console7);
            dicNumber.Add("BirthDay", console8);
            dicNumber.Add("HoursLearned", console11);
            dicNumber.Add("TeacherName", console12);
            dicNumber.Add("SchoolName", console13);
        }