public WindowClassroomList(RentTable r, WindowIndex ff)
        {
            InitializeComponent();

            rentTable = r;
            father = ff;
        }
        public WindowRent(Rent r, WindowIndex fatherWindow)
        {
            InitializeComponent();
            rent = r;
            father = fatherWindow;

            if (father.WindowState == WindowState.Maximized)
            {
                this.Width = 450;
                this.Height = 450;
                BorderBackground.Width = 450;
                BorderBackground.Height = 450;
                TBinfo.FontSize = 40;

                TBhost.FontSize =
                TBrentTime.FontSize =
                TBtakepartinInfo.FontSize =
                TBclassroom.FontSize =
                TBclassroom_Copy.FontSize =
                TBChoose.FontSize =
                TBexit.FontSize =
                TBOK.FontSize =
                TBDecline.FontSize = 22;
            }
        }
        public WindowClassroomList(RentTable r, WindowIndex ff)
        {
            InitializeComponent();

            rentTable = r;
            father    = ff;
        }
Example #4
0
        public WindowApplyRent(Person p, Classroom clsr, DateTime dt, int cc, WindowIndex f)
        {
            InitializeComponent();

            person      = p;
            classroom   = clsr;
            date        = dt;
            classChosen = cc;
            father      = f;

            if (father.WindowState == WindowState.Maximized)
            {
                Console.WriteLine("Max!");
                this.Width              = 450;
                this.Height             = 450;
                BorderBackground.Width  = 450;
                BorderBackground.Height = 450;

                TBinfo.FontSize = 40;

                TBhost.FontSize                 =
                    TBrentTime.FontSize         =
                        TBclassroom.FontSize    =
                            TBChoose.FontSize   =
                                TBexit.FontSize = 22;
            }
        }
        public WindowApplyRent(Person p, Classroom clsr, DateTime dt, int cc, WindowIndex f)
        {
            InitializeComponent();

            person = p;
            classroom = clsr;
            date = dt;
            classChosen = cc;
            father = f;

            if (father.WindowState == WindowState.Maximized)
            {
                Console.WriteLine("Max!");
                this.Width = 450;
                this.Height = 450;
                BorderBackground.Width = 450;
                BorderBackground.Height = 450;

                TBinfo.FontSize = 40;

                TBhost.FontSize =
                TBrentTime.FontSize =
                TBclassroom.FontSize =
                TBChoose.FontSize =
                TBexit.FontSize = 22;
            }
        }
        public WindowRent(Rent r, WindowIndex fatherWindow)
        {
            InitializeComponent();
            rent   = r;
            father = fatherWindow;

            if (father.WindowState == WindowState.Maximized)
            {
                this.Width              = 450;
                this.Height             = 450;
                BorderBackground.Width  = 450;
                BorderBackground.Height = 450;
                TBinfo.FontSize         = 40;

                TBhost.FontSize                                    =
                    TBrentTime.FontSize                            =
                        TBtakepartinInfo.FontSize                  =
                            TBclassroom.FontSize                   =
                                TBclassroom_Copy.FontSize          =
                                    TBChoose.FontSize              =
                                        TBexit.FontSize            =
                                            TBOK.FontSize          =
                                                TBDecline.FontSize = 22;
            }
        }
        public WindowApplyRent(Person p, Classroom clsr, DateTime dt, int cc, WindowIndex f)
        {
            InitializeComponent();

            person = p;
            classroom = clsr;
            date = dt;
            classChosen = cc;
            father = f;
        }
        private void BorderBackground_Loaded(object sender, RoutedEventArgs e)
        {
            switch (WindowIndex.currSkin)
            {
            case WindowIndex.skin.Starry:
                BorderBackground.Background = new ImageBrush(WindowIndex.ChangeBitmapToImageSource(Properties.Resources.rentback));
                break;

            case WindowIndex.skin.ColorBox:
                BorderBackground.Background = new ImageBrush(WindowIndex.ChangeBitmapToImageSource(Properties.Resources.Color1));
                break;
            }
        }
 public WindowRent(Rent r, WindowIndex fatherWindow,string str)
 {
     InitializeComponent();
     if (str == "big")
     {
         this.Width = 450;
         this.Height = 450;
         BorderBackground.Width = 450;
         BorderBackground.Height = 450;
         TBinfo.FontSize = 40;
         TBhost.FontSize = 22;
         TBrentTime.FontSize = 22;
         TBclassroom.FontSize = 22;
         TBChoose.FontSize = 22;
         TBexit.FontSize = 22;
     }
     rent = r;
     father = fatherWindow;
 }
        public Schedule(RentTableOwner owner, Grid gridSchdule, Label rectangleChosonClass, Grid gridScheduleHead, WindowIndex father)
        {
            Owner = owner;

            GridSchedule         = gridSchdule;
            GridScheduleHead     = gridScheduleHead;
            RectangleChosonClass = rectangleChosonClass;

            Father = father;

            headInitialize();
            checkoutWeek();

            if (owner != null)
            {
                Reset();
            }

            GridSchedule.PreviewMouseDown += GridSchedule_PreviewMouseDown;
        }
        public Schedule(RentTableOwner owner, Grid gridSchdule, Label rectangleChosonClass, Grid gridScheduleHead, WindowIndex father)
        {
            Owner = owner;

            GridSchedule = gridSchdule;
            GridScheduleHead = gridScheduleHead;
            RectangleChosonClass = rectangleChosonClass;

            Father = father;

            headInitialize();
            checkoutWeek();

            if (owner != null)
            {
                Reset();
            }

            GridSchedule.PreviewMouseDown += GridSchedule_PreviewMouseDown;
        }
Example #12
0
        private void login()
        {
            int id;

            try { id = int.Parse(TextBoxPId.Text); }
            catch { status = Status.errorId; return; }

            Person p = DatabaseLinker.Login(id, TextBoxPassword.Password);

            if (null == p)
            {
                status = Status.errorPassword;
            }
            else if (p is Person)
            {
                winindex = new WindowIndex(p);
                status   = Status.success;
            }
            else
            {
                status = Status.errorPassword;
            }
        }
        public WindowApplyRent(Person p, Classroom clsr, DateTime dt, int cc, WindowIndex f,string str)
        {
            InitializeComponent();

            person = p;
            classroom = clsr;
            date = dt;
            classChosen = cc;
            father = f;
            if (str == "big")
            {
                this.Width = 450;
                this.Height = 450;
                BorderBackground.Width = 450;
                BorderBackground.Height = 450;

                TBinfo.FontSize = 40;
                TBhost.FontSize = 22;
                TBrentTime.FontSize = 22;
                TBclassroom.FontSize = 22;
                TBChoose.FontSize = 22;
                TBexit.FontSize = 22;
            }
        }
        private void stackPanel_Loaded(object sender, RoutedEventArgs e)
        {
            switch (WindowIndex.currSkin)
            {
            case WindowIndex.skin.Starry:
                BorderBack.Background = new ImageBrush(WindowIndex.ChangeBitmapToImageSource(Properties.Resources.listback));
                break;

            case WindowIndex.skin.ColorBox:
                BorderBack.Background = new ImageBrush(WindowIndex.ChangeBitmapToImageSource(Properties.Resources.Color1));
                break;
            }

            foreach (Building building in Building.AllBuildings)
            {
                TextBlock tbTitle = new TextBlock();
                tbTitle.Padding      = new Thickness(24, 16, 26, 10);
                tbTitle.TextWrapping = TextWrapping.Wrap;
                tbTitle.Text         = building.Name;
                tbTitle.FontSize     = 24;
                //   tbTitle.Background = new SolidColorBrush(MyColor.NameColor(building.Name, 0.05));

                WrapPanel subPanel = new WrapPanel();
                subPanel.Orientation = Orientation.Horizontal;
                subPanel.Margin      = new Thickness(24, 0, 24, 0);

                foreach (Classroom classroom in building.Classrooms)
                {
                    TextBlock tb = new TextBlock();
                    tb.Height       = 125;
                    tb.Width        = 125;
                    tb.FontSize     = 16;
                    tb.Margin       = new Thickness(5);
                    tb.TextWrapping = TextWrapping.Wrap;

                    Rent rent = rentTable.GetClassroom(classroom.cId);
                    if (rent == null)
                    {
                        tb.Height     = 60;
                        tb.Width      = 60;
                        tb.FontSize   = 12;
                        tb.Text       = classroom.Name;
                        tb.Background = MyColor.NameBrush(tb.Text, 0.05); //new SolidColorBrush(MyColor.NameColor(tb.Text, 0.05));
                    }
                    else
                    {
                        tb.Text       = classroom.Name + ":" + rent.Info;
                        tb.Background = MyColor.NameBrush(tb.Text); //new SolidColorBrush(MyColor.NameColor(tb.Text));
                    }

                    tb.Tag         = classroom;
                    tb.MouseDown  += tb_MouseDown;
                    tb.MouseEnter += tb_MouseEnter;
                    tb.MouseLeave += tb_MouseLeave;

                    subPanel.Children.Add(tb);
                }

                stackPanel.Children.Add(tbTitle);
                stackPanel.Children.Add(subPanel);
            }
        }
        private void login()
        {
            int id;
            try { id = int.Parse(TextBoxPId.Text); }
            catch { status = Status.errorId; return; }

            Person p = DatabaseLinker.Login(id, TextBoxPassword.Password);

            if (null == p)
                status = Status.errorPassword;
            else if (p is Person)
            {
                winindex = new WindowIndex(p);
                status = Status.success;
            }
            else
                status = Status.errorPassword;
        }
 public WindowRent(Rent r, WindowIndex fatherWindow)
 {
     InitializeComponent();
     rent = r;
     father = fatherWindow;
 }