protected override void OnBeforeEdit(System.ComponentModel.CancelEventArgs e) { base.OnBeforeEdit(e); ZamowieniaView.DisableReload = true; if (this.Zamowienie != null) { if (this.Zamowienie.EntityState == System.Data.EntityState.Unchanged) { ContextManager.WebContext.Refresh(System.Data.Objects.RefreshMode.StoreWins, this.Zamowienie); if (this.Zamowienie.Blokada != null && this.Zamowienie.Blokada.Value) { if (!FormManager.Confirm("Zamówienie jest zablokowane do edycji przez innego operatora\r\nCzy chcesz kontynułować?")) { e.Cancel = true; return; } this.Zamowienie.BlokadaEdycji = true; } else { this.Zamowienie.Blokada = true; this.SaveChanges(); this.Reset(); } } } }
public void OnAction() { if (StatusAction.CurrentRow != null) { if (!StatusAction.CurrentRow.Zamowienie.KopiowanoPozycje) { if (!FormManager.Confirm("Z tego zamówienia nie kopiowano pozycji czy napewno chcesz zmienić jego status na \"Gotowe\"?")) { return; } } var form = new WyborFakturyForm() { Zamowienie = StatusAction.CurrentRow.Zamowienie }; form.ShowDialog(); if (form.Faktura != null) { StatusAction.CurrentRow.Zamowienie.FakturaGuid = form.Faktura.Guid; StatusAction.CurrentRow.Zamowienie.FakturaNumer = form.Faktura.NumerPelny; if (StatusAction.CurrentRow.RodzajTransportu == RodzajTransportu.Kurier) { StatusAction.CurrentRow.ZmienStatusZamowienia(TypStatusuZamowienia.Kurier, true); } else if (StatusAction.CurrentRow.RodzajTransportu == RodzajTransportu.Przedstawiciel) { StatusAction.CurrentRow.ZmienStatusZamowienia(TypStatusuZamowienia.Przedstawiciel, true); } Refresh(); } } }
public void OnAction() { if (StatusAction.CurrentRow != null) { if (FormManager.Confirm("Czy napewno chcesz cofnąć status zamówienia?")) { StatusAction.CurrentRow.CofnijStatusZamowienia(true); Refresh(); } } }
private void usunNadrzednyButton_Click(object sender, EventArgs e) { nadrzedneGridView.Focus(); var rel = (Enova.Business.Old.DB.Web.RelacjaStatDok)nadrzedneBindingSource.Current; if (rel != null) { if (!FormManager.Confirm("Czy napewno chcesz usunąć relacje?")) { return; } nadrzedneBindingSource.Remove(rel); ((BAL.Business.Old.IRow)rel).Delete(); } }
protected virtual void deleteGridViewRow(DataGridViewRow row) { if (this.View != null && !this.View.AllowRemove) { return; } if (!FormManager.Confirm("Czy napewno chcesz usunąć rekord?")) { return; } object data = row.DataBoundItem; if (this.View != null) { this.View.Remove(data); } }
public override bool IsValid(out string msg) { msg = null; OperatorPrawaDostepu access = OperatorPrawaDostepu.Brak; if (przedstawicielCheckBox.Checked) { access |= OperatorPrawaDostepu.Przedstawiciel; } if (magazynierCheckBox.Checked) { access |= OperatorPrawaDostepu.Magazynier; } if (pakowaczCheckBox.Checked) { access |= OperatorPrawaDostepu.Pakowacz; } if (kierownikCheckBox.Checked) { access |= OperatorPrawaDostepu.Kierownik; } if (adminCheckBox.Checked) { access |= OperatorPrawaDostepu.Administrator; } if (superAdminCheckBox.Checked) { access |= OperatorPrawaDostepu.SuperAdmin; } if (access == OperatorPrawaDostepu.Brak) { if (!FormManager.Confirm("Operator nie posiada skonfigurowanych uprawnień\r\nCzy napewno chcesz zamknąć formularz?")) { return(false); } } this.Operator.SetPrawaDostepu(access); return(base.IsValid(out msg)); }
private void DeleteRecord(Enova.Business.Old.Controls.KategorieTreeView.KategoriaTreeNode node, bool confirmed = false) { KategoriaOld kategoria = node.Kategoria; if (kategoria != null) { if (kategoria.PoziomGlebokosci == 0) { MessageBox.Show("Nie można usunąć głównej kategori", "EnovaTools"); return; } if (confirmed || FormManager.Confirm($"Czy napewno chcesz usunąć kategorię {kategoria.Nazwa}?")) { foreach (var n in node.Nodes) { DeleteRecord((Enova.Business.Old.Controls.KategorieTreeView.KategoriaTreeNode)n, true); } //kategoria.DoUsuniecia = true; categoriesToRemove.Add(kategoria); node.Remove(); } } }
private void usunPozycje() { if (pozycjeReklamacjiGrid.CurrentRow != null) { if (FormManager.Confirm("Czy napewno chcesz usunąć pozycję?")) { Enova.Business.Old.DB.Web.PozycjaReklamacji pozycja = (Enova.Business.Old.DB.Web.PozycjaReklamacji)pozycjeReklamacjiGrid.CurrentRow.DataBoundItem; if (pozycja.EntityState == EntityState.Added) { DbContext.DeleteObject(pozycja); } else if (pozycja.EntityState == EntityState.Modified || pozycja.EntityState == EntityState.Unchanged) { pozycja.Deleted = true; } int i = 1; foreach (var poz in this.Reklamacja.Pozycje.Where(r => r.Deleted == false).OrderBy(r => r.Lp)) { poz.Lp = i++; } pozycjeBindingSource.Remove(pozycja); } } }