Ejemplo n.º 1
0
        private async void LoadingModelComplete(object sender, RunWorkerCompletedEventArgs e)
        {
            if (workingConn)
            {
                FacilityDataMDataSet.ViewZipCodeList    = FacilityDataMDataSet.FullZipCodeList.Select(a => a.DataZC).ToList();
                FacilityDataMDataSet.ViewSettlementList = FacilityDataMDataSet.FullSettlementList.Select(a => a.DataS).ToList();
                temp.Insert(0, new FacilityDataMDataSet.Company
                {
                    ID   = 0,
                    Name = "Új Intézmény felvétele"
                });
                FacilityDataMDataSet.Companies = temp;
                FacilityDataMViewElements.AcceptChanges();

                if (GlobalVM.GlobalM.CompanyId != null)
                {
                    FacilityDataMDataSet.SelectedCompany = FacilityDataMDataSet.Companies.Where(a => a.ID == Convert.ToInt32(GlobalVM.GlobalM.CompanyId)).Single();
                }
                else
                {
                    FacilityDataMDataSet.SelectedCompany = FacilityDataMDataSet.Companies.Where(a => a.ID == 0).Single();
                }
            }
            else
            {
                ConnectionMessage();
            }

            await Utilities.Loading.Hide();
        }
Ejemplo n.º 2
0
        private void ExecuteCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (workingConn)
            {
                string temp;

                if (FacilityDataMDataSet.SelectedCompany.ID.Equals(0))
                {
                    Loading.RunWorkerAsync();
                    temp = "rögzítettük";
                }
                else
                {
                    temp = "módosítottuk";
                }

                dialog         = new Dialog(false, "Intézmény adatai", async() => await Utilities.Loading.Hide());
                dialog.content = new TextBlock("Sikeresen " + temp + " az adatokat.");
                dialog.Start();

                FacilityDataMViewElements.AcceptChanges();
            }
            else
            {
                ConnectionMessage();
            }
        }
Ejemplo n.º 3
0
 protected internal FacilityDataVM()
 {
     FacilityDataMViewElements = new FacilityDataMViewElements();
     FacilityDataMDataSet      = new FacilityDataMDataSet();
     ZipCodeSearch             = new BackgroundWorker();
     ZipCodeSearch.DoWork     += new DoWorkEventHandler(ZipCodeDoWork);
     SettlementSearch          = new BackgroundWorker();
     SettlementSearch.DoWork  += new DoWorkEventHandler(SettlementDoWork);
     Loading                     = new BackgroundWorker();
     Loading.DoWork             += new DoWorkEventHandler(LoadingModel);
     Loading.RunWorkerCompleted += new RunWorkerCompletedEventHandler(LoadingModelComplete);
     Refresh                     = new BackgroundWorker();
     Refresh.DoWork             += new DoWorkEventHandler(RefreshModel);
     Refresh.RunWorkerCompleted += new RunWorkerCompletedEventHandler(RefreshModelComplete);
     Loading.RunWorkerAsync();
 }
Ejemplo n.º 4
0
 private void RefreshModelComplete(object sender, RunWorkerCompletedEventArgs e)
 {
     if (workingConn)
     {
         if (!FacilityDataMDataSet.SelectedCompany.ID.Equals(0))
         {
             FacilityDataMViewElements.Name       = cd.NameCD;
             FacilityDataMViewElements.ZipCode    = FacilityDataMDataSet.FullZipCodeList.Where(a => a.IdZC == cd.ZipCodeCD).Select(a => a.DataZC).Single();
             FacilityDataMViewElements.Settlement = FacilityDataMDataSet.FullSettlementList.Where(a => a.IdS == cd.SettlementCD).Select(a => a.DataS).Single();
             FacilityDataMViewElements.Address    = cd.AddressCD;
             FacilityDataMViewElements.TaxNumber  = cd.TAXNumberCD;
             try
             {
                 FacilityDataMViewElements.RegistrationNumber = cd.RegistrationNumberCD;
             }
             catch
             {
                 FacilityDataMViewElements.RegistrationNumber = null;
             }
             try
             {
                 FacilityDataMViewElements.InvoiceNumber = cd.InvoiceNumberCD;
             }
             catch
             {
                 FacilityDataMViewElements.InvoiceNumber = null;
             }
             try
             {
                 FacilityDataMViewElements.Phone = cd.PhoneCD;
             }
             catch
             {
                 FacilityDataMViewElements.Phone = null;
             }
             try
             {
                 FacilityDataMViewElements.Email = cd.EmailCD;
             }
             catch
             {
                 FacilityDataMViewElements.Email = null;
             }
             try
             {
                 FacilityDataMViewElements.WebPage = cd.WebPageCD;
             }
             catch
             {
                 FacilityDataMViewElements.WebPage = null;
             }
         }
         else
         {
             FacilityDataMViewElements.Name               = null;
             FacilityDataMViewElements.ZipCode            = null;
             FacilityDataMViewElements.Settlement         = null;
             FacilityDataMViewElements.Address            = null;
             FacilityDataMViewElements.TaxNumber          = null;
             FacilityDataMViewElements.RegistrationNumber = null;
             FacilityDataMViewElements.InvoiceNumber      = null;
             FacilityDataMViewElements.Phone              = null;
             FacilityDataMViewElements.Email              = null;
             FacilityDataMViewElements.WebPage            = null;
         }
         FacilityDataMViewElements.AcceptChanges();
     }
     else
     {
         ConnectionMessage();
     }
 }