Ejemplo n.º 1
0
        private async void SaveAction(object obj)
        {
            try
            {
                if (IsBusy)
                {
                    return;
                }
                IsBusy = true;
                var saved = await PengaduanService.AddItemAsync(Model);

                if (saved)
                {
                    Helpers.ShowMessage("Pengaduan Berhasil Dikirim");
                    Model = new PengaduanModel();
                }
            }
            catch (Exception ex)
            {
                Helpers.ShowMessageError(ex.Message);
            }
            finally
            {
                IsBusy = false;
            }
        }
Ejemplo n.º 2
0
 public PengaduanViewModel(INavigation nav)
 {
     Model               = new PengaduanModel();
     Model.WaktuLapor    = DateTime.Now;
     NavigationEventArgs = nav;
     ResetCommand        = new Command(ResetAction);
     SaveCommand         = new Command(SaveAction);
 }
 // PUT: api/AdminPelanggan/5
 public async Task <IHttpActionResult> Put(int id, [FromBody] PengaduanModel value)
 {
     try
     {
         return(Ok(await domain.SaveChange(value)));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
Ejemplo n.º 4
0
        public async Task <IHttpActionResult> Post([FromBody] PengaduanModel value)
        {
            try
            {
                var pel = await User.PelangganProfile();

                value.IdPelanggan = pel.IdPelanggan;
                return(Ok(await domain.SaveChange(value)));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Ejemplo n.º 5
0
        // PUT: api/AdminPengaduan/5
        public async Task <IHttpActionResult> Put(int id, [FromBody] PengaduanModel value)
        {
            var result = await domain.SaveChange(value);

            return(Ok(result));
        }
Ejemplo n.º 6
0
 private void ResetAction(object obj)
 {
     Model = new PengaduanModel();
 }