private void ViewInit(WindowsModel wm)
        {
            switch (wm)
            {
            case WindowsModel.Modify:
                ok_simpleButton.Enabled = true;
                ok_simpleButton.Show();

                /*缴费信息*/
                tuition_textEdit.ReadOnly    = false;
                classHours_textEdit.ReadOnly = false;
                remaining_textEdit.ReadOnly  = false;
                last_dateEdit.ReadOnly       = false;
                yes_checkEdit.ReadOnly       = false;
                no_checkEdit.ReadOnly        = false;
                notPay_textEdit.ReadOnly     = false;
                remark_memoEdit.ReadOnly     = false;
                break;

            default:
                ok_simpleButton.Enabled = false;
                ok_simpleButton.Hide();

                /*缴费信息*/
                tuition_textEdit.ReadOnly    = true;
                classHours_textEdit.ReadOnly = true;
                remaining_textEdit.ReadOnly  = true;
                last_dateEdit.ReadOnly       = true;
                yes_checkEdit.ReadOnly       = true;
                no_checkEdit.ReadOnly        = true;
                notPay_textEdit.ReadOnly     = true;
                remark_memoEdit.ReadOnly     = true;
                break;
            }
        }
 public PayDetailForm(StudentInfo arg, WindowsModel wm)
 {
     InitializeComponent();
     _studentInfo = arg;
     SetWindwosText(arg);
     ViewInit(wm);
 }
Beispiel #3
0
        public override void ExecuteCommand(string userId, string command)
        {
            ServerWindowsPos wndData = deserialize.Deserialize <ServerWindowsPos>(command);

            if (wndData == null)
            {
                return;
            }

            List <WindowsModel> wndsModelList = new List <WindowsModel>();

            foreach (WndPos wndPos in wndData.WindowsAttributes)
            {
                WindowsModel model = new WindowsModel()
                {
                    WindowsId   = wndPos.id,
                    DisplayName = wndPos.name,
                    PosLeft     = wndPos.posX,
                    PosTop      = wndPos.posY,
                    Width       = wndPos.width,
                    Height      = wndPos.height,
                    Style       = wndPos.style,
                    ZOrder      = wndPos.ZOrder
                };

                wndsModelList.Add(model);
            }

            client.RefreshWndList(wndsModelList);
        }
Beispiel #4
0
        private void ViewInit(WindowsModel wm)
        {
            labelControl1.Text         = _groupClassInfo.GroupName;
            classTeacher_textEdit.Text = _groupClassInfo.ClassTeacher;
            create_textEdit.Text       = _groupClassInfo.CreateDate.ToString("yyyy-MM-dd");

            Point pt = labelControl1.Location;

            pt.X = (this.Width - labelControl1.Width) / 2;
            labelControl1.Location = pt;

            pt   = labelControl2.Location;
            pt.X = (this.Width - classTeacher_textEdit.Width - labelControl3.Width - create_textEdit.Width +
                    labelControl2.Width) / 2;
            labelControl2.Location = pt;
            pt.X += (labelControl2.Width + 5);
            classTeacher_textEdit.Location = pt;

            pt    = classTeacher_textEdit.Location;
            pt.X += (classTeacher_textEdit.Width + 10);
            labelControl3.Location = pt;

            pt.X += (labelControl3.Width + 5);
            create_textEdit.Location = pt;

            splitContainerControl3.SplitterPosition = splitContainerControl4.SplitterPosition;
            splitContainerControl2.SplitterPosition = this.Width / 2;

            classTeacher_textEdit.Properties.ReadOnly = true;
            create_textEdit.Properties.ReadOnly       = true;

            CheckGroupMembers();
        }
        public override void ExecuteCommand(string userId, string command)
        {
            ServerViewingAreaStatus viewingData = deserialize.Deserialize <ServerViewingAreaStatus>(command);

            if (viewingData == null)
            {
                return;
            }

            WindowsModel viewingArea = new WindowsModel()
            {
                PosLeft = viewingData.ViewingArea.LeftPos,
                PosTop  = viewingData.ViewingArea.TopPos,
                Width   = viewingData.ViewingArea.RightPos - viewingData.ViewingArea.LeftPos,
                Height  = viewingData.ViewingArea.BottomPos - viewingData.ViewingArea.TopPos
            };

            // save to settings
            ServerSettings.GetInstance().ViewingAreaLeft   = viewingArea.PosLeft;
            ServerSettings.GetInstance().ViewingAreaTop    = viewingArea.PosTop;
            ServerSettings.GetInstance().ViewingAreaWidth  = viewingArea.Width;
            ServerSettings.GetInstance().ViewingAreaHeight = viewingArea.Height;

            client.RefreshViewingArea(viewingArea);
        }
Beispiel #6
0
        public DetailForm(GroupClassInfo arg, WindowsModel wm)
        {
            InitializeComponent();
            _pageTotal      = 0;
            _selectionRow   = 0;
            _key            = string.Empty;
            _groupClassInfo = arg;
            _checkins       = new List <CheckinInfo>();
            _students       = new List <StudentInfo>();
            _removeStudents = new List <StudentInfo>();
            _addStudents    = new List <StudentInfo>();

            StudenQuery();
            ViewInit(wm);
        }
        private void WindowsInit(AccountInfo arg, WindowsModel vm)
        {
            switch (vm)
            {
            case WindowsModel.Modify:
                register_simpleButton.Hide();
                edite_simpleButton.Show();
                edite_simpleButton.Location = register_simpleButton.Location;

                person_textEdit.Text   = arg.Person;
                account_textEdit.Text  = arg.Account;
                password_textEdit.Text = Encryption.DecryptBase64(arg.Password);
                pwdAgain_textEdit.Text = Encryption.DecryptBase64(arg.Password);
                key_textEdit.Text      = Encryption.DecryptBase64(arg.Key);
                keyAgain_textEdit.Text = Encryption.DecryptBase64(arg.Key);
                break;

            default: break;
            }
        }
Beispiel #8
0
        public void RefreshViewingArea(WindowsModel viewingArea)
        {
            if (this.InvokeRequired)
            {
                this.BeginInvoke(new DelegateRefreshViewArea(RefreshViewingArea), viewingArea);
                return;
            }

            holder.ReferenceXPos = viewingArea.PosLeft;
            holder.ReferenceYPos = viewingArea.PosTop;
            holder.VirtualSize   = new Size(viewingArea.Width, viewingArea.Height);

            formMimic.VisibleSize   = new Size(viewingArea.Width, viewingArea.Height);
            formMimic.ReferenceLeft = viewingArea.PosLeft;
            formMimic.ReferenceTop  = viewingArea.PosTop;

            // need to use force as changing the virtual member will auto change the scale as well
            // no invalidation happen when the old scale same as new scale when calling normal refresh method
            holder.RefreshLayout();
            formMimic.RefreshMatrixLayout();
        }
 public RegisterForm(AccountInfo arg, WindowsModel vm)
 {
     InitializeComponent();
     _account = arg;
     WindowsInit(arg, vm);
 }
 public PayDetailForm(PayRecordInfo arg, WindowsModel wm)
 {
     InitializeComponent();
     SetWindwosText(arg);
     ViewInit(wm);
 }
Beispiel #11
0
 void formRunningApps_EvtAppClose(FormRunningApps form, WindowsModel model)
 {
     clientPresenter.SetApplicationClose(model.WindowsId);
 }
Beispiel #12
0
 public CreateForm(GroupClassInfo arg, WindowsModel wm)
 {
     InitializeComponent();
     _groupClass = arg;
     ViewInit(wm);
 }
Beispiel #13
0
        private void ViewInit(WindowsModel wm)
        {
            switch (wm)
            {
            case WindowsModel.AddNew:
                edit_simpleButton.Hide();
                updata_simpleButton.Show();
                updata_simpleButton.Text = @"新建(&N)";
                update_linkLabel.Hide();

                /*学生信息*/
                name_textEdit.ReadOnly     = false;
                sex_comboBoxEdit.ReadOnly  = false;
                parents_textEdit.ReadOnly  = false;
                contacts_textEdit.ReadOnly = false;
                address_textEdit.ReadOnly  = false;
                /*缴费信息*/
                tuition_textEdit.ReadOnly    = false;
                classHours_textEdit.ReadOnly = false;
                remaining_textEdit.ReadOnly  = false;
                last_dateEdit.ReadOnly       = false;
                yes_checkEdit.ReadOnly       = false;
                no_checkEdit.ReadOnly        = false;
                notPay_textEdit.ReadOnly     = false;
                break;

            case WindowsModel.Modify:
                edit_simpleButton.Hide();
                updata_simpleButton.Show();
                updata_simpleButton.Text = @"更新(&U)";
                update_linkLabel.Show();

                /*学生信息*/
                name_textEdit.ReadOnly     = false;
                sex_comboBoxEdit.ReadOnly  = false;
                parents_textEdit.ReadOnly  = false;
                contacts_textEdit.ReadOnly = false;
                address_textEdit.ReadOnly  = false;
                /*缴费信息*/
                tuition_textEdit.ReadOnly    = true;
                classHours_textEdit.ReadOnly = true;
                remaining_textEdit.ReadOnly  = true;
                last_dateEdit.ReadOnly       = true;
                yes_checkEdit.ReadOnly       = true;
                no_checkEdit.ReadOnly        = true;
                notPay_textEdit.ReadOnly     = true;
                break;

            case WindowsModel.Display:
                edit_simpleButton.Show();
                edit_simpleButton.Location = updata_simpleButton.Location;
                updata_simpleButton.Hide();
                update_linkLabel.Hide();

                /*学生信息*/
                name_textEdit.ReadOnly     = true;
                sex_comboBoxEdit.ReadOnly  = true;
                parents_textEdit.ReadOnly  = true;
                contacts_textEdit.ReadOnly = true;
                address_textEdit.ReadOnly  = true;
                /*缴费信息*/
                tuition_textEdit.ReadOnly    = true;
                classHours_textEdit.ReadOnly = true;
                remaining_textEdit.ReadOnly  = true;
                last_dateEdit.ReadOnly       = true;
                yes_checkEdit.ReadOnly       = true;
                no_checkEdit.ReadOnly        = true;
                notPay_textEdit.ReadOnly     = true;
                break;

            default: break;
            }
        }
Beispiel #14
0
        public void RefreshLayout(Client.Model.UserInfoModel user, Client.Model.ServerLayoutModel layout, WindowsModel viewingArea)
        {
            if (EvtServerReply != null)
            {
                EvtServerReply(this);
            }

            if (this.InvokeRequired)
            {
                this.Invoke(new DelegateRefreshLayout(RefreshLayout), user, layout, viewingArea);
                return;
            }

            if (holder != null)
            {
                holder.ReferenceXPos = viewingArea.PosLeft;
                holder.ReferenceYPos = viewingArea.PosTop;
                holder.VirtualSize   = new Size(viewingArea.Width, viewingArea.Height);
            }

            formMimic.Row           = layout.LayoutRow;
            formMimic.Column        = layout.LayoutColumn;
            formMimic.FullSize      = new Size(layout.DesktopLayout.Width, layout.DesktopLayout.Height);
            formMimic.VisibleSize   = new Size(viewingArea.Width, viewingArea.Height);
            formMimic.ReferenceLeft = viewingArea.PosLeft;
            formMimic.ReferenceTop  = viewingArea.PosTop;

            // holder.RefreshLayout();

            formMimic.Text = user.DisplayName;
            formMimic.RefreshMatrixLayout();
        }
Beispiel #15
0
 void formRunningApps_EvtAppBringToFront(FormRunningApps form, WindowsModel model)
 {
     clientPresenter.SetApplicationForeground(model.WindowsId);
 }
        public override void ExecuteCommand(string userId, string command)
        {
            ServerLoginReply loginData = deserialize.Deserialize <ServerLoginReply>(command);

            if (loginData == null)
            {
                return;
            }

            // calculate the actual size of server desktop (might have multiple monitors)
            int minPosX = 0;
            int minPosY = 0;
            int maxPosX = 0;
            int maxPosY = 0;

            foreach (MonitorInfo monitor in loginData.ServerLayout.ServerMonitorsList)
            {
                minPosX = Math.Min(monitor.LeftPos, minPosX);
                minPosY = Math.Min(monitor.TopPos, minPosY);

                maxPosX = Math.Max(monitor.RightPos, maxPosX);
                maxPosY = Math.Max(monitor.BottomPos, maxPosY);
            }

            UserInfoModel userInfo = new UserInfoModel()
            {
                UserId = loginData.UserId, DisplayName = loginData.LoginName
            };
            ServerLayoutModel layoutInfo = new ServerLayoutModel()
            {
                DesktopLayout = new WindowsModel()
                {
                    PosLeft = minPosX,
                    PosTop  = minPosY,
                    Width   = maxPosX - minPosX,
                    Height  = maxPosY - minPosY
                },

                LayoutColumn = loginData.ServerLayout.MatrixCol,
                LayoutRow    = loginData.ServerLayout.MatrixRow,
            };

            WindowsModel viewingArea = new WindowsModel()
            {
                PosLeft = loginData.ViewingArea.LeftPos,
                PosTop  = loginData.ViewingArea.TopPos,
                Width   = loginData.ViewingArea.RightPos - loginData.ViewingArea.LeftPos,
                Height  = loginData.ViewingArea.BottomPos - loginData.ViewingArea.TopPos
            };

            // save to settings
            ServerSettings.GetInstance().DesktopLeft   = layoutInfo.DesktopLayout.PosLeft;
            ServerSettings.GetInstance().DesktopTop    = layoutInfo.DesktopLayout.PosTop;
            ServerSettings.GetInstance().DesktopWidth  = layoutInfo.DesktopLayout.Width;
            ServerSettings.GetInstance().DesktopHeight = layoutInfo.DesktopLayout.Height;

            ServerSettings.GetInstance().ViewingAreaLeft   = viewingArea.PosLeft;
            ServerSettings.GetInstance().ViewingAreaTop    = viewingArea.PosTop;
            ServerSettings.GetInstance().ViewingAreaWidth  = viewingArea.Width;
            ServerSettings.GetInstance().ViewingAreaHeight = viewingArea.Height;

            ServerSettings.GetInstance().DesktopRow    = layoutInfo.LayoutRow;
            ServerSettings.GetInstance().DesktopColumn = layoutInfo.LayoutColumn;

            UserSettings.GetInstance().UserId      = userInfo.UserId;
            UserSettings.GetInstance().DisplayName = userInfo.DisplayName;

            // update the gui
            client.RefreshLayout(userInfo, layoutInfo, viewingArea);

            ServerUserSettingCmdImpl userSettingImpl = new ServerUserSettingCmdImpl(client);

            userSettingImpl.ExecuteCommand(userId, loginData.UserSetting.getCommandString());

            // update the application priviledge
            ServerAppStatusCmdImpl appCmdImpl = new ServerAppStatusCmdImpl(client);

            appCmdImpl.ExecuteCommand(userId, loginData.UserApplications.getCommandString());

            // update the maintenance priviledge
            ServerMaintenanceCmdImpl maintenanceCmdImpl = new ServerMaintenanceCmdImpl(client);

            maintenanceCmdImpl.ExecuteCommand(userId, loginData.UserMaintenance.getCommandString());

            // update presets saved
            ServerPresetCmdImpl presetCmdImpl = new ServerPresetCmdImpl(client);

            presetCmdImpl.ExecuteCommand(userId, loginData.UserPresets.getCommandString());

            // update vnc saved
            ServerVncStatusCmdImpl vncCmdImp = new ServerVncStatusCmdImpl(client);

            vncCmdImp.ExecuteCommand(userId, loginData.VncStatus.getCommandString());
        }
Beispiel #17
0
 void formRunningApps_EvtAppMaximize(FormRunningApps form, WindowsModel model)
 {
     setWndMaximize(model.WindowsId);
 }