private void kontrahentEnovaSelect_ValueChanged(object sender, EventArgs e) { var kontrahent = Kontrahent.GetKontrahent(DbContext, (Enova.API.CRM.Kontrahent)kontrahentEnovaSelect.SelectedItem); if (kontrahent != null) { Zwrot.Kontrahent = kontrahent; } }
private void kontrahentEnovaSelect_ValueChanged(object sender, EventArgs e) { kontrahent = Kontrahent.GetKontrahent(Enova.Business.Old.Core.ContextManager.WebContext, (Enova.API.CRM.Kontrahent)kontrahentEnovaSelect.SelectedItem); if (Kontrahent != null) { int?defaultStatusDopPrzj = Enova.Business.Old.Core.ContextManager.WebContext.GetConfigInt("ZWROT_STATUS_DOPIERO_PRZYJEDZIE"); if (defaultStatusDopPrzj != null) { WebContext dc = this.Kontrahent.DbContext != null ? (WebContext)this.Kontrahent.DbContext : Enova.Business.Old.Core.ContextManager.WebContext; if (dc.Zwroty.Any(z => z.KontrahentID == this.Kontrahent.ID && z.OstatniStatusID == defaultStatusDopPrzj.Value)) { BAL.Forms.FormManager.Alert("!!! UWAGA !!! - DLA TEGO KONTRAHENTA ISTNIEJE ZWROT Z USTAWIONYM STATUSEM \"DOPIERO PRZYJEDZIE\""); } } } }