Exemplo n.º 1
0
        private void hlbtnViewReturnLog_Click(object sender, RoutedEventArgs e)
        {
            LendRequestVM     requestVM  = this.DataContext as LendRequestVM;
            LendRequestItemVM returnItem = this.dgProductList.SelectedItem as LendRequestItemVM;
            int productSysNo             = (int)returnItem.ProductSysNo;

            LendRequestItemVM         seleced       = requestVM.LendItemInfoList.Where(p => p.ProductSysNo == returnItem.ProductSysNo).FirstOrDefault();
            List <ProductBatchInfoVM> bathcInfoList = seleced.BatchDetailsInfoList;

            List <LendRequestReturnItemInfo> returnItemLog = new List <LendRequestReturnItemInfo>();

            requestVM.ReturnItemInfoList.ForEach(i =>
            {
                if (i.ReturnProduct.SysNo == productSysNo)
                {
                    LendRequestReturnItemInfo ri = new LendRequestReturnItemInfo
                    {
                        ReturnDate     = i.ReturnDate,
                        ReturnQuantity = i.ReturnQuantity
                    };
                    returnItemLog.Add(ri);
                }
            });
            LendRequestReturnItem ucReturnItemLog = new LendRequestReturnItem {
                ReturnItemList = returnItemLog
            };

            CurrentWindow.ShowDialog("归还", ucReturnItemLog);
        }
Exemplo n.º 2
0
        //检查记录的最大条数:
        private bool CheckMaxinumItemsCount()
        {
            int currentNumber = this.OldItemVM == null ? 0 : this.OldItemVM.Count;

            if (null != OldItemVM)
            {
                foreach (var item in OldItemVM)
                {
                    if (item.SettleSysNo == -1)
                    {
                        currentNumber--;
                    }
                }
            }

            foreach (var newItem in listProductsVM)
            {
                if (OldItemVM.SingleOrDefault(i => i.ConsignToAccLogInfo.LogSysNo == newItem.ConsignToAccLogInfo.LogSysNo) == null)
                {
                    currentNumber++;
                }
            }

            if (currentNumber > 200)
            {
                CurrentWindow.Alert(string.Format(ResSettledProductsRuleQuery.InfoMsg_MaxConsignToAccCount, 200));
                return(false);
            }
            else
            {
                return(true);
            }
        }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (_reasonList == null || _currentVM == null || _currentVM.SysNo == null)
            {
                return;
            }
            string commaSeperatedReasonIDs = "";

            foreach (var item in _reasonList)
            {
                if (item.IsChecked == true)
                {
                    commaSeperatedReasonIDs += "," + item.ReasonID;
                }
            }
            commaSeperatedReasonIDs = commaSeperatedReasonIDs.TrimEnd(',');
            if (commaSeperatedReasonIDs.Length == 0)
            {
                CurrentWindow.Alert(ResProductPriceCompare.Info_PleaseSelectInvalidReason);
                return;
            }
            var facade = new ProductPriceCompareFacade(CPApplication.Current.CurrentPage);

            //审核无效
            facade.AuditDecline(_currentVM.SysNo.Value, commaSeperatedReasonIDs, () =>
            {
                CurrentWindow.Alert(ResProductPriceCompare.Info_AuditDeclineSuccess);
                CloseDialog(DialogResultType.OK);
            });
        }
Exemplo n.º 4
0
        public override void Act(KeyboardState ks, MouseState ms)
        {
            if (ks[Key.Escape])
            {
                CurrentWindow.SetWorld(new GameWorldStart());
                return;
            }
            if (ks[Key.Left])
            {
                _alpha = HelperGeneral.Clamp(_alpha - 0.0000001f * KWEngine.DeltaTimeFactor, 0.0f, 1f);
                Console.WriteLine("Alpha: " + _alpha);
                _sunLightWithShadow.SetFOVBiasCoefficient(_alpha, _hardness);
            }
            if (ks[Key.Right])
            {
                _alpha = HelperGeneral.Clamp(_alpha + 0.0000001f * KWEngine.DeltaTimeFactor, 0.0f, 1f);
                Console.WriteLine("Alpha: " + _alpha);
                _sunLightWithShadow.SetFOVBiasCoefficient(_alpha, _hardness);
            }

            if (ks[Key.Up])
            {
                _hardness = HelperGeneral.Clamp(_hardness + 0.001f * KWEngine.DeltaTimeFactor, -0.5f, 0.5f);
                Console.WriteLine("Hardness: " + _hardness);
                _sunLightWithShadow.SetFOVBiasCoefficient(_alpha, _hardness);
            }
            if (ks[Key.Down])
            {
                _hardness = HelperGeneral.Clamp(_hardness - 0.001f * KWEngine.DeltaTimeFactor, -0.5f, 0.5f);
                Console.WriteLine("Hardness: " + _hardness);
                _sunLightWithShadow.SetFOVBiasCoefficient(_alpha, _hardness);
            }
        }
Exemplo n.º 5
0
        void ImageProductPicker_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            UCProductSearch ucProductSearch = new UCProductSearch();

            ucProductSearch.SelectionMode = SelectionMode.Single;
            ucProductSearch.DialogHandler = CurrentWindow.ShowDialog(ResProductPicker.Dialog_Title, ucProductSearch, OnDialogResult);
        }
Exemplo n.º 6
0
        public override void Act(KeyboardState ks, MouseState ms)
        {
            if (ks[Key.Escape])
            {
                CurrentWindow.SetWorld(new GameWorldStart());
                return;
            }

            if (ks[Key.KeypadPlus])
            {
                _point.SetColor(_point.Color.X, _point.Color.Y, _point.Color.Z, HelperGeneral.Clamp(_point.Color.W + 0.01f, 0, 1024));
                _spot.SetColor(_spot.Color.X, _spot.Color.Y, _spot.Color.Z, HelperGeneral.Clamp(_spot.Color.W + 0.01f, 0, 1024));
                Console.WriteLine(_point.Color);
            }
            if (ks[Key.KeypadMinus])
            {
                _point.SetColor(_point.Color.X, _point.Color.Y, _point.Color.Z, HelperGeneral.Clamp(_point.Color.W - 0.01f, 0, 1024));
                _spot.SetColor(_spot.Color.X, _spot.Color.Y, _spot.Color.Z, HelperGeneral.Clamp(_spot.Color.W - 0.01f, 0, 1024));
                Console.WriteLine(_point.Color);
            }
            if (ks[Key.KeypadMultiply])
            {
                _multi += 0.1f;
                _point.SetNearAndFarBounds(1, _multi);
                _spot.SetNearAndFarBounds(1, _multi);
                Console.WriteLine(_multi);
            }
            if (ks[Key.KeypadDivide])
            {
                _multi = HelperGeneral.Clamp(_multi - 0.1f, 0, 1024);
                _point.SetNearAndFarBounds(1, _multi);
                _spot.SetNearAndFarBounds(1, _multi);
                Console.WriteLine(_multi);
            }
        }
Exemplo n.º 7
0
                     ""; //Path where php files are located

    void OnGUI()
    {
        if (!isLoggedIn)
        {
            if (currentWindow == CurrentWindow.Login)
            {
                GUI.Window(0, new Rect(Screen.width / 2 - 125, Screen.height / 2 - 115, 250, 230), LoginWindow, "Login");
            }
            if (currentWindow == CurrentWindow.Register)
            {
                GUI.Window(0, new Rect(Screen.width / 2 - 125, Screen.height / 2 - 165, 250, 330), RegisterWindow, "Register");
            }
        }

        GUI.Label(new Rect(5, 5, 500, 25), "Status: " + (isLoggedIn ? "Logged-in Username: "******" Email: " + userEmail : "Logged-out"));
        if (isLoggedIn)
        {
            if (GUI.Button(new Rect(5, 30, 100, 25), "Log Out"))
            {
                isLoggedIn    = false;
                userName      = "";
                userEmail     = "";
                currentWindow = CurrentWindow.Login;
            }
        }
    }
Exemplo n.º 8
0
        public StudentControlPage()
        {
            InitializeComponent();
            cw = (App.Current as App).CurrentPage;
            DataGridTextColumn col = new DataGridTextColumn();

            col         = new DataGridTextColumn();
            col.Header  = "Ім'я";
            col.Width   = new DataGridLength(250);
            col.Binding = new Binding("FullName");
            StudentGrid.Columns.Add(col);
            col         = new DataGridTextColumn();
            col.Header  = "Залікова книжка";
            col.Width   = new DataGridLength(100);
            col.Binding = new Binding("RecordBookNumber");
            StudentGrid.Columns.Add(col);
            col         = new DataGridTextColumn();
            col.Header  = "Група";
            col.Width   = new DataGridLength(100);
            col.Binding = new Binding("Group");
            StudentGrid.Columns.Add(col);
            col         = new DataGridTextColumn();
            col.Header  = "Факультет";
            col.Width   = new DataGridLength(100);
            col.Binding = new Binding("Faculty");
            StudentGrid.Columns.Add(col);
            col         = new DataGridTextColumn();
            col.Header  = "Телефон";
            col.Width   = new DataGridLength(250);
            col.Binding = new Binding("PhoneNumber");
            StudentGrid.Columns.Add(col);
            UpdateStudents();
        }
Exemplo n.º 9
0
        private void DoShow(WindowHistoryEntry windowEntry)
        {
            if (CurrentWindow == windowEntry.Screen)
            {
                Debug.LogWarning(
                    string.Format(
                        "[WindowUILayer] The requested WindowId ({0}) is already open! This will add a duplicate to the " +
                        "history and might cause inconsistent behaviour. It is recommended that if you need to open the same" +
                        "screen multiple times (eg: when implementing a warning message pop-up), it closes itself upon the player input" +
                        "that triggers the continuation of the flow."
                        , CurrentWindow.ScreenId));
            }
            else if (CurrentWindow != null &&
                     CurrentWindow.HideOnForegroundLost &&
                     !windowEntry.Screen.IsPopup)
            {
                CurrentWindow.Hide();
            }

            windowHistory.Push(windowEntry);
            AddTransition(windowEntry.Screen);

            if (windowEntry.Screen.IsPopup)
            {
                priorityParaLayer.DarkenBG();
            }

            windowEntry.Show();

            CurrentWindow = windowEntry.Screen;
        }
Exemplo n.º 10
0
        private void Send_Click(object sender, RoutedEventArgs e)
        {
            if (name.Text == "" || telephon.Text == "" || TxtBody.Text == "")
            {
                MessageBox.Show("יש למלא את כל השדות");
                return;
            }
            try
            {
                string text = "שם: " + name.Text + "\nמייל: " + telephon.Text
                              + "\nגוף ההודעה: " + TxtBody.Text;
                var contact_mail = app.GetGlobalSettings().ContactMail;
                text = text.Replace(System.Environment.NewLine, "<br />").Replace("\n", "<br />");
                Contact c = new Contact();
                c.Body        = text;
                c.Subject     = TxtSubject.Text;
                c.ReciverMail = contact_mail;


                CurrentWindow.SendBackgroundMail(c);


                BackToMain();   // חזרה לדף ראשי
            }
            catch
            {
                MessageBox.Show("אירעה בעיה במשלוח המייל");
            }
        }
Exemplo n.º 11
0
        private void txtStockSysNo_KeyUp(object sender, KeyEventArgs e)
        {
            //只处理Enter事件
            if (e.Key != Key.Enter)
            {
                return;
            }
            this.StockID = "";
            string StockSysNoString = this.txtStockSysNo.Text.Trim();

            if (string.IsNullOrEmpty(StockSysNoString))
            {
                return;
            }
            //验证渠道库存系统编号
            int StockSysNo = 0;

            if (!int.TryParse(StockSysNoString, out StockSysNo))
            {
                CurrentWindow.Alert(string.Format(ResStockPicker.Tip_StockSysNoInvalid, StockSysNoString), MessageType.Warning);
                e.Handled = true;
                return;
            }
            var StockSelectedEvent = StockSelected;

            if (StockSelectedEvent != null)
            {
                var facade = new StockQueryFacade(CPApplication.Current.CurrentPage);
                facade.LoadStockBySysNo(StockSysNo, OnLoadStockBySysNo);
                e.Handled = true;
            }
        }
Exemplo n.º 12
0
        private void ucFileUploader_AllFileUploadCompleted(object sender, Basic.Controls.Uploader.AllUploadCompletedEventArgs args)
        {
            if (args.UploadInfo != null && args.UploadInfo.Count > 0 && args.UploadInfo[0].UploadResult == Basic.Controls.Uploader.SingleFileUploadStatus.Success)
            {
                string getFileIdentity = args.UploadInfo[0].ServerFilePath;
                this.FileIdentity = getFileIdentity;

                //解析上传Excel,返回List<>:
                serviceFacade.ConvertBasketTemplateFileToEntityList(getFileIdentity, (objs, argss) =>
                {
                    if (argss.FaultsHandle())
                    {
                        return;
                    }
                    this.Dialog.ResultArgs.Data = argss.Result;
                    //CPApplication.Current.CurrentPage.Context.Window.Alert(string.Format("导入成功{0}条,导入失败{1}条", (string)argss.Result[1].Rows[0]["successCount"], (string)argss.Result[1].Rows[0]["failedCount"]));
                    this.Dialog.Close(true);
                });
            }
            else
            {
                CurrentWindow.Alert("上传模板失败!");
                return;
            }
        }
Exemplo n.º 13
0
        public async Task <ExecutionResult> InitializeAsync()
        {
            try {
                if (!Session.IsHostRunning)
                {
                    var startupInfo = new RHostStartupInfo {
                        Name = "REPL",
                        RHostCommandLineArguments = _connections.ActiveConnection?.RCommandLineArguments,
                        CranMirrorName            = _settings.CranMirror,
                        CodePage         = _settings.RCodePage,
                        WorkingDirectory = _settings.WorkingDirectory,
                        TerminalWidth    = _terminalWidth,
                    };

                    if (CurrentWindow != null)
                    {
                        CurrentWindow.TextView.VisualElement.SizeChanged += VisualElement_SizeChanged;
                        CurrentWindow.OutputBuffer.Changed += OutputBuffer_Changed;
                    }
                    await Session.EnsureHostStartedAsync(startupInfo, new RSessionCallback(CurrentWindow, Session, _settings, _coreShell, new FileSystem()));
                }
                return(ExecutionResult.Success);
            } catch (RHostBrokerBinaryMissingException) {
                await _coreShell.ShowErrorMessageAsync(Resources.Error_Microsoft_R_Host_Missing);

                return(ExecutionResult.Failure);
            } catch (RHostDisconnectedException ex) {
                CurrentWindow?.WriteError(Environment.NewLine + ex.Message);
                return(ExecutionResult.Success);
            } catch (Exception ex) {
                await _coreShell.ShowErrorMessageAsync(ex.Message);

                return(ExecutionResult.Failure);
            }
        }
Exemplo n.º 14
0
        private void OnLoadCustomerByID(object sender, RestClientEventArgs <dynamic> args)
        {
            if (args.Result == null || args.Result.TotalCount == 0)
            {
                //顾客帐号不存在
                this.txtCustomerID.Text    = string.Empty;
                this.txtCustomerSysNo.Text = string.Empty;
                OnCustomerSelected(null);
            }
            else if (args.Result.TotalCount > 1)
            {
                //同一顾客帐号存在多个
                UCCustomerSearch ucCustomerSearch = new UCCustomerSearch();
                ucCustomerSearch.SelectionMode         = SelectionMode.Single;
                ucCustomerSearch.DialogHandle          = CurrentWindow.ShowDialog(ResCustomerPicker.Dialog_Title, ucCustomerSearch, OnDialogResult);
                ucCustomerSearch._viewModel.CustomerID = this.txtCustomerID.Text;
                ucCustomerSearch.BindDataGrid(1, null);
            }
            else
            {
                //顾客帐号只存在一个
                CustomerVM selectedCustomer = DynamicConverter <CustomerVM> .ConvertToVM(args.Result.Rows[0]);

                this.txtCustomerSysNo.Text = selectedCustomer.SysNo.ToString();
                this.txtCustomerID.Focus();
                OnCustomerSelected(selectedCustomer);
            }
        }
Exemplo n.º 15
0
        private void OnLoadProductByID(object sender, RestClientEventArgs <dynamic> args)
        {
            if (args.Result != null)
            {
                dynamic totalCount = args.Result.TotalCount;
                if (totalCount == 0)
                {
                    //商品ID不存在
                    this.txtProductID.Text    = string.Empty;
                    this.txtProductSysNo.Text = string.Empty;
                }
                else if (totalCount > 1)
                {
                    //同一商品ID存在多个
                    UCProductSearch ucProductSearch = new UCProductSearch();
                    ucProductSearch.SelectionMode        = SelectionMode.Single;
                    ucProductSearch._viewModel.ProductID = this.txtProductID.Text.Trim();
                    ucProductSearch.BindDataGrid(totalCount, args.Result.Rows);
                    ucProductSearch.DialogHandler = CurrentWindow.ShowDialog(ResProductPicker.Dialog_Title, ucProductSearch, OnDialogResult);
                }
                else
                {
                    //商品ID只存在一个
                    ProductVM selectedProduct = DynamicConverter <ProductVM> .ConvertToVM(args.Result.Rows[0]);

                    this.txtProductID.Text     = selectedProduct.ProductID;
                    this.txtProductSysNo.Text  = selectedProduct.SysNo.ToString();
                    this.m_selectedProductInfo = selectedProduct;
                    OnProductSelected(selectedProduct);
                    this.txtProductID.Focus();
                }
            }
        }
Exemplo n.º 16
0
        public override void Act(KeyboardState ks, MouseState ms)
        {
            if (ks[Key.Escape])
            {
                CurrentWindow.SetWorld(new GameWorldStart());
                return;
            }

            if (_player != null)
            {
                SetCameraPosition(_player.Position.X, 0, 50);
                SetCameraTarget(_player.Position.X, 0, 0);
                UpdateSunPosition();
            }

            if (ks[Key.O] && GetCurrentTimeInMilliseconds() - _lastspawn > 500)
            {
                LightObject newLight = new LightObject(LightType.Point, true);
                newLight.SetPosition(0, 5, 5);
                newLight.SetNearAndFarBounds(1, 20);
                AddLightObject(newLight);
                _testlights.Add(newLight);
                _lastspawn = GetCurrentTimeInMilliseconds();
            }

            if (ks[Key.P] && GetCurrentTimeInMilliseconds() - _lastspawn > 300)
            {
                if (_testlights.Count > 0)
                {
                    RemoveLightObject(_testlights[_testlights.Count - 1]);
                    _testlights.Remove(_testlights[_testlights.Count - 1]);
                }
                _lastspawn = GetCurrentTimeInMilliseconds();
            }
        }
Exemplo n.º 17
0
        public Task <ExecutionResult> ExecuteCodeAsync(string text)
        {
            var res = _commands.TryExecuteCommand();

            if (res != null)
            {
                return(res);
            }

            if (!IsInDebugBreakMode())
            {
                NoExecutionIfNotStoppedInDebuggerError();
                return(ExecutionResult.Succeeded);
            }

            if (_activeEvaluator != null)
            {
                return(_activeEvaluator.ExecuteCodeAsync(text));
            }
            else
            {
                if (CustomDebugAdapterProtocolExtension.CanUseExperimental())
                {
                    var tid    = _serviceProvider.GetDTE().Debugger.CurrentThread.ID;
                    var result = CustomDebugAdapterProtocolExtension.EvaluateReplRequest(text, tid);
                    CurrentWindow.Write(result);
                }
            }

            return(ExecutionResult.Succeeded);
        }
Exemplo n.º 18
0
        public override void Act(KeyboardState kb, MouseState ms)
        {
            if (kb[Key.Escape])
            {
                CurrentWindow.SetWorld(new GameWorldStart());
                return;
            }
            Console.WriteLine("Maus ist im Fenser: " + CurrentWindow.IsMouseInWindow);

            CallerCube t = HelperIntersection.IsMouseCursorOnAny <CallerCube>(ms);

            if (t != null)
            {
                coloredItems.Add(t);
                t.SetGlow(1, 1, 0, 1);
            }
            foreach (GameObject g in GetGameObjects())
            {
                if (!coloredItems.Contains(g))
                {
                    g.SetGlow(0, 0, 0, 0);
                }
            }
            coloredItems.Clear();
        }
 public StudentControlPage()
 {
     InitializeComponent();
     cw = (App.Current as App).CurrentPage;
     DataGridTextColumn col = new DataGridTextColumn();
     col = new DataGridTextColumn();
     col.Header = "Ім'я";
     col.Width = new DataGridLength(250);
     col.Binding = new Binding("FullName");
     StudentGrid.Columns.Add(col);
     col = new DataGridTextColumn();
     col.Header = "Залікова книжка";
     col.Width = new DataGridLength(100);
     col.Binding = new Binding("RecordBookNumber");
     StudentGrid.Columns.Add(col);
     col = new DataGridTextColumn();
     col.Header = "Група";
     col.Width = new DataGridLength(100);
     col.Binding = new Binding("Group");
     StudentGrid.Columns.Add(col);
     col = new DataGridTextColumn();
     col.Header = "Факультет";
     col.Width = new DataGridLength(100);
     col.Binding = new Binding("Faculty");
     StudentGrid.Columns.Add(col);
     col = new DataGridTextColumn();
     col.Header = "Телефон";
     col.Width = new DataGridLength(250);
     col.Binding = new Binding("PhoneNumber");
     StudentGrid.Columns.Add(col);
     UpdateStudents();
 }
Exemplo n.º 20
0
        public static void NavigateTo(GeckoWebBrowser browser, CurrentWindow window)
        {
            try {
                string location = @"\html\index.html";
                switch (window)
                {
                case CurrentWindow.Dependent:
                    location = @"\html\dependent.html";
                    break;

                case CurrentWindow.EnterNumber:
                    location = @"\html\enter_number.html";
                    break;

                case CurrentWindow.Pay:
                    location = @"\html\pay.html";
                    break;

                case CurrentWindow.Encashment:
                    location = @"\html\encashment.html";
                    break;

                case CurrentWindow.MakeEncashment:
                    location = @"\html\make_encashment.html";
                    break;

                case CurrentWindow.BlockTerminal:
                    location = @"\html\terminal_blocked.html";
                    break;
                }
                browser.Navigate(Directory.GetCurrentDirectory() + location);
            } catch (Exception exception) {
                Log.Error("Cannot navigate to the page");
            }
        }
 private void btnConfirm_Click(object sender, RoutedEventArgs e)
 {
     //确定操作:
     if (ResultList.Count > 0)
     {
         List <InventoryTransferStockingVendorInfoVM> selectedList = ResultList.Where(x => x.IsChecked == true).ToList();
         if (selectedList.Count <= 0)
         {
             CurrentWindow.Alert("请选择至少一个供应商!");
             return;
         }
         string getSelectedVendorSysNos = string.Empty;
         selectedList.ForEach(x =>
         {
             getSelectedVendorSysNos += string.Format("{0}|", x.VendorSysNo);
         });
         getSelectedVendorSysNos     = getSelectedVendorSysNos.TrimEnd('|');
         this.Dialog.ResultArgs.Data = getSelectedVendorSysNos;
         this.Dialog.Close(true);
     }
     else
     {
         this.Dialog.ResultArgs.Data = null;
         this.Dialog.Close(true);
     }
 }
Exemplo n.º 22
0
 public override void Act(KeyboardState kb, MouseState ms)
 {
     if (kb[Key.Escape])
     {
         CurrentWindow.SetWorld(new GameWorldStart());
         return;
     }
 }
Exemplo n.º 23
0
 public virtual void Open()
 {
     if (CurrentWindow != null)
     {
         CurrentWindow.Close();
     }
     gameObject.SetActive(true);
 }
Exemplo n.º 24
0
 /// <summary>
 ///     Peform the UI update for this frame.
 /// </summary>
 ///
 /// <param name="gameTime">
 ///     The game loop's current game time.
 /// </param>
 public override void Update(GameTime gameTime)
 {
     if (CurrentWindow != null)
     {
         CurrentWindow.Update();
     }
     base.Update(gameTime);
 }
Exemplo n.º 25
0
        public static ChildWindow GetChildWindow <T>(Vector2 position, params object[] parameters)
            where T : WindowEditor
        {
            var window = CurrentWindow.OpenChildWindow <T>(position, parameters);

            _cWindows[window.Editor] = window;
            return(window);
        }
Exemplo n.º 26
0
        // /////////////////////////////////////////////////////////////////////////////////
        #endregion
        #region Public Methods
        // /////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Initializes libtcod and starts the application's main loop.  This will loop
        /// until IsQuitting is set to true or the main system window is closed.
        /// </summary>
        /// <param name="setupInfo">An ApplicationInfo object containing the options specific
        /// to this application</param>
        public void Start(ApplicationInfo setupInfo)
        {
            Setup(setupInfo);

            Run();

            CurrentWindow.OnQuitting();
        }
 public AddStudentWindow(CurrentWindow c)
 {
     InitializeComponent();
     EducationFormBox.Items.Add("Денна");
     EducationFormBox.Items.Add("Заочна");
     EducationLevelBox.Items.Add("Бакалавр");
     EducationLevelBox.Items.Add("Магістр");
     EducationLevelBox.Items.Add("Спеціаліст");
 }
Exemplo n.º 28
0
        public static void FinalizarApp(this object obj)
        {
            if (CurrentWindow == null)
            {
                return;
            }

            CurrentWindow.Close();
        }
Exemplo n.º 29
0
 public void CloseWindow(bool clientInitiated = false)
 {
     if (!clientInitiated)
     {
         QueuePacket(new CloseWindowPacket(CurrentWindow.ID));
     }
     CurrentWindow.CopyToInventory(Inventory);
     CurrentWindow = InventoryWindow;
 }
 public AddSubjectWindow(CurrentWindow currentWindow, int subjectId = 0, string subjectName = "")
 {
     _cw = currentWindow;
     _subjectId = subjectId;
     this.Title = _cw == CurrentWindow.AddSubject ? "Створення предмета" : "Редагування предмета";
     InitializeComponent();
     if (_cw == CurrentWindow.EditSubject)
         SubjectNameBox.Text = _oldSubjectName = subjectName;
 }
Exemplo n.º 31
0
        private void Hyperlink_ProductNumber_Click(object sender, RoutedEventArgs e)
        {
            var lnk = sender as FrameworkElement;

            if (null != lnk)
            {
                CurrentWindow.Navigate(string.Format(ConstValue.IM_ProductMaintainUrlFormat, lnk.Tag.ToString()), null, true);
            }
        }
Exemplo n.º 32
0
        private void btnAddSettleItems_Click(object sender, RoutedEventArgs e)
        {
            //添加结算商品:
            int selectCount = 0;

            listProductsVM.ForEach(x =>
            {
                if (x.IsCheckedItem)
                {
                    selectCount++;
                }
            });
            if (selectCount <= 0)
            {
                CurrentWindow.Alert(ResSettledProductsRuleQuery.InfoMsg_CheckProducts);
                return;
            }
            if (CheckMaxinumItemsCount())
            {
                this.listProductsVM.Where(i => i.IsCheckedItem == true).ToList().ForEach(x =>
                {
                    x.IsCheckedItem = false;
                    if (SettleSysNo.HasValue)
                    {
                        x.SettleSysNo = SettleSysNo.Value;
                    }
                    //添加进现有的List中(不重复添加:):
                    ConsignSettlementItemInfoVM getExistItem = OldItemVM.SingleOrDefault(i => i.ConsignToAccLogInfo.LogSysNo == x.ConsignToAccLogInfo.LogSysNo);
                    if (getExistItem == null)
                    {
                        x.IsSettleCostTextBoxReadOnly       = x.SettleType == SettleType.O ? false : true;
                        x.IsSettlePercentageTextBoxReadOnly = x.SettleType == SettleType.P ? false : true;
                        x.SettlePercentageTextBoxVisibility = x.SettleType == SettleType.P ? Visibility.Visible : Visibility.Collapsed;
                        //毛利:
                        x.ConsignToAccLogInfo.RateMargin = x.ConsignToAccLogInfo.SalePrice.ToDecimal() - x.ConsignToAccLogInfo.Cost.ToDecimal();
                        //毛利总额 :
                        x.ConsignToAccLogInfo.RateMarginTotal = x.ConsignToAccLogInfo.RateMargin.ToDecimal() * x.ConsignToAccLogInfo.ProductQuantity.ToInteger();
                        OldItemVM.Add(x);
                    }
                    else
                    {
                        if (getExistItem.SettleSysNo == -1)
                        {
                            getExistItem.SettleSysNo      = null;
                            getExistItem.SettlePercentage = x.SettlePercentage;
                            getExistItem.Cost             = string.IsNullOrEmpty(x.ConsignToAccLogInfo.Cost) ? (decimal?)null : x.ConsignToAccLogInfo.Cost.ToDecimal();
                            getExistItem.SettleRuleSysNo  = x.SettleRuleSysNo;
                            getExistItem.SettleRuleName   = x.SettleRuleName;
                        }
                    }
                });

                this.Dialog.ResultArgs.Data         = OldItemVM;
                this.Dialog.ResultArgs.DialogResult = DialogResultType.OK;
                Dialog.Close(true);
            }
        }
 public SubjectControlPage()
 {
     InitializeComponent();
     cw = (App.Current as App).CurrentPage;
     DataGridTextColumn col = new DataGridTextColumn();
     col = new DataGridTextColumn();
     col.Header = "Назва";
     col.Width = new DataGridLength(250);
     col.Binding = new Binding("Name");
     SubjectGrid.Columns.Add(col); 
     UpdateSubjects();
 }
 public AddSpecialityWindow(CurrentWindow currentWindow, Speciality speciality = null)
 {
     _curWindow = currentWindow;
     if (_curWindow == CurrentWindow.EditSpeciality)
     {
         _speciality = speciality;
         SpecialityNameBox.Text = speciality.Name;
         SpecialityCodeBox.Text = speciality.Code;
         SpecialityCodeBox.IsReadOnly = true;
         DirectionBox.Text = speciality.Direction;
     }
     InitializeComponent();
 }
 public AddPenaltyWindow(Project cp, int evnum, CurrentWindow cw)
 {
     CurPr = cp;
     EventNumber = evnum;
     curWindow = cw;
     InitializeComponent();
     if (curWindow == CurrentWindow.AddPenalty)
     {
         this.Title = "Додати штраф";
     }
     else
     {
         this.Title = "Редагувати штраф";
     }
 }
 public GroupControlPage()
 {
     InitializeComponent();
     cw = (App.Current as App).CurrentPage;
     DataGridTextColumn col = new DataGridTextColumn();
     col = new DataGridTextColumn();
     col.Header = "Група";
     col.Width = new DataGridLength(250);
     col.Binding = new Binding("Name");
     GroupGrid.Columns.Add(col); col = new DataGridTextColumn();
     col.Header = "Факультет";
     col.Width = new DataGridLength(250);
     col.Binding = new Binding("Faculty");
     GroupGrid.Columns.Add(col);
     UpdateGroups();
 }
 public SetDeadlinesWindow(CurrentWindow cw, DiplomaControlPage Page)
 {
     p = Page;
     InitializeComponent();
     if (cw == CurrentWindow.EditDeadlines)
     {
         First.SelectedDate = p.ControlDeadlines[0];
         Second.SelectedDate = p.ControlDeadlines[1];
         Third.SelectedDate = p.ControlDeadlines[2];
         if (p.ControlDeadlines.Count > 3)
         {
             Fourth.SelectedDate = p.ControlDeadlines[3];
             if (p.ControlDeadlines.Count > 4)
                 Fifth.SelectedDate = p.ControlDeadlines[4];
         }
         PreDefense.SelectedDate = p.PreDefenseDeadline;
     }
 }
Exemplo n.º 38
0
 public AddGroupWindow(CurrentWindow windowMode, string groupName = "", string facultyName = "")
 {
     InitializeComponent();
     _cw = windowMode;
     _oldGroupName = groupName;
     _oldFaculty = facultyName;
     this.Title = _cw == CurrentWindow.AddGroup ? "Створення групи" : "Редагування групи";
     foreach (var faculty in EnumDecoder.StringToFaculties)
     {
         FacultyBox.Items.Add(faculty.Key);
     }
     InitializeComponent();
     if (_cw == CurrentWindow.EditGroup)
     {
         GroupNameBox.Text = groupName;
         FacultyBox.SelectedItem = facultyName;
     }
     else if(FacultyBox.Items.Count >= 0)
     {
         FacultyBox.SelectedIndex = 0;
     }
 }
 public GradeEventWindow(CurrentWindow cw, Project pr, int evnum = 0)
 {
     curWindow = cw;
     InitializeComponent();
     DeadlineDate.SelectedDate = DateTime.Today;
     CurPr = pr;
     SerialNumber.Text = (CurPr.Events.Count + 1).ToString();
     if (cw == CurrentWindow.AddEvent)
     {
         OK.Content = "Додати";
         FileControl.IsEnabled = false;
     }
     else
     {
         EventNumber = evnum;
         OK.Content = "Зберегти";
         DeadlineDate.SelectedDate = CurPr.Events[EventNumber].DeadLine;
         Name.Text = CurPr.Events[EventNumber].Title;
         Description.Text = CurPr.Events[EventNumber].Description;
         SerialNumber.Text = CurPr.Events[EventNumber].SerialNumber.ToString();
     }
 }
Exemplo n.º 40
0
        public WorkWithLabs()
        {
            InitializeComponent();
            cw = (App.Current as App).CurrentPage;
            DataGridTextColumn col = new DataGridTextColumn();
            col = new DataGridTextColumn();
            col.Header = "Ім'я";
            col.Width = new DataGridLength(250);
            col.Binding = new Binding("FullName");
            StudentGrid.Columns.Add(col);
            col = new DataGridTextColumn();
            col.Header = "Залікова книжка";
            col.Width = new DataGridLength(100);
            col.Binding = new Binding("RecordBookNumber");
            StudentGrid.Columns.Add(col);
            col = new DataGridTextColumn();
            col.Header = "Група";
            col.Width = new DataGridLength(100);
            col.Binding = new Binding("Group");
            StudentGrid.Columns.Add(col);
            col = new DataGridTextColumn();
            col.Header = "Факультет";
            col.Width = new DataGridLength(100);
            col.Binding = new Binding("Faculty");
            StudentGrid.Columns.Add(col);

            col = new DataGridTextColumn();
            col.Header = "№";
            col.Width = new DataGridLength(30);
            col.Binding = new Binding("ID");
            ProjectsGrid.Columns.Add(col);
            col = new DataGridTextColumn();
            col.Header = "Назва";
            col.Width = new DataGridLength(250);
            col.Binding = new Binding("Name");
            ProjectsGrid.Columns.Add(col);
            col = new DataGridTextColumn();
            col.Header = "Опис";
            col.Width = new DataGridLength(400);
            col.Binding = new Binding("Description");
            ProjectsGrid.Columns.Add(col);
            col = new DataGridTextColumn();
            col.Header = "Дедлайн";
            col.Width = new DataGridLength(120);
            col.Binding = new Binding("Deadline");
            ProjectsGrid.Columns.Add(col);
//            col = new DataGridTextColumn();
//            col.Header = "Телефон";
//            col.Width = new DataGridLength(250);
//            col.Binding = new Binding("PhoneNumber");
//            StudentGrid.Columns.Add(col);
            Projects.IsEnabled = false;
            col = new DataGridTextColumn();
            col.Header = "№";
            col.Width = new DataGridLength(30);
            col.Binding = new Binding("ID");
            EventsGrid.Columns.Add(col);
            col = new DataGridTextColumn();
            col.Header = "Назва";
            col.Width = new DataGridLength(250);
            col.Binding = new Binding("Name");
            EventsGrid.Columns.Add(col);
            col = new DataGridTextColumn();
            col.Header = "Дедлайн";
            col.Width = new DataGridLength(120);
            col.Binding = new Binding("Deadline");
            EventsGrid.Columns.Add(col);
//            UpdateProjects();
            Events.IsEnabled = false;
            UpdateStudents();
        }
        public AddProjectWindow(CurrentWindow cw, Project pr = null)
        {
            InitializeComponent();
            _currentWindow = cw;
            proj = pr;
            // TODO добавить для курсовіх, діпломніх
            switch (_currentWindow)
            {
                case CurrentWindow.CreateLab:
                    this.Title = "Створення лабораторних робіт";
                    GreyName.Text = "Назва лабораторної роботи";
                    break;

                case CurrentWindow.CreateRgr:
                    this.Title = "Створення РГР";
                    GreyName.Text = "Назва розрахункової роботи";
                    break;

                case CurrentWindow.EditRgr:
                    this.Title = "Редагування РГР";
                    break;
                case CurrentWindow.EditLab:
                    this.Title = "Редагування лабораторних робіт";
                    break;
            }
            if(cw == CurrentWindow.CreateLab || cw == CurrentWindow.CreateRgr)
                treeView1.ItemsSource = TreeViewModel.SetTree();
            else if (cw == CurrentWindow.EditLab || cw == CurrentWindow.EditRgr)
                treeView1.ItemsSource = TreeViewModel.SetTree(true, pr);
            Configuration config = (App.Current as App).config;
            TcpClient eClient = new TcpClient();
            try
            {
                eClient = new TcpClient(config.IP.ToString(), config.Port);
                using (NetworkStream writerStream = eClient.GetStream())
                {
                    MSG message = new MSG();
                    message.stat = STATUS.GET_SUBJECTS;
                    BinaryFormatter formatter = new BinaryFormatter();
                    formatter.Serialize(writerStream, message);
                    bool fl = (bool)formatter.Deserialize(writerStream);
                    if (fl)
                    {
                        _subjectsCollection = (Dictionary<string, int>) formatter.Deserialize(writerStream);
                        foreach (var subject in _subjectsCollection)
                            Subject.Items.Add(subject.Key);
                    }
                   
                    else
                    {
                        // TODO возможен баг из-за закрытия в конструкторе
                        MessageBox.Show("Помилка з'єднання з сервером");
                        this.Close();
                    }
                    if (_currentWindow == CurrentWindow.EditLab || _currentWindow == CurrentWindow.EditRgr)
                    {
                        try
                        {
                            Subject.SelectedItem = proj.Subject;
                            
                        }
                        catch (Exception)
                        {
                            if(Subject.Items.Count > 0)
                                Subject.SelectedIndex = 0;
                        }
                        Name.Text = proj.Theme;
                        FlowDocument document = new FlowDocument();
                        Paragraph paragraph = new Paragraph();
                        paragraph.Inlines.Add(new Bold(new Run(proj.Description)));
                        document.Blocks.Add(paragraph);
                        Description.Document = document;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                eClient.Close();
            }
        }