public PercentuelePromotie(double percent) { GeldigheidsPeriode = new Periode("01/01/1900", "31/12/2999"); Percent = percent; }
public Periode GetPeriodeById(int id) { Periode periode = (from item in db.Periodes where item.Id == id select item).Single <Periode>(); return(periode); }
private HtmlNode GenerateTooltip(HtmlDocument doc, Periode periode, Options options) { var tooltipLeft = -50; var tooltipTop = 10; if (periode.Position.X > 400) { tooltipLeft = -245; } if (periode.Position.Y > 300) { tooltipTop = -(180 + (options.CircleWidth + borderWidth) / 2); } var tooltip = CreateDiv(doc, "tt", string.Format("left:{0}px;top:{1}px;", periode.Position.X + tooltipLeft, periode.Position.Y + tooltipTop)); var panelTitle = CreateDiv(doc, "p-t b-b", string.Empty); var periodeTitle = doc.CreateElement("span"); periodeTitle.AddClass("lieu b-b"); periodeTitle.AppendChild(doc.CreateTextNode(periode.Lieu)); var panelBody = CreateDiv(doc, "p-b-w", string.Empty); if (options.DisplayByYear) { foreach (var subPeriode in periode.SubPeriodes) { if (periode.SubPeriodes.Count > 1) { panelBody.AppendChild(CreatePeriodePeriode(doc, subPeriode)); //panelBody.AppendChild(doc.CreateElement("br")); } foreach (var rp in subPeriode.Rps) { GenerateRpNode(doc, panelBody, rp, periode.SubPeriodes.Count == 1 && subPeriode.Rps.Count == 1); } } } else { foreach (var rp in periode.Rps) { GenerateRpNode(doc, panelBody, rp, periode.Rps.Count == 1); } } panelTitle.AppendChild(periodeTitle); if (!options.DisplayByYear || periode.SubPeriodes.Count == 1) { periodeTitle.AppendChild(doc.CreateElement("br")); panelTitle.AppendChild(CreatePeriodePeriode(doc, periode)); } tooltip.AppendChild(panelTitle); tooltip.AppendChild(panelBody); tooltip.AppendChild(CreateDiv(doc, "te", string.Empty)); return(tooltip); }
private void FormTambahNotaBeli_Load(object sender, EventArgs e) { comboBoxStatus.Items.AddRange(new string[] { "L", "B" }); this.Location = new Point(500, 26); FormatDataGrid(); pPeriode = Periode.GetPeriodeTerbaru(); textBoxKode.MaxLength = 5; textBoxNo.Enabled = false; textBoxAlamat.Enabled = false; comboBoxSupplier.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxStatus.DropDownStyle = ComboBoxStyle.DropDownList; string noNotaBaru; string hasilGenerate = NotaPembelian.GenerateNoNota(out noNotaBaru); textBoxNo.Clear(); if (hasilGenerate == "1") { textBoxNo.Text = noNotaBaru; textBoxKode.Focus(); } else { MessageBox.Show("Gagal melakukan generate code. Pesan kesalahan: " + hasilGenerate); } dateTimePickerDiskon.Value = DateTime.Now; dateTimePickerTglLunas.Value = DateTime.Now; dateTimePickerTanggalBeli.Value = DateTime.Now; dateTimePickerTanggalBeli.Enabled = false; string hasilBaca = Supplier.BacaData("", "", listHasilData); if (hasilBaca == "1") { comboBoxSupplier.Items.Clear(); for (int i = 0; i < listHasilData.Count; i++) { comboBoxSupplier.Items.Add(listHasilData[i].IdSupplier + " - " + listHasilData[i].Nama); } } else { comboBoxSupplier.Items.Clear(); } if (comboBoxStatus.Items.Count != 0) { comboBoxStatus.SelectedIndex = 0; } if (comboBoxSupplier.Items.Count != 0) { comboBoxSupplier.SelectedIndex = 0; } FormUtama form = (FormUtama)this.Owner.MdiParent; labelKodePgw.Text = form.labelKodePgw.Text; labelNamaPgw.Text = form.labelNamaPgw.Text; }
public void OverlapTest(Periode p1, Periode p2, bool caseResult, string caseDefinition) { Assert.IsTrue(p1.Overlapt(p2) == caseResult, $"Case '{caseDefinition}' failed."); }
public void CreatedPeriodHasStartAndEnd() { var periode = new Periode(_start, _eind); Assert.IsTrue(periode.Start.Equals(_start) && periode.Eind.Equals(_eind)); }
private bool IsCurrent(Periode period, DateTime date) { return(period.GyldigFra <= date && (!period.GyldigTil.HasValue || period.GyldigTil.Value >= date)); }
public ActionResult CreerPeriode(Periode p) { dbContext.Periodes.Add(p); dbContext.SaveChanges(); return(View()); }
private void FormTambahBarang_Load(object sender, EventArgs e) { comboBoxSatuan.Items.AddRange(new string[] { "Unit", "Jam" }); this.Location = new Point(500, 26); FormatDataGrid(); pPeriode = Periode.GetPeriodeTerbaru(); textBoxIdKaryawan.MaxLength = 1; textBoxKodeJobOrder.Enabled = false; comboBoxItem.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxNoNotaJual.DropDownStyle = ComboBoxStyle.DropDownList; string KodeJobBaru; string hasilGenerate = JobOrder.GenerateKodeJobOrder(out KodeJobBaru); textBoxKodeJobOrder.Clear(); if (hasilGenerate == "1") { textBoxKodeJobOrder.Text = KodeJobBaru; comboBoxNoNotaJual.Focus(); } else { MessageBox.Show("Gagal melakukan generate code. Pesan kesalahan: " + hasilGenerate); } dateTimePickerSelesai.Value = DateTime.Now; dateTimePickerMulai.Value = DateTime.Now; dateTimePickerMulai.Enabled = false; textBoxSatuan.Enabled = false; string hasilBaca = Barang.BacaData("jenis", "BJ", listHasilBarang); // untuk mendapatkan nama barang, kode dan menampilkan di comboboxitems if (hasilBaca == "1") { comboBoxItem.Items.Clear(); for (int i = 0; i < listHasilBarang.Count; i++) { comboBoxItem.Items.Add(listHasilBarang[i].KodeBarang + " - " + listHasilBarang[i].Nama); } } else { comboBoxItem.Items.Clear(); } string hasilBaca2 = NotaPenjualan.BacaData("", "", listHasilNotaPenjualan); // tampilkan ke combobox nonotapenjualan if (hasilBaca2 == "1") { comboBoxNoNotaJual.Items.Clear(); for (int i = 0; i < listHasilNotaPenjualan.Count; i++) { comboBoxNoNotaJual.Items.Add(listHasilNotaPenjualan[i].NoNotaPenjualan); } } else { comboBoxNoNotaJual.Items.Clear(); } if (comboBoxNoNotaJual.Items.Count != 0) { comboBoxNoNotaJual.SelectedIndex = 0; } comboBoxItem.SelectedIndex = 0; FormUtama form = (FormUtama)this.Owner.MdiParent; labelKodePgw.Text = form.labelKodePgw.Text; labelNamaPgw.Text = form.labelNamaPgw.Text; }
public ICollection <IngeschrevenPersoon> SelecteerIngeschrevenPersonenVoorRaadpleegBewoning(Periode periode) { var ingeschrevenPersonen = new List <IngeschrevenPersoon> { SelecteerIngeschrevenPersoonMetAlleenVerplichteKenmerken("123456780", "Pieterse"), SelecteerIngeschrevenPersoonMetAlleenVerplichteKenmerken("123456781", "Koning"), SelecteerIngeschrevenPersoonMetAlleenVerplichteKenmerken("123456782", "Nelis"), }; foreach (var ingeschrevenPersoon in ingeschrevenPersonen) { ingeschrevenPersoon.verblijfsadres = SelecteerVerblijfsAdresVoor(periode); } var datumOverlijden = DateTime.Today.AddMonths(-2); ingeschrevenPersonen[2].overlijden = new IngeschrevenPersoon.overlijdenType { overlijdensdatum = new Overlijdensdatum { jaar = datumOverlijden.Year, maand = datumOverlijden.Month, dag = datumOverlijden.Day }, overlijdenPlaats = "", overlijdenLand = "" }; return(ingeschrevenPersonen); }
public async Task <IActionResult> Add([FromBody] Time time, int semestre) { if (!ModelState.IsValid) { ModelState.AddModelError("time", "formulaire invalide"); return(BadRequest(ModelState)); } if (!periodeRepository.PeriodeExists(time.Idperiode)) { ModelState.AddModelError("periode", "Cette periode n'existe pas"); return(BadRequest(ModelState)); } if (!jourRepository.JourExists(time.Idjour)) { ModelState.AddModelError("jour", "Ce jour n'existe pas"); return(BadRequest(ModelState)); } if (!salleRepository.SalleExists(time.Idsalle)) { ModelState.AddModelError("salle", "Cet salle n'existe pas"); return(BadRequest(ModelState)); } if (!programmeRepository.ProgrammeExists(time.Idprogramme)) { ModelState.AddModelError("programme", "Cet ue n'existe pas"); return(BadRequest(ModelState)); } Periode periode = periodeRepository[time.Idperiode]; Jour jour = jourRepository[time.Idjour]; ModelPeriode modelPeriode = new ModelPeriode(); modelPeriode.SetModelPeriode(periode, jour); Salle salle = salleRepository[time.Idsalle]; Programme programme = programmeRepository[time.Idprogramme]; Compte enseignant = enseignantRepository[programme.Enseignant]; //verifion que la salle est libre foreach (var t in repository.TimeTableOfSalle(salle.Id, semestre)) { Periode p = periodeRepository[t.Idperiode]; Jour j = jourRepository[t.Idjour]; ModelPeriode model = new ModelPeriode(); model.SetModelPeriode(p, j); if (modelPeriode.OverLap(model)) { ModelState.AddModelError("salle", $"La salle {salle.Nom} n'est pas libre le {j.Nom} de {model.Debut.Hour}h{model.Debut.Minute} à {model.Fin.Hour}h{model.Fin.Minute}."); return(BadRequest(ModelState)); } } //verifion si l'enseigiant es libre foreach (var t in repository.TimeTableOfEnseignant(enseignant.Matricule, semestre)) { Periode p = periodeRepository[t.Idperiode]; Jour j = jourRepository[t.Idjour]; ModelPeriode model = new ModelPeriode(); model.SetModelPeriode(p, j); if (modelPeriode.OverLap(model)) { ModelState.AddModelError("enseignant", $"L'enseignant {enseignant.MatriculeNavigation.Nom} n'est pas libre le {j.Nom} de {model.Debut.Hour}h{model.Debut.Minute} à {model.Fin.Hour}h{model.Fin.Minute}."); return(BadRequest(ModelState)); } } //time = repository.Save(time); return(Ok(time)); }
public PercentuelePromotie(Periode geldigheidsPeriode, double percent, IPrijs prijsComponent) { GeldigheidsPeriode = geldigheidsPeriode; Percent = percent; OnderliggendePrijsComponent = prijsComponent; }
public PercentuelePromotie(Periode geldigheidsPeriode, double percent) { GeldigheidsPeriode = geldigheidsPeriode; Percent = percent; }
public void TestCashflowSucessCase() { var repo = new InMemoryRepository(); var periodeId1 = new PeriodeId(new DateTime(2015, 11, 1), new DateTime(2015, 11, 6)); var periode = new Periode(periodeId1, StatusPeriode.Mingguan); repo.SavePeriod(periode); var periodeSnapShot = new PeriodeDto() { StartPeriode = new DateTime(2015, 11, 1), EndPeriode = new DateTime(2015, 11, 6), IsPeriode = StatusPeriode.Bebas }; var periodeSave = repo.FindPeriodForDate(new DateTime(2015, 11, 3)); Assert.AreEqual(periodeSnapShot, periodeSave.Snap()); //cashflow var cashFlow = new CashFlow("ABC", periodeId1, 500000.0); repo.Save(cashFlow); var cashflowSnapshotDto = new CashFlowDto() { TenantId = "ABC", PeriodId = periode.Snap(), SaldoAwal = 500000.0, SaldoAkhir = 500000.0, TotalPenjualan = 0.0, TotalPenjualanLain = 0.0, TotalPengeluaran = 0.0, }; var findCashFlow = repo.FindCashFlowByPeriod(periodeId1); Assert.AreEqual(cashflowSnapshotDto, findCashFlow.Snap()); //Penjualan cashFlow.AddPenjualan(new DateTime(2015, 11, 1), 200000.0); repo.Save(cashFlow); var repoFind = repo.FindPeriodForDate(new DateTime(2015, 11, 3)); var cashFlowSnapshot = cashFlow.Snap(); var cashflowPenjualanSnapshot = new CashFlowDto() { TenantId = "ABC", PeriodId = periode.Snap(), SaldoAwal = 500000.0, SaldoAkhir = 700000.0, TotalPenjualan = 200000.0, TotalPenjualanLain = 0.0, TotalPengeluaran = 0.0, }; Assert.AreEqual(cashflowPenjualanSnapshot, cashFlowSnapshot); Assert.AreEqual(1, cashFlowSnapshot.ItemsPenjualan.Count); var itemPenjualan = cashFlowSnapshot.ItemsPenjualan[0]; Assert.AreEqual(new DateTime(2015, 11, 1), itemPenjualan.DateTime); Assert.AreEqual(200000.0, itemPenjualan.Nominal); //PenjualanLain cashFlow.AddPenjualanLain(new DateTime(2015, 11, 1), 200000.0); repo.Save(cashFlow); var repoFindLain = repo.FindPeriodForDate(new DateTime(2015, 11, 3)); var cashFlowSnapshotLain = cashFlow.Snap(); var cashflowPenjualanLainSnapshot = new CashFlowDto() { TenantId = "ABC", PeriodId = periode.Snap(), SaldoAwal = 500000.0, SaldoAkhir = 900000.0, TotalPenjualan = 200000.0, TotalPenjualanLain = 200000.0, TotalPengeluaran = 0.0, }; Assert.AreEqual(cashflowPenjualanLainSnapshot, cashFlowSnapshotLain); Assert.AreEqual(1, cashFlowSnapshotLain.ItemsPenjualanLain.Count); var itemPenjualanLain = cashFlowSnapshotLain.ItemsPenjualanLain[0]; Assert.AreEqual(new DateTime(2015, 11, 1), itemPenjualanLain.DateTimeLain); Assert.AreEqual(200000.0, itemPenjualanLain.NominalLain); //Pengeluaran cashFlow.ChangePengeluaran("Ayam", 200000, 5); repo.Save(cashFlow); var repoFindPengeluaran = repo.FindPeriodForDate(new DateTime(2015, 11, 3)); var cashFlowSnapshotPengeluaran = cashFlow.Snap(); var cashflowPengeluaranSnapshot = new CashFlowDto() { TenantId = "ABC", PeriodId = periode.Snap(), SaldoAwal = 500000.0, SaldoAkhir = 700000.0, TotalPenjualan = 200000.0, TotalPenjualanLain = 200000.0, TotalPengeluaran = 200000.0, }; Assert.AreEqual(cashflowPengeluaranSnapshot, cashFlowSnapshotPengeluaran); Assert.AreEqual(1, cashFlowSnapshotPengeluaran.ItemsPengeluaran.Count); var itemPengeluaran = cashFlowSnapshotPengeluaran.ItemsPengeluaran[0]; Assert.AreEqual("Ayam", itemPengeluaran.Akun); Assert.AreEqual(200000.0, itemPengeluaran.Nominal); Assert.AreEqual(5, itemPengeluaran.Jumlah); //NotaPengeluaran //var noNota = new NotaPengeluaranId("123"); //var notaPengeluaran = new NotaPengeluaran(new DateTime(2015, 11, 1), noNota); //repo.SaveNota(notaPengeluaran); //var foundNota = repo.FindNotaPengeluaranByID("123"); ////var notaSnapshot = notaPengeluaran.Snap(); //var notaSnap = new NotaPengeluaranDto() //{ // Tanggal = new DateTime(2015, 11, 1), // NoNota = noNota, // TotalNota = 0.0 //}; //Assert.AreEqual(notaSnap, foundNota.Snap()); ////AddAkunNota //notaPengeluaran.AddAkun("Ayam", 200000, 5); //repo.SaveNota(notaPengeluaran); //var repoFindNotaAkun = repo.FindPeriodForDate(new DateTime(2015, 11, 3)); //var notaAkunSnapshot = notaPengeluaran.Snap(); //var notaAkunSnap = new NotaPengeluaranDto() //{ // Tanggal = new DateTime(2015, 10, 26), // NoNota = "123", // TotalNota = 0.0 //}; //Assert.AreEqual(notaAkunSnap, notaAkunSnapshot); }
//Transforme un groupe sous la forme Element, dElement public override Element Déconstruire() { TypeElement type = Acces.type_BUDGET_NOMENCLATURE; Element e = new Element(); dElement d; string CodeAttribut = ""; e.ID = ID; e.Code = Code; e.Libelle = Libelle; e.Element_Type = type.ID; e.Type_Element = Enveloppe; e.Actif = Actif; //Période { CodeAttribut = "PERIODE"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Periode.ToString()); e.Liste.Add(d); } //TypeFlux { CodeAttribut = "TYPE_FLUX"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, ((int)TypeFlux).ToString()); e.Liste.Add(d); } return(e); }
public PandBuilder MetTariefPeriode(Tarief t, Periode periode) { _pand.TariefKalender.InsertWithOverride(periode, t); return(this); }
public void SetModelPeriode(Periode periode, Jour jour) { this.Debut = new LocalTime(periode.HeureDebut, periode.MinuteDebut); this.Fin = new LocalTime(periode.HeureFin, periode.MinuteFin); this.Jour = (System.DayOfWeek)jour.Id; }
//Transforme un groupe sous la forme Element, dElement public override Element Déconstruire() { Element e = new Element(); dElement d; string CodeAttribut = ""; TypeElement type = Acces.type_BUDGET; e.ID = ID; e.Code = Code; e.Libelle = Libelle; e.Element_Type = type.ID; e.Type_Element = Enveloppe; e.Actif = Actif; //Période { CodeAttribut = "PERIODE"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Periode.ToString()); e.Liste.Add(d); } //Date deb { CodeAttribut = "DATE_DEB"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, DateDeb); e.Liste.Add(d); } //Date Fin { CodeAttribut = "DATE_FIN"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, DateFin); e.Liste.Add(d); } return(e); }
/// <summary> /// Maakt een promotie voor een vast bedrag te korten per prijsEenheid /// </summary> /// <param name="periode"></param> /// <param name="waarde"></param> public VastePrijsPromotie(Periode periode, double waarde) { Waarde = waarde; GeldigheidsPeriode = periode; }
public void OverlaptDatumTest() { var periode = new Periode(_start, _eind); Assert.IsTrue(periode.Overlapt(_start.AddDays(1))); }
public VastePrijsPromotie(double waarde) { Waarde = waarde; GeldigheidsPeriode = new Periode("01/01/1900", "31/12/2999"); }
public void init() { _periodeId = new PeriodeId(new DateTime(2015, 11, 1), new DateTime(2015, 11, 6)); _periode = new Periode(_periodeId, StatusPeriode.Bebas); }
protected void Button1_Click(object sender, EventArgs e) { BLPeriode blPeriode = new BLPeriode(); BLKamp blKamp = new BLKamp(); BLContract blContract = new BLContract(); BLContractPersoon blContractPersoon = new BLContractPersoon(); BLVereniging blVereniging = new BLVereniging(); BLPersoon blPersoon = new BLPersoon(); BLBetaling blBetaling = new BLBetaling(); Vereniging vereniging = new Vereniging(); Periode periode = new Periode(); Kamp kamp = new Kamp(); Contract contract = new Contract(); ContractPersoon contractpersoon = new ContractPersoon(); periode.BeginPeriode = Convert.ToDateTime(TextBoxBegin.Text); periode.EindePeriode = Convert.ToDateTime(TextBoxEinde.Text); if (CheckBoxDefinitief.Checked) { //optie toegekend periode.StatusId = 3; } else { //optie in aanvraag periode.StatusId = 2; } //type standaard periode.TypeId = 4; int periodeId = blPeriode.InsertPeriode(periode); kamp.AantalPersonen = Convert.ToInt32(TextBoxPersonen.Text); kamp.AantalTenten = Convert.ToInt32(TextBoxTenten.Text); kamp.TijdstipAankomst = TextBoxAankomst.Text; kamp.TijdstipVertrek = TextBoxVertrek.Text; kamp.Opmerkingen = TextBoxOpmerkingen.Text; int kampId = blKamp.InsertKamp(kamp); vereniging.Naam = TextBoxVereniging.Text; int verenigingId = blVereniging.InsertVereniging(vereniging); int persoonId = ((Persoon)Session["persoon"]).Id; contract.KampId = kampId; contract.PeriodeId = periodeId; int contractId = blContract.InsertContract(contract); contractpersoon.ContractId = contractId; contractpersoon.PersoonId = persoonId; int contractPersoonId = blContractPersoon.InsertContractpersoon(contractpersoon, 1); //1 voor kamporganisator blPersoon.UpdatePersoonVerenigingId(persoonId, verenigingId); int aantalNachten = (int)Convert.ToDateTime(TextBoxEinde.Text).Subtract(Convert.ToDateTime(TextBoxBegin.Text)).TotalDays; blBetaling.InsertBetalingenBijContract(aantalNachten, Convert.ToInt32(TextBoxPersonen.Text), Convert.ToInt32(TextBoxTenten.Text), contractId); //==================================================mail sturen==================================================== if (periode.StatusId == 3) { Session["melding"] = "De periode is voorlopig gereserveerd. Vergeet ze niet binnen de 7 dagen definitief te maken! In uw mailbox zit een e-mail met het overzicht van uw aanvraag."; } else { Session["melding"] = "De periode is definitief gereserveerd. In uw mailbox zit een e-mail met het overzicht van uw aanvraag. Gelieve het voorschot en de waarborg spoedig te betalen."; } //sessie met begin en einddatum leegmaken Session["begin"] = null; Session["einde"] = null; Response.Redirect("Default.aspx"); }
//Transforme un groupe sous la forme Element, dElement public override Element Déconstruire() { Element e = new Element(); dElement d; string CodeAttribut = ""; TypeElement type = Acces.type_BUDGET_OPERATION; e.ID = ID; e.Element_Type = type.ID; e.Code = Code; e.Libelle = Libelle; e.Type_Element = (int)Type_Flux; e.Actif = Actif; //Type Enveloppe { CodeAttribut = "ENVELOPPE"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Enveloppe.ToString()); e.Liste.Add(d); } //Période { CodeAttribut = "PERIODE"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Periode.ToString()); e.Liste.Add(d); } //Date opération { CodeAttribut = "DATE_OPERATION"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, DateOperation); e.Liste.Add(d); } //Type opération { CodeAttribut = "TYPE_OPERATION"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Type_Operation.ToString()); e.Liste.Add(d); } //Budget ORG { CodeAttribut = "BUDGET_ORG"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Budget_ORG.ToString()); e.Liste.Add(d); } //Budget GEO { CodeAttribut = "BUDGET_GEO"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Budget_GEO.ToString()); e.Liste.Add(d); } //Compte ID { CodeAttribut = "COMPTE_ID"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Compte_ID.ToString()); e.Liste.Add(d); } //Montant { CodeAttribut = "MONTANT"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Montant.ToString()); e.Liste.Add(d); } //Type Flux { CodeAttribut = "TYPE_FLUX"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, ((int)Type_Flux).ToString()); e.Liste.Add(d); } //Type monatnt { CodeAttribut = "TYPE_MONTANT"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, ((int)Type_Montant).ToString()); e.Liste.Add(d); } //Commentaire { CodeAttribut = "COMMENTAIRE"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Commentaire); e.Liste.Add(d); } //Virement ID { CodeAttribut = "VIREMENT_ID"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Virement_ID.ToString()); e.Liste.Add(d); } return(e); }
//Transforme un groupe sous la forme Element, dElement public override Element Déconstruire() { Element e = new Element(); dElement d; string CodeAttribut = ""; TypeElement type = Acces.type_BUDGET_LIGNE; e.ID = ID; e.Element_Type = type.ID; e.Code = Code; e.Libelle = Libelle; e.Type_Element = (int)TypeFlux; e.Actif = Actif; //Budget ID { CodeAttribut = "BUDGET_ID"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Budget_ID.ToString()); e.Liste.Add(d); } //Type Enveloppe { CodeAttribut = "ENVELOPPE"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Enveloppe.ToString()); e.Liste.Add(d); } //Budget organisation { CodeAttribut = "BUDGET_ORG"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Budget_ORG.ToString()); e.Liste.Add(d); } //Budget géographique { CodeAttribut = "BUDGET_GEO"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Budget_GEO.ToString()); e.Liste.Add(d); } //Période { CodeAttribut = "PERIODE"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Periode.ToString()); e.Liste.Add(d); } //Date début { CodeAttribut = "DATE_DEB"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, DateDeb); e.Liste.Add(d); } //Date fin { CodeAttribut = "DATE_FIN"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, DateFin); e.Liste.Add(d); } //Limitatif { CodeAttribut = "LIMITATIF"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, (Limitatif?"1":"0")); e.Liste.Add(d); } //Type Montant { CodeAttribut = "TYPE_MONTANT"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, ((int)TypeMontant).ToString()); e.Liste.Add(d); } /*//Type Flux * { * CodeAttribut = "TYPE_FLUX"; * d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, ((int)TypeFlux).ToString()); * e.Liste.Add(d); * }*/ //Liste des comptes { CodeAttribut = "COMPTE"; foreach (int k in ListeCompte) { d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, k.ToString()); e.Liste.Add(d); } } return(e); }
public static List <Cours> findByPersonnel(long id) { MySqlConnection _connection = ConnectionMySql.getInstance(); MySqlCommand _cmd = new MySqlCommand(); _cmd.Connection = _connection; String sql = ""; MySqlDataReader reader = null; List <Cours> resultats = new List <Cours>(); try { sql = "SELECT cours.id as coursID, cours.volume as coursVolume, cours.groupe as coursGroupe, cours.ec_id, " + "type_cours.id AS typeCoursID, type_cours.libelle AS typeCoursLibelle, " + "personnel.id AS personnelId, personnel.nom AS personnelNom, personnel.prenom AS personnelPrenom, " + "categorie_personnel.id AS categID, categorie_personnel.libelle AS categLibelle, categorie_personnel.volume_horaire as categVolume, " + "element_constitutif.id as elemConstID, element_constitutif.libelle as elemConstLibelle, " + "unite_enseignement.id as uniteEnsID, unite_enseignement.libelle as uniteEnsLibelle, " + "periode.id AS periodeID, periode.libelle AS periodeLibelle, " + "annee.id AS anneeId, annee.libelle AS anneeLibelle, " + "diplome.id AS diplomeID, diplome.libelle AS diplomeLibelle " + "FROM cours " + "LEFT JOIN type_cours on cours.type_id = type_cours.id " + "LEFT JOIN element_constitutif on cours.ec_id = element_constitutif.id " + "LEFT JOIN personnel on cours.personnel_id = personnel.id " + "LEFT JOIN categorie_personnel ON personnel.categorie_id = categorie_personnel.id " + "LEFT JOIN unite_enseignement on element_constitutif.ue_id = unite_enseignement.id " + "LEFT JOIN periode ON unite_enseignement.periode_id = periode.id " + "LEFT JOIN annee ON periode.annee_id = annee.id " + "LEFT JOIN diplome ON annee.diplome_id = diplome.id " + "WHERE personnel.id = @id"; _cmd.CommandText = sql; _cmd.Parameters.AddWithValue("@id", id); reader = _cmd.ExecuteReader(); while (reader.Read()) { Cours resultat = populateCours(reader); Diplome tempDiplome = DiplomeDAO.populateDiplome(reader); Annee tempAnnee = AnneeDAO.populateAnnee(reader); if (tempDiplome != null) { tempAnnee.diplome = tempDiplome; } Periode tempPeriode = PeriodeDAO.populatePeriode(reader); if (tempPeriode != null) { tempPeriode.annee = tempAnnee; } UniteEnseignement tempUnite = UniteEnseignementDAO.populateUniteEnseignement(reader); if (tempUnite != null) { tempUnite.periode = tempPeriode; } ElementConstitutif tempElemConstitutif = ElementConstitutifDAO.populateElementConstitutif(reader); if (tempElemConstitutif != null) { tempElemConstitutif.uniteEnseignement = tempUnite; } // champ du cours resultat = populateCours(reader); // ajout element constitutif resultat.elementConstitutif = tempElemConstitutif; // ajout type de cours TypeCours tempTypeCours = TypeCoursDAO.populateTypeCours(reader); resultat.typeCours = tempTypeCours; // ajout intervenant et sa categorie CategoriePersonnel tempCategPersonnel = CategoriePersonnelDAO.populateCategoriePersonnel(reader); Personnel tempPersonnel = PersonnelDAO.populatePersonnel(reader); if (tempPersonnel != null) { tempPersonnel.categoriePersonnel = tempCategPersonnel; } resultat.intervenant = tempPersonnel; resultats.Add(resultat); } reader.Close(); } catch (Exception e) { Debug.WriteLine("Exception : " + e); } _cmd.Dispose(); return(resultats); }
//Transforme un groupe sous la forme Element, dElement public override Element Déconstruire() { Element e = new Element(); dElement d; string CodeAttribut = ""; TypeElement type = Acces.type_BUDGET_VIREMENT; e.ID = ID; e.Code = Code; e.Libelle = Libelle; e.Element_Type = type.ID; e.Type_Element = (int)Type_Virement; e.Actif = Actif; //Période { CodeAttribut = "PERIODE"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Periode.ToString()); e.Liste.Add(d); } //TypeFlux { CodeAttribut = "TYPE_FLUX"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, ((int)Type_Flux).ToString()); e.Liste.Add(d); } //TYpeMontant { CodeAttribut = "TYPE_MONTANT"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, ((int)Type_Montant).ToString()); e.Liste.Add(d); } //Enveloppe Source { CodeAttribut = "ENVELOPPE_SRC"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Enveloppe_Src.ToString()); e.Liste.Add(d); } //Budget GEO Source { CodeAttribut = "BUDGET_ORG_SRC"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Budget_ORG_Src.ToString()); e.Liste.Add(d); } //Budget GEO Source { CodeAttribut = "BUDGET_GEO_SRC"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Budget_GEO_Src.ToString()); e.Liste.Add(d); } //Compte ID Source { CodeAttribut = "COMPTE_ID_SRC"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Compte_ID_Src.ToString()); e.Liste.Add(d); } //Enveloppe Destination { CodeAttribut = "ENVELOPPE_DEST"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Enveloppe_Dest.ToString()); e.Liste.Add(d); } //Budget GEO Destination { CodeAttribut = "BUDGET_ORG_DEST"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Budget_ORG_Dest.ToString()); e.Liste.Add(d); } //Budget GEO Destination { CodeAttribut = "BUDGET_GEO_DEST"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Budget_GEO_Dest.ToString()); e.Liste.Add(d); } //Compte ID Destination { CodeAttribut = "COMPTE_ID_DEST"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Compte_ID_Dest.ToString()); e.Liste.Add(d); } //Date de la demande { CodeAttribut = "DATE_DEMANDE"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, DateDemande); e.Liste.Add(d); } //Date d'effet { CodeAttribut = "DATE_EFFET"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, DateEffet); e.Liste.Add(d); } //Montant { CodeAttribut = "MONTANT"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Montant.ToString()); e.Liste.Add(d); } //Commentaire { CodeAttribut = "COMMENTAIRE"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Commentaire); e.Liste.Add(d); } //Validé { CodeAttribut = "VALIDE"; d = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, (Validé?"1":"0")); e.Liste.Add(d); } return(e); }