private void cmdUslugiPodglad_Click(object sender, EventArgs e) { UslugaC selected = null; try { selected = (UslugaC)dgvMain.CurrentRow.DataBoundItem; } catch { Message.Position(); return; } UslugaPrc usluga = new UslugaPrc(UslugaPrc.TYPE.VIEW); usluga.USLUGA = selected; usluga.ShowDialog(); }
private void cmdTowaryPodgląd_Click(object sender, EventArgs e) { if(TrybPracy == TYPE.PRODUKTY_VIEW) { Produkt program = null; try { program = (Produkt)dgvLista.CurrentRow.DataBoundItem; } catch { Message.Position(); return; } FINDKind viewProduct = new FINDKind(FINDKind.TYPE.VIEW); viewProduct.PRODUKT = program; viewProduct.ShowDialog(); } else if( TrybPracy == TYPE.USLUGI_VIEW) { UslugaC selected = null; try { selected = (UslugaC)dgvLista.CurrentRow.DataBoundItem; } catch { Message.Position(); return; } UslugaPrc usluga = new UslugaPrc(UslugaPrc.TYPE.VIEW); usluga.USLUGA = selected; usluga.ShowDialog(); } }
private void cmdUslugiDodaj_Click(object sender, EventArgs e) { UslugaPrc usluga = new UslugaPrc(UslugaPrc.TYPE.NEW); usluga.ShowDialog(); if (usluga.CANCEL) return; if (usluga.USLUGA.TIME_INDEX != WorkIdx.TYPE.SELECT) { usluga.USLUGA.SumaBrutto = (float)Math.Round(usluga.USLUGA.Brutto * usluga.CZAS, 2); usluga.USLUGA.SumaNetto = (float)Math.Round(usluga.USLUGA.Netto * usluga.CZAS, 2); } else { usluga.USLUGA.SumaBrutto = usluga.USLUGA.Brutto; usluga.USLUGA.SumaNetto = usluga.USLUGA.Netto; } SUMA_NETTO += usluga.USLUGA.SumaNetto; SUMA_BRUTTO += usluga.USLUGA.SumaBrutto; usluga.USLUGA.KWOTA_VAT = (float)Math.Round((usluga.USLUGA.SumaBrutto - usluga.USLUGA.SumaNetto), 2); USLUGI.Add(usluga.USLUGA); LoadUslugi(); //List<UslugaC> lstUslugi = // CustomerDatabase.GetUslugi(-1, usluga.NUMER, usluga.NAZWA); //if (lstUslugi == null) //{ Message.InfoMessage("Nie znaleziono"); return; } //cbxUslugi.DisplayMember = ""; //cbxUslugi.ValueMember = ""; //cbxUslugi.DataSource = null; //cbxUslugi.DataSource = lstUslugi; //cbxUslugi.DisplayMember = "USLUGA"; //cbxUslugi.ValueMember = "ID"; //cbxUslugi.Text = "Wybierz z listy usług"; //Settings.ShowDropDownList(ref cbxUslugi); }
private void cmdTowaryDodaj_Click(object sender, EventArgs e) { if (TrybPracy == TYPE.PRODUKTY_EDIT) { FINDKind szukajTowar = new FINDKind(FINDKind.TYPE.MAGAZYN_FIND); //szukajTowar.MID = MID; szukajTowar.ShowDialog(); if (szukajTowar.CANCEL) { return; } List<Produkt> produkty = CustomerDatabase.GetTowarFromMagazyn(szukajTowar.CID, szukajTowar.KATID, -1, szukajTowar.MID, szukajTowar.NAZWA_TOWARU, szukajTowar.NUMER_KATALOGOWY, szukajTowar.MODEL, szukajTowar.NUMER_SERYJNY); if (produkty == null) { Message.NotFound(); return; } cbxTowary.DisplayMember = ""; cbxTowary.ValueMember = ""; cbxTowary.DataSource = null; cbxTowary.DataSource = produkty; cbxTowary.DisplayMember = "TOWAR"; cbxTowary.ValueMember = "ID"; Settings.ShowDropDownList(ref cbxTowary); cbxTowary.Text = "Wybierz towar z listy"; } else if (TrybPracy == TYPE.USLUGI_EDIT) { UslugaPrc usluga = new UslugaPrc(UslugaPrc.TYPE.NEW); usluga.ShowDialog(); if (usluga.CANCEL) return; SUMA_NETTO += usluga.USLUGA.Netto; SUMA_BRUTTO += usluga.USLUGA.Brutto; usluga.USLUGA.KWOTA_VAT = (float)Math.Round((usluga.USLUGA.Brutto - usluga.USLUGA.Netto), 2); USLUGI.Add(usluga.USLUGA); LoadUslugi(); } }