Example #1
0
        public async Task <SLStandardDescription> AddSLStandardDescriptionAsync(SLStandardDescription sLStandardDescription)
        {
            _uow.SLStandardDescriptions.Add(sLStandardDescription);
            await _uow.SaveChangesAsync().ConfigureAwait(false);

            return(sLStandardDescription);
        }
Example #2
0
        public async Task <SLStandardDescription> UpdateSLStandardDescriptionAsync(SLStandardDescription sLStandardDescription)
        {
            _uow.Entry(sLStandardDescription).State = EntityState.Modified;
            await _uow.SaveChangesAsync().ConfigureAwait(false);

            //var cmd = $"EXEC SLStandardDescription_Update @SLStandardDescriptionId = {sLStandardDescription.SLStandardDescriptionId}," +
            //$" @SLStandardDescriptionTitle = N'{sLStandardDescription.SLStandardDescriptionTitle}'";

            //await _uow.Database.ExecuteSqlCommandAsync(cmd).ConfigureAwait(false);

            return(sLStandardDescription);
        }
Example #3
0
        //private void OnEditSLStandardDescription(SLStandardDescription sLStandardDescription)
        //{
        //    sLStandardDescription.SLId = SLId;
        //    EditSLStandardDescriptionRequested(sLStandardDescription);
        //}

        private async void OnDeleteSLStandardDescription(SLStandardDescription sLStandardDescription)
        {
            if (Deleting?.Invoke() == true)
            {
                try
                {
                    await _sLStandardDescriptionsService.DeleteSLStandardDescriptionAsync(sLStandardDescription.SLStandardDescriptionId);

                    SLStandardDescriptions.Remove(sLStandardDescription);
                    Deleted();
                }
                catch (Exception ex)
                {
                    Failed(ex);
                }
            }
        }
Example #4
0
 private void cancelRadButton_Click(object sender, RoutedEventArgs e)
 {
     SLStandardDescription = null;
     Close();
 }
Example #5
0
 public AddEditStandardDescriptionWindow()
 {
     InitializeComponent();
     SLStandardDescription = new SLStandardDescription();
     DataContext           = this;
 }
Example #6
0
 public void SetSLStandardDescription(SLStandardDescription sLStandardDescription)
 {
     SLStandardDescription = Mapper.Map <SLStandardDescription, EditableSLStandardDescription>(sLStandardDescription);
     SLStandardDescription.ErrorsChanged += RaiseCanExecuteChanged;
 }