private PagedResult <ApplicationUser> GetReportData(int page, int pageSize) { Domicile docmile = this._userService.GetUserDomiciles().First(); PagedResult <ApplicationUser> users = this._userReportService.GetUserReport(docmile.Id, page, pageSize); return(users); }
public ApplicationUserBuilder WithDomicile(Domicile domicile) { Instance.Domiciles.Add(new ApplicationUserDomicile { UserId = Instance.Id, DomicileId = domicile.Id }); return(this); }
void SaveDomicile() { Domicile dom = new Domicile(); dom.Id = idDomicile; dom.Avenue = avenueTxt.Text; dom.Numero = numTxt.Text; dom.RefAdresse = idAdresse; dom.RefMembre = InstantRound.GetInstance().IdMembre; dom.Enregistrer(dom); }
private void LastId() { gridClic = false; try { Adresse ad = new Adresse(); idAdresse = ad.Nouveau(); Domicile dom = new Domicile(); idDomicile = dom.Nouveau(); Telephone tel = new Telephone(); idPhone = tel.Nouveau(); } catch (Exception ex) { MessageBox.Show("L'erreur suivant est survenue : " + ex.Message); } }
public async void EditPatient() { Value = true; var connection = await apiService.CheckConnection(); if (!connection.IsSuccess) { await Application.Current.MainPage.DisplayAlert( Languages.Warning, Languages.CheckConnection, Languages.Ok); return; } if (string.IsNullOrEmpty(Patient.firstName) || string.IsNullOrEmpty(Patient.lastName) || string.IsNullOrEmpty(Patient.fiscalCode)) { Value = true; return; } if (Patient.client == null || Patient.residence == null || Patient.domicile == null) { Value = true; return; } /* var _fiscalData = new FiscalData * { * id = Patient.fiscalData.id, * codeDestinaterio = Patient.fiscalData.codeDestinaterio, * inderizioPec = Patient.fiscalData.inderizioPec, * adresseFacturation = Patient.fiscalData.adresseFacturation, * conditionPaymentDescription = Patient.fiscalData.conditionPaymentDescription, * pIVA = Patient.fiscalData.pIVA * };*/ var _domicile = new Domicile { id = Patient.domicile.id, comuniLocal = Patient.domicile.comuniLocal, street = Patient.domicile.street }; var _residence = new Residence { id = Patient.residence.id, comuniLocal = Patient.residence.comuniLocal, street = Patient.residence.street }; var patient = new Patient { id = Patient.id, title = Patient.title, // SelectedTitle.Key, firstName = Patient.firstName, lastName = Patient.lastName, fullName = Patient.title + " " + Patient.lastName + " " + Patient.firstName, fiscalCode = Patient.fiscalCode, gender = Patient.gender, birthDate = Patient.birthDate, placeOfBirth = Patient.placeOfBirth, client = Patient.client, phone = Patient.phone, cellPhone = Patient.cellPhone, email = Patient.email, note = Patient.note, fiscalData = Patient.fiscalData, //_fiscalData, domicile = _domicile, residence = _residence, confirmSave = false, isMerged = false, isRepositorySaved = false }; var cookie = Settings.Cookie; //.Split(11, 33) var res = cookie.Substring(11, 32); var response = await apiService.PutPatient <Patient>( "https://portalesp.smart-path.it", "/Portalesp", "/patient/update", res, patient); Debug.WriteLine("********responseIn ViewModel*************"); Debug.WriteLine(response); if (!response.IsSuccess) { await Application.Current.MainPage.DisplayAlert("Error", response.Message, "ok"); return; } Value = false; PatientViewModel.GetInstance().Update(patient); MessagingCenter.Send((App)Application.Current, "OnSaved"); DependencyService.Get <INotification>().CreateNotification("PortalSP", "Patient Updated"); await App.Current.MainPage.Navigation.PopPopupAsync(true); }
public XmlFileBuilder WithDomicile(Domicile domicile) { Instance.Domicile = domicile; return(this); }
public ManCoBuilder WithDomicile(Domicile domicile) { Instance.Domicile = domicile; return(this); }
void RefreshDatas(Domicile insc) { dgInscit.DataSource = insc.AllAdresses(); }
public async Task <IActionResult> Create(CommandeAdresseAdaptateur Adaptateur) { if (ModelState.IsValid) { var enlevement = Request.Form["enlevementMagasin"]; //récup des infoi utilisateur et du panier var IdUser = _userManager.GetUserId(User); var tFEContext = _context.Panier.Include(p => p.Produit).Where(p => p.RegisterViewModelID == IdUser).ToArray(); if (enlevement != "true") { //ajout de l'adresse dans la bd var listAdd = _context.Adresses.Include(a => a.DomicileClient).ToList(); Boolean existe = false; int i = 0; while (!existe && i < listAdd.Count) { if (listAdd[i].Equals(Adaptateur.Adresse)) { existe = true; } else { i++; } } if (!existe) { _context.Add(Adaptateur.Adresse); await _context.SaveChangesAsync(); } else { Adaptateur.Adresse.ID = listAdd[i].ID; } Domicile d = new Domicile(); d.AdresseID = Adaptateur.Adresse.ID; //d.ClientID = Client[0].ID; d.RegisterViewModelID = IdUser; _context.Add(d); await _context.SaveChangesAsync(); } //création de la comande Commande commande = new Commande(); commande.AdresseID = Adaptateur.Adresse.ID; //commande.ClientID = Client[0].ID; commande.RegisterViewModelID = IdUser; commande.DateCommade = DateTime.Now; if (User.IsInRole("gestionnaire")) { commande.EnCours = false; } else { commande.EnCours = true; } _context.Add(commande); await _context.SaveChangesAsync(); //ajout des produit a la commande int idCommande = commande.ID; foreach (var e in tFEContext) { Possede p = new Possede(); p.CommandeID = idCommande; p.ProduitID = e.ProduitID; e.Produit.QuantiteEmballage -= e.Quantite; e.Produit.QuantiteStockTotal = e.Produit.QuantiteEmballage * e.Produit.NBPieceEmballage + e.Produit.QuantiteStock; p.Quantite = e.Quantite; _context.Add(p); Historique h = new Historique { ProduitID = e.ProduitID, Action = "Vente", Date = DateTime.Now, QteMouv = e.Quantite, QteStock = e.Produit.QuantiteStockTotal }; _context.Add(h); } await _context.SaveChangesAsync(); //creation de la facture Facture f = new Facture(); f.CommandeID = idCommande; f.Numero = int.Parse(DateTime.Now.Year.ToString() + _context.Factures.Count()); _context.Add(f); await _context.SaveChangesAsync(); //vidage du panier var panier = _context.Panier.Where(p => p.RegisterViewModelID == IdUser); _context.Panier.RemoveRange(panier); await _context.SaveChangesAsync(); } return(RedirectToAction("Index", "Commandes")); }