Exemplo n.º 1
0
 private void BarcodeManualEntryPage_Return(object sender, ReturnEventArgs <PageFunctionResult> e)
 {
     if (e.Result.PageNavigationDirectionEnum == YellowstonePathology.UI.Navigation.PageNavigationDirectionEnum.Next)
     {
         OnReturn(new ReturnEventArgs <PageFunctionResult>(e.Result));
     }
 }
Exemplo n.º 2
0
        private void ReturnItem()
        {
            var returnObject = new ReturnEventArgs <Data.LiftItem>(Item);

            // Call onreturn method
            OnReturn(returnObject);
        }
Exemplo n.º 3
0
 private void Page_Return(object sender, ReturnEventArgs <Type> e)
 {
     if (e.Result == typeof(CaseDocumentsPage))
     {
         this.ShowCaseDocumentsPage();
     }
     else if (e.Result == typeof(LeukemiaLymphomaGatingPage))
     {
         this.ShowLeukemiaLymphomaGatingPage();
     }
     else if (e.Result == typeof(LeukemiaLymphomaMarkersPage))
     {
         this.ShowLeukemiaLymphomaMarkersPage();
     }
     else if (e.Result == typeof(LeukemiaLymphomaResultPage))
     {
         this.ShowLeukemiaLymphomaResultPage();
     }
     else if (e.Result == typeof(CaseFinalPage))
     {
         this.ShowCaseFinalPage();
     }
     else if (e.Result == typeof(LeukemiaLymphomaReportPage))
     {
         LeukemiaLymphomaReportPage leukemiaLymphomaReportPage = new LeukemiaLymphomaReportPage(this.m_FlowAccessionCollection[0].PanelSetOrderCollection[0].ReportNo, this.m_FlowAccessionCollection[0].MasterAccessionNo);
         this.SetReportPageReturn(leukemiaLymphomaReportPage, sender);
         ApplicationNavigator.ApplicationContentFrame.NavigationService.Navigate(leukemiaLymphomaReportPage);
     }
     else if (e.Result == typeof(PathologistSignoutPage))
     {
         Save(this.m_FlowAccessionCollection);
         OnReturn(null);
     }
 }
Exemplo n.º 4
0
 void ConfigPageReturn(object sender, ReturnEventArgs <bool> e)
 {
     if (e.Result)
     {
         _viewModel.ExecuteCommand.Execute(_viewModel.SelectedCommand);
     }
 }
Exemplo n.º 5
0
 private void OnPageReturn(object sender, ReturnEventArgs <WizardResult> e)
 {
     if (DialogResult == null)
     {
         DialogResult = (e.Result == WizardResult.Finished);
     }
 }
 void controller_Return(object sender, ReturnEventArgs<SurveyResult> e)
 {
     SurveyResult result = e.Result;
     lblAnsQ1.Content = result.QuestionOne;
     lblAnsQ2.Content = result.QuestionTwo;
     lblAnsQ3.Content = result.QuestionThree;
 }
 void DirPageOnReturn(object sender, ReturnEventArgs <DirectoryInfo> e)
 {
     if (e.Result != null)
     {
         txtboxFavoriteDir.Text = e.Result.FullName;
     }
 }
Exemplo n.º 8
0
 void pageFonction_Return(object sender, ReturnEventArgs <string> e)
 {
     if (e != null)
     {
         lblMsg.Text = "Valeur de retour : " + e.Result;
     }
 }
        void stationInfoPage_Return(object sender, ReturnEventArgs <stationInfo> e)
        {
            if (e.Result == null)
            {
                return;
            }
            if (e.Result.Modify == true)
            {
                dataAccess.updateStation(lines[e.Result.LineIndex].ID, e.Result.ID, e.Result.Name, e.Result.CycleTime, e.Result.BottleNeckTime);
                lines[e.Result.LineIndex].Stations[e.Result.ItemIndex].Name           = e.Result.Name;
                lines[e.Result.LineIndex].Stations[e.Result.ItemIndex].CycleTime      = e.Result.CycleTime;
                lines[e.Result.LineIndex].Stations[e.Result.ItemIndex].BottleNeckTime = e.Result.BottleNeckTime;

                lineControl.dgItem.SelectedIndex = e.Result.LineIndex;
            }
            else
            {
                Station station = new Station(lines[e.Result.LineIndex].ID, e.Result.ID, e.Result.Name, e.Result.CycleTime,
                                              e.Result.BottleNeckTime);


                lines[e.Result.LineIndex].Stations.Add(station);

                dataAccess.addStation(lines[e.Result.LineIndex].ID, station.ID, station.Name, station.CycleTime);
                lineControl.dgItem.SelectedIndex = e.Result.LineIndex;
            }
            stationControl.dgItem.SelectedIndex = -1;
            stationControl.btnAdd.Focus();
        }
Exemplo n.º 10
0
 protected override void OnReturn(ReturnEventArgs <BuildProject> e)
 {
     if (ReturnTemp != null)
     {
         ReturnTemp(this, e);
     }
 }
Exemplo n.º 11
0
        void dataEntryPage_Return(object sender, ReturnEventArgs <WizardContext> e)
        {
            WizardContext dataEntryWizardContext = (WizardContext)e.Result;

            // Cancel Wizard if data entry page was canceled
            if (dataEntryWizardContext.Result == WizardResult.Canceled)
            {
                OnReturn(new ReturnEventArgs <WizardContext>(new WizardContext(WizardResult.Canceled, null)));
                return;
            }

            // Organize navigation direction
            if ((WizardNavigationDirection)dataEntryWizardContext.Data == WizardNavigationDirection.Forwards)
            {
                this.navigationOrder.Add((PageFunction <WizardResult>) new WizardPage1(this.WizardData));
                this.navigationOrder.Add((PageFunction <WizardResult>) new WizardPage2(this.WizardData));
                this.navigationOrder.Add((PageFunction <WizardResult>) new WizardPage3(this.WizardData));
            }
            else
            {
                this.navigationOrder.Add((PageFunction <WizardResult>) new WizardPage3(this.WizardData));
                this.navigationOrder.Add((PageFunction <WizardResult>) new WizardPage2(this.WizardData));
                this.navigationOrder.Add((PageFunction <WizardResult>) new WizardPage1(this.WizardData));
            }

            // Navigate to first page
            this.navigationOrder[0].Return += NavigationHub_Return;
            NavigationWindow host = (NavigationWindow)Application.Current.MainWindow;

            host.Navigate(this.navigationOrder[0]);
        }
Exemplo n.º 12
0
        private void btnBack_Click(object sender, RoutedEventArgs e)
        {
            var returnObject = new ReturnEventArgs <Data.Options>(internalData.Options);

            // Call onreturn method
            OnReturn(returnObject);
        }
Exemplo n.º 13
0
 public void OnReturnEx(ReturnEventArgs <WizardResult> e)
 {
     if (ReturnEx != null)
     {
         ReturnEx.Invoke(this, e);
     }
 }
Exemplo n.º 14
0
 private void Pf_Return(object sender, ReturnEventArgs <string> e)
 {
     if (e == null)
     {
         return;
     }
     this.SelectedContent.Text = e.Result;
 }
Exemplo n.º 15
0
 void GetStringPageFunction_Returned(object sender, ReturnEventArgs <String> e)
 {
     // Get the result, if a result was passed.
     if (e.Result != null)
     {
         Console.WriteLine(e.Result);
     }
 }
Exemplo n.º 16
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void wizardPage_Return(object sender, ReturnEventArgs <WizardResult> e)
        {
            CancelBackup();

            // If returning, wizard was completed (finished or canceled),
            // so continue returning to calling page
            OnReturn(e);
        }
 private void SelectProductPageFunction_Returned(object sender,
                                                 ReturnEventArgs <Product> e)
 {
     if (e != null)
     {
         lblStatus.Content = "You chose: " + e.Result?.Name;
     }
 }
Exemplo n.º 18
0
        ///<summary>
        /// Notify client that connection dialog has completed.
        ///</summary>
        ///<param name="sender"></param>
        ///<param name="e"></param>
        ///<remarks>We need this custom event because the Return event cannot be registered by window code - if ConnectionDialog registers an event handler with the ConnectionLauncher's Return event, the event is not raised.</remarks>
        public void connectionPage_Return(object sender, ReturnEventArgs <ConnectionResult> e)
        {
            if (ConnectionReturn != null)
            {
                ConnectionReturn(this, new ConnectionReturnEventArgs(e.Result, _connectionData));
            }

            OnReturn(null);
        }
Exemplo n.º 19
0
 public void wizardPage_Return(object sender, ReturnEventArgs <WizardResult> e)
 {
     // Notify client that wizard has completed
     // NOTE: We need this custom event because the Return event cannot be
     // registered by window code - if WizardDialogBox registers an event handler with
     // the WizardLauncher's Return event, the event is not raised.
     WizardReturn?.Invoke(this, new WizardReturnEventArgs(e.Result, _wizardData));
     OnReturn(null);
 }
Exemplo n.º 20
0
        private void handlePageFunctionInput(object sender, ReturnEventArgs <string> e)
        {
            string stringReturned = (string)e.Result;

            if (stringReturned != null)
            {
                textBox.Text = stringReturned;
            }
        }
Exemplo n.º 21
0
 private void ChooseBluetoothDevice_Return(object sender, ReturnEventArgs <object> e) => Task.Run(() =>
 {
     var svc = e.Result as RfcommDeviceService;
     if (svc == null)
     {
         return;
     }
     var addr           = BluetoothUtils.RequestAddContact(svc, App.Instance.Address);
     App.AddContactData = new { Address = addr.Value, Name = $"Bluetooth device '{svc.ConnectionHostName.DisplayName}'" };
     Dispatcher.Invoke(addr == null ? new Action(() => MessageBox.Show(Application.Current.MainWindow, $"'{svc.ConnectionHostName.DisplayName}' rejected your contact request.")) : new Action(() => NavigationService.Navigate(new Uri("/Views/AddContact.xaml", UriKind.Relative))));
 });
Exemplo n.º 22
0
 void settingsPage_Return(object sender, ReturnEventArgs <settings> e)
 {
     dataAccess = new DataAccess();
     dataAccess.updateMarquee(e.Result.Marquee);
     dataAccess.updateMarqueeSpeed(e.Result.MarqueeSpeed);
     dataAccess.updateIssuemarqueeSpeed(e.Result.IssuemarqueeSpeed);
     dataAccess.updateEscalationSettings(e.Result.EscalationSettings);
     if (e.Result.Password != dataAccess.getPassword())
     {
         dataAccess.updatePassword(e.Result.Password);
     }
 }
        void pf_Return(object sender, ReturnEventArgs<Employee> e)
        {
            //throw new NotImplementedException();
            if (e.Result.YesOrNo)
            {
                textYesOrNo.Text = "Yes";
            }
            else
            {
                textYesOrNo.Text = "No";

            }
        }
Exemplo n.º 24
0
        //</SnippetPassingDataCODEBEHIND2>
        //</SnippetSendDataCODEBEHIND2>
        void pageFunction_Return(object sender, ReturnEventArgs <string> e)
        {
            this.pageFunctionResultsTextBlock.Visibility = Visibility.Visible;

            // Display result
            this.pageFunctionResultsTextBlock.Text = (e != null ? "Accepted" : "Canceled");

            // If page function returned, display result and data
            if (e != null)
            {
                this.pageFunctionResultsTextBlock.Text += "\n" + e.Result;
            }
        }
        void nextPage_Return(object sender, ReturnEventArgs <lineInfo> e)
        {
            if (e.Result == null)
            {
                return;
            }

            line line = new line(e.Result.ID, e.Result.Name);

            lines.Add(line);

            dataAccess.addLine(e.Result.ID, e.Result.Name);
            lineControl.dgItem.SelectedIndex = -1;
        }
        void classInfoPage_QReturn(object sender, ReturnEventArgs <classInfo> e)
        {
            if (e.Result == null)
            {
                return;
            }

            Class Class = new Class(2, e.Result.ID, e.Result.Name);

            lines[e.Result.LineIndex].Stations[e.Result.StationIndex].QualityClass.Add(Class);

            dataAccess.addClass(lines[e.Result.LineIndex].ID, lines[e.Result.LineIndex].Stations
                                [e.Result.StationIndex].ID, 2, e.Result.ID, e.Result.Name);
            qualityControl.dgItem.SelectedIndex = -1;
        }
Exemplo n.º 27
0
        /// <summary>
        ///  Determine how the task completed and, if accepted, process the collected task state
        /// </summary>
        public void task_Return(object sender, ReturnEventArgs <TaskContext> e)
        {
            // Get task state
            TaskContext taskContext = e.Result;

            this.taskResultsTextBlock.Visibility = Visibility.Visible;

            // How did the task end?
            this.taskStateTextBlock.Text = taskContext.Result.ToString();

            // If the task completed by being accepted, display task data
            if (taskContext.Result == TaskResult.Finished)
            {
                this.taskStateTextBlock.Text += "\nData Item: " + ((TaskData)taskContext.Data).DataItem;
            }
        }
Exemplo n.º 28
0
 private void DocumentScanPage_Return(object sender, ReturnEventArgs <PageFunctionResult> e)
 {
     if (e.Result.PageNavigationDirectionEnum == YellowstonePathology.UI.Navigation.PageNavigationDirectionEnum.Back)
     {
         PageFunctionResult result = new PageFunctionResult(false, YellowstonePathology.UI.Navigation.PageNavigationDirectionEnum.Back, null);
         OnReturn(new ReturnEventArgs <PageFunctionResult>(result));
     }
     else
     {
         if (e.Result.Success == true)
         {
             this.ReceiveCaseDocument(e.Result.Data.ToString());
             PageFunctionResult result = new PageFunctionResult(true, YellowstonePathology.UI.Navigation.PageNavigationDirectionEnum.Next, null);
             OnReturn(new ReturnEventArgs <PageFunctionResult>(result));
         }
     }
 }
Exemplo n.º 29
0
        void ShiftInfo_Return(object sender, ReturnEventArgs <shiftInfo> e)
        {
            if (e.Result == null)
            {
                return;
            }

            Shift Shift = new Shift();

            Shift.Name      = e.Result.Name;
            Shift.StartTime = e.Result.StartTime;
            Shift.EndTime   = e.Result.EndTime;

            dataAccess.addShift(e.Result.Name, e.Result.StartTime, e.Result.EndTime);
            Shifts.Add(Shift);
            shiftControl.dgItem.SelectedIndex = -1;
            shiftControl.btnAdd.Focus();
        }
Exemplo n.º 30
0
        private void OnFuncReturn(object sender, ReturnEventArgs <string> evtargs)
        {
            SolidColorBrush brush = null;

            if (evtargs == null)
            {
                brush = m_cancelBrush;
                lblDisplay.Content = "Canceled";
            }
            else
            {
                brush = m_okBrush;
                lblDisplay.Content = evtargs.Result;
            }

            lblDisplay.BorderBrush = brush;
            lblDisplay.Foreground  = brush;
        }
Exemplo n.º 31
0
        /// <summary>
        ///  Determine how the Wizard completed and, if accepted, process the collected Wizard state
        /// </summary>
        public void navigationHub_Return(object sender, ReturnEventArgs <WizardContext> e)
        {
            // Get Wizard state
            WizardContext WizardContext = e.Result;

            this.WizardResultsTextBlock.Visibility = Visibility.Visible;

            // How did the Wizard end?
            this.WizardResultsTextBlock.Text = WizardContext.Result.ToString();

            // If the Wizard completed by being accepted, display Wizard data
            if (WizardContext.Result == WizardResult.Finished)
            {
                this.WizardResultsTextBlock.Text += "\nData Item 1: " + ((WizardData)WizardContext.Data).DataItem1;
                this.WizardResultsTextBlock.Text += "\nData Item 2: " + ((WizardData)WizardContext.Data).DataItem2;
                this.WizardResultsTextBlock.Text += "\nData Item 3: " + ((WizardData)WizardContext.Data).DataItem3;
            }
        }
Exemplo n.º 32
0
        void SessionInfo_Return(object sender, ReturnEventArgs <sessionInfo> e)
        {
            if (e.Result == null)
            {
                return;
            }

            Session Session = new Session(
                Shifts[e.Result.ShiftIndex].ID, Shifts[e.Result.ShiftIndex].Sessions.Count + 1,
                e.Result.Name, e.Result.StartTime, e.Result.EndTime);

            Shifts[e.Result.ShiftIndex].Sessions.Add(Session);

            dataAccess.addSession(Shifts[e.Result.ShiftIndex].ID, Shifts[e.Result.ShiftIndex].Sessions.Count + 1,
                                  e.Result.Name, e.Result.StartTime, e.Result.EndTime);
            shiftControl.dgItem.SelectedIndex   = e.Result.ShiftIndex;
            sessionControl.dgItem.SelectedIndex = -1;
            sessionControl.btnAdd.Focus();
        }
Exemplo n.º 33
0
        void _usluga_Return(object sender, ReturnEventArgs<object> e)
        {
            if (e != null)
            {
                Baza.Usluga _usluga = (Baza.Usluga)e.Result;

                IQueryable<Baza.Usluga> _upit = (from p in LavAutoDataContext.Uslugas
                                                 where p.Usluga_ID == _usluga.Usluga_ID
                                                 select p).Take(1);

                try
                {
                    ObservableCollection<Baza.Usluga> _lista = new ObservableCollection<Baza.Usluga>(_upit.ToArray());
                    textBoxUsluga.Tag = _lista.First();

                    textBoxUslugaCenaBezPoreza.Text = (_lista.First().Bod.Vrednost * _lista.First().BrojBodova).ToString("##.00").ToString(CultureInfo.CurrentCulture);

                    comboBoxUslugaPoreskaStopaLista.SelectedItem = _lista.First().PoreskaStopa;

                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Greška pri čitanju podataka", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Exemplo n.º 34
0
        private void JMPScriptSelect_ReturnMsg(object sender, ReturnEventArgs e)
        {
            if (e.intMsg == 0) return;

            #region *** Variable define ***
            int ColumnsCount = tblData.Columns.Count;
            int RowCount = tblData.Rows.Count;

            int[] SelectedColumns;

            string Directory;
            string fileName;
            string scriptPath = "Normal";

            int handler;
            JMP.Document doc;
            JMP.DataTable dt;
            JMP.DataTable subdt;
            JMP.DataTable stackdt;
            JMP.TextImport ti;
            JMP.Distribution dist;

            object[] objParameter = new object[800];

            //TabPage tabDistribution = (TabPage)this.FindControl(tabcontrol, strDistributionTabName);
            //ListBox lbxSelected = (ListBox)this.FindControl(tabDistribution, "lbxSelected");

            #endregion *** Variable define ***

            #region *** Fill Parameter ***
            int ParameterCount = tblData.Columns.Count - _DataParse.FreezeColumn - 1;
            Parameter = new string[ParameterCount + 1];

            for (int i = 0; i <= ParameterCount; i++)
            {
                Parameter[i] = tblData.Rows[0][i + _DataParse.FreezeColumn].ToString();
            }

            #endregion *** Fill Parameter ***

            #region *** Build JMP DataTable ***

            QuitJMP();

            lblBar.Text = "Caculating the Distribution ...";
            Directory = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
            fileName = Directory + @"\Temp\JMP.csv";

            SelectedColumns = new int[Parameter.Length];
            for (int i = 0; i < Parameter.Length; i++)
            {
                SelectedColumns[i] = Array.IndexOf(Parameter, Parameter[i]) + _DataParse.FreezeColumn;
            }
            _Export.DataTableToCsvForJMP(fileName, tblData, SelectedColumns);

            startJMP();

            ti = myJMP.CreateTextImportObject(fileName, RowCount - 3);
            ti.SetEndOfFieldOptions(JMP.jmpTIEndOfFieldConstants.tiComma);
            ti.SetEndOfLineOptions(JMP.jmpTIEndOfLineConstants.tiCRLF);
            //ti.ColumnNamesStart(0);
            ti.FirstLineIsData(false);
            doc = ti.OpenFile();
            doc.Name = "Raw";
            dt = doc.GetDataTable();

            ColumnsCount = dt.NumberColumns;
            RowCount = dt.NumberRows;

            dt.Visible = false;
            dt.Activate();

            if (e.strMsg.ToLower().Contains("stack"))
            {
                foreach (string strParameter in Parameter)
                {
                    if (strParameter != "Status")
                        dt.AddToStackList(strParameter);
                }
                dt.SetStackOptions(false, true, false);
                stackdt = dt.Stack("Parameter", "Data", "Stack");

                dt.Visible = false;
                stackdt.Visible = false;
                stackdt.Activate();
            }

            #endregion *** Build JMP DataTable ***

            #region *** Build Distribution Graph ***

            if (e.strMsg.ToLower() == "normal")
            {
                //dt.Visible = true;
                scriptPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Temp\dist.jsl";

                Array.Copy(Parameter, objParameter, Parameter.Length - 1);
                _Analysis.BuildJMPScript(scriptPath, objParameter, true);
            }
            else
            {
                scriptPath = Application.StartupPath + @".\Script\" + e.strMsg + ".jsl";
                scriptPath = Path.GetFullPath(scriptPath);
            }

            myJMP.RunJSLFile(scriptPath);

            #endregion *** Build Distribution Graph ***

            lblBar.Text = "Done";
            this.WindowState = FormWindowState.Minimized;
            //myJMP.CloseWindowsOfType(JMP.jmpWindowTypeConstants.jmpDatatables);
            //myJMP.CloseWindowsOfType(JMP.jmpWindowTypeConstants.jmpJSLOutputFiles);
        }
Exemplo n.º 35
0
 void function_Return(object sender, ReturnEventArgs<string> e)
 {
     
 }
Exemplo n.º 36
0
		private void PageFunction_Return(object sender, ReturnEventArgs<string> e)
		{
			MessageBox.Show(e.Result);
		}
Exemplo n.º 37
0
 private void AddUser(object sender, ReturnEventArgs<string> e)
 {
     var username = e.Result;
     ExistingUser(username, _users);
 }
 private void LeukemiaLymphomaReportPage_Return(object sender, ReturnEventArgs<Type> e)
 {
 }
Exemplo n.º 39
0
 void _ponudaWizard2_Return(object sender, ReturnEventArgs<string> e)
 {
     //throw new NotImplementedException();
 }
Exemplo n.º 40
0
 void OnSettingsPageFunctionReturned(object sender, ReturnEventArgs<string> e)
 {
     if (e.Result != null)
     {
         dictionaryToUse = e.Result;
     }
 }
Exemplo n.º 41
0
 private void SelectProductPageFunction_Returned(object sender,
   ReturnEventArgs<Product> e)
 {
     if (e != null) lblStatus.Content = "You chose: " + e.Result.Name;
 }
Exemplo n.º 42
0
        void _pretragaFizickoLice_Return(object sender, ReturnEventArgs<object> e)
        {
            if (e != null)
            {
                Baza.FizickoLice _fizickoLice = (Baza.FizickoLice)e.Result;

                ObservableCollection<Baza.FizickoLice> _lista = new ObservableCollection<Baza.FizickoLice>();
                _lista.Add(_fizickoLice);

                textBoxFizickoLicePretraga.Tag = _lista.First();
            }
        }
 private void LeukemiaLymphomaSignoutPage_Return(object sender, ReturnEventArgs<bool> e)
 {
 }
Exemplo n.º 44
0
 void DirPageOnReturn(object sender, ReturnEventArgs<DirectoryInfo> args)
 {
     if (args.Result != null)
         txtboxFavoriteDir.Text = args.Result.FullName;
 }
Exemplo n.º 45
0
        void _servisnaKnjizica_Return(object sender, ReturnEventArgs<object> e)
        {
            if (e != null)
            {
                Baza.ServisnaKnjizica _servisnaKnjizica = (Baza.ServisnaKnjizica)e.Result;

                IQueryable<Baza.ServisnaKnjizica> _upit = (from p in LavAutoDataContext.ServisnaKnjizicas
                                                           where p.ServisnaKnjizica_ID == _servisnaKnjizica.ServisnaKnjizica_ID
                                                           select p).Take(1);

                try
                {
                    ObservableCollection<Baza.ServisnaKnjizica> _lista = new ObservableCollection<Baza.ServisnaKnjizica>(_upit.ToArray());
                    textBoxServisnaKnjizica.Tag = _lista.First();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Greška pri čitanju podataka", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Exemplo n.º 46
0
        void _artikal_Return(object sender, ReturnEventArgs<object> e)
        {
            if (e != null)
            {
                int _vezaArtikalDobavljac_ID = -1;
                int _artikal_ID = -1;
                string _dobavljac = "";
                decimal _cenaBezPoreza = -1;
                int _poreskaStopa_ID = -1;
                int _poreskaStopaVrednost = -1;
                decimal _cenaSaPorezom = -1;
                DateTime _datumAzuriranja = DateTime.Now;
                int _kolicinaNaStanju = -1;

                System.Reflection.PropertyInfo[] myPropertyInfo = e.Result.GetType().GetProperties();

                for (int i = 0; i < myPropertyInfo.Length; i++)
                {
                    switch (myPropertyInfo[i].Name.ToString())
                    {
                        case "VezaArtikalDobavljac_ID":
                            _vezaArtikalDobavljac_ID = (int)myPropertyInfo[i].GetValue(e.Result, null);
                            break;

                        case "Artikal_ID":
                            _artikal_ID = (int)myPropertyInfo[i].GetValue(e.Result, null);
                            break;
                        case "Dobavljac":
                            _dobavljac = myPropertyInfo[i].GetValue(e.Result, null).ToString();
                            break;
                        case "CenaBezPoreza":
                            _cenaBezPoreza = (decimal)myPropertyInfo[i].GetValue(e.Result, null);
                            break;
                        case "PoreskaStopa_ID":
                            _poreskaStopa_ID = (int)myPropertyInfo[i].GetValue(e.Result, null);
                            break;
                        case "PoreskaStopaVrednost":
                            _poreskaStopaVrednost = (int)myPropertyInfo[i].GetValue(e.Result, null);
                            break;
                        case "CenaSaPorezom":
                            _cenaSaPorezom = (decimal)myPropertyInfo[i].GetValue(e.Result, null);
                            break;
                        case "DatumAzuriranja":
                            _datumAzuriranja = (DateTime)myPropertyInfo[i].GetValue(e.Result, null);
                            break;
                        case "KolicinaNaStanju":
                            _kolicinaNaStanju = (int)myPropertyInfo[i].GetValue(e.Result, null);
                            break;
                        default:
                            throw new Exception("Greska pri citanju podataka o dobavljacima (_artikal_Return)");
                    }
                }

                IQueryable<Baza.VezaArtikalDobavljac> _upitVezaArtikalDobavljac = (from p in LavAutoDataContext.VezaArtikalDobavljacs
                                                                                   where p.VezaArtikalDobavljac_ID == _vezaArtikalDobavljac_ID
                                                                                   select p).Take(1);

                ObservableCollection<Baza.VezaArtikalDobavljac> _listaVezaArtikalDobavljac = null;
                try
                {
                    _listaVezaArtikalDobavljac = new ObservableCollection<Baza.VezaArtikalDobavljac>(_upitVezaArtikalDobavljac.ToList());
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Greška pri čitanju podataka", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }

                Baza.StavkaUsluga _trenutniStavkaUsluga = (Baza.StavkaUsluga)gridStavkaDetaljno.DataContext;

                ObservableCollection<Baza.StavkaArtikal> _listaStavkaArtikal = (ObservableCollection<Baza.StavkaArtikal>)listBoxStavkaArtikalLista.ItemsSource;

                foreach (Baza.StavkaArtikal item in _listaStavkaArtikal)
                {
                    if (item.VezaArtikalDobavljac_ID == _listaVezaArtikalDobavljac.First().VezaArtikalDobavljac_ID)
                    {
                        MessageBox.Show("Artikal dobavljača koji ste pokušali da dodate u dokumentu već postoji", "Greška pri dodavanju artikla dobavljača", MessageBoxButton.OK, MessageBoxImage.Error);
                        return;
                    }
                }

                Baza.StavkaArtikal _novaStavkaArtikal = new Baza.StavkaArtikal();

                _novaStavkaArtikal.VezaArtikalDobavljac = _listaVezaArtikalDobavljac.First();
                _novaStavkaArtikal.StavkaUsluga = _trenutniStavkaUsluga;
                _novaStavkaArtikal.ArtikalCenaBezPoreza = _listaVezaArtikalDobavljac.First().CenaBezPoreza;
                _novaStavkaArtikal.ArtikalKolicina = 1;
                _novaStavkaArtikal.ArtikalPoreskaStopa_ID = _listaVezaArtikalDobavljac.First().Artikal.PoreskaStopa_ID;

                _listaStavkaArtikal.Add(_novaStavkaArtikal);

                //foreach (Baza.StavkaArtikal item in _listaStavkaArtikal)
                //{
                //    MessageBox.Show(item.StavkaUsluga.StavkaUsluga_ID.ToString());
                //}


                //listBoxStavkaUslugaLista.SelectedItem = _novaStavkaArtikal;


                //IQueryable<Baza.Artikal> _upit = (from p in LavAutoDataContext.Artikals
                //                                  where p.Artikal_ID == _artikal_ID
                //                                  select p).Take(1);

                //try
                //{
                //    ObservableCollection<Baza.Artikal> _lista = new ObservableCollection<Baza.Artikal>(_upit.ToArray());
                //    textBoxArtikal.Tag = _lista.First();
                //}
                //catch (Exception ex)
                //{
                //    MessageBox.Show(ex.Message, "Greška pri čitanju podataka", MessageBoxButton.OK, MessageBoxImage.Error);
                //}

                //textBoxArtikalCenaBezPoreza.Text = _cenaBezPoreza.ToString(CultureInfo.CurrentCulture);

                //if (!comboBoxArtikalPoreskaStopaLista.Items.Count.Equals(0))
                //{
                //    comboBoxArtikalPoreskaStopaLista.SelectedItem = _upit.First().PoreskaStopa;
                //}
            }
        }
Exemplo n.º 47
0
        void _pretragaPoslovniPartner_Return(object sender, ReturnEventArgs<object> e)
        {
            if (e != null)
            {
                Baza.PoslovniPartner _poslovniPartner = (Baza.PoslovniPartner)e.Result;

                ObservableCollection<Baza.PoslovniPartner> _lista = new ObservableCollection<Baza.PoslovniPartner>();
                _lista.Add(_poslovniPartner);

                textBoxPoslovniPartnerPretraga.Tag = _lista.First();
            }
        }
Exemplo n.º 48
0
 void _strana2_Return(object sender, ReturnEventArgs<String> e)
 {
     string _s = e.Result;
 }