public DataRow getDetailToko(int pos)
        {
            try
            {
                selected = pos;
                // 0 = id transos
                // 1 = status R / D / A
                // 2 = id seller
                DataRow dr = Htomhelper.Table.Rows[pos];
                Dtom = new Trans_OSModel();

                Dtom.initAdapter($"select s.NAMA_TOKO as \"toko\", s.EMAIL as \"email\", s.ALAMAT as \"alamat\", s.NO_TELP as \"notelp\", s.NAMA_SELLER as \"nama\", s.CREATED_AT as \"createdat\" from SELLER s where s.ID = {dr[2].ToString()}");

                return(Dtom.Table.Rows[0]);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Example #2
0
 public void registerOS()
 {
     if (MessageBox.Show("Yakin untuk daftar sebagai Official Store?", "Konfirmasi", MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes)
     {
         App.openConnection(out _);
         using (OracleTransaction trans = App.connection.BeginTransaction()) {
             try {
                 Trans_OSModel model = new Trans_OSModel();
                 model.init();
                 model.insert("ID", 0, "KODE", "", "TANGGAL_TRANSAKSI", DateTime.Now, "STATUS", 'R', "ID_SELLER", seller["ID"].ToString());
                 trans.Commit();
             }
             catch (OracleException) {
                 trans.Rollback();
             }
         }
         App.closeConnection(out _);
     }
     resetOSMessage();
 }
Example #3
0
        private void resetOSMessage()
        {
            ViewComponent.labelOSMessage.Visibility = Visibility.Hidden;
            ViewComponent.btnDaftarOS.Visibility    = Visibility.Hidden;

            Trans_OSModel model = new Trans_OSModel();

            model.addWhere($"ID_SELLER", seller["ID"].ToString(), "=", false);
            model.addOrderBy("TANGGAL_TRANSAKSI desc");
            if (model.get().Length <= 0)
            {
                return;
            }
            DataRow row = model.get()[0];

            if (row == null)
            {
                return;
            }
            ViewComponent.labelOSMessage.Visibility = Visibility.Visible;
            ViewComponent.btnDaftarOS.Visibility    = Visibility.Visible;
            if (row["STATUS"].ToString() == "R")
            {
                ViewComponent.labelOSMessage.Text = "Pendaftaran Official Store masih diproses";
                Color color = (Color)ColorConverter.ConvertFromString("#FFC548");
                ViewComponent.labelOSMessage.Foreground = new SolidColorBrush(color);
                ViewComponent.btnDaftarOS.IsEnabled     = false;
            }
            else if (row["STATUS"].ToString() == "D")
            {
                ViewComponent.labelOSMessage.Text = "Pendaftaran Official Store ditolak";
                Color color = (Color)ColorConverter.ConvertFromString("#E23434");
                ViewComponent.labelOSMessage.Foreground = new SolidColorBrush(color);
                ViewComponent.btnDaftarOS.IsEnabled     = true;
            }
            else
            {
                ViewComponent.labelOSMessage.Visibility = Visibility.Hidden;
                ViewComponent.btnDaftarOS.Visibility    = Visibility.Hidden;
            }
        }
 public OfficialStoreViewModel()
 {
     Htom       = new Trans_OSModel();
     Htomhelper = new Trans_OSModel();
     reloadHtom();
 }