Ejemplo n.º 1
0
        private void btn_refreshData_Click(object sender, RoutedEventArgs e)
        {
            this.Dispatcher.BeginInvoke(new Action(() => {
                //grid_cart.RefreshColumns();
                LoadDatarefresh();
                var notify     = new SetNotify();
                notify.Title   = "POS Management Form";
                notify.Message = "Refresh Data Successful...";
                notify.ShowNotfyInformation();

                clearText();
            }));
        }
Ejemplo n.º 2
0
 private void checkClose()
 {
     if (string.IsNullOrEmpty(tran_no))
     {
         this.Dispatcher.BeginInvoke(new Action(() =>
         {
             this.Close();
             var notify     = new SetNotify();
             notify.Title   = "POS Management Form";
             notify.Message = "Transaction No Null or Product Id have value null";
             notify.ShowNotfySucess();
         }));
     }
 }
Ejemplo n.º 3
0
        private void RemoveItemCart(RoutedEventArgs e)
        {
            try
            {
                var item    = this.grid_cart.CurrentItem as DataRowView;
                var datarow = (item as DataRowView).Row;
                var tranId  = datarow["TransactionNo"].ToString();
                db.RemoveCart(tranId);
                var notify = new SetNotify();
                notify.Title   = "POS Management Form";
                notify.Message = "Remove Data Successful...";
                notify.ShowNotfyInformation();

                this.Dispatcher.BeginInvoke(new Action(() => {
                    LoadDatarefresh();
                }));
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "");
            }
        }
Ejemplo n.º 4
0
        private void getTransactionNo()
        {
            try
            {
                Int64 s2 = Convert.ToInt64(DateTime.Now.ToString("dMyyHH"));
                var   r  = new Random();
                var   s1 = r.Next(000, 102000);
                var   s3 = r.Next(00000, 1000000);
                txt_transaction.Text = (s1 + 1) + "" + s2 + "" + (s3 + 1);
                var notify = new SetNotify();
                notify.Title   = "POS Management Form";
                notify.Message = "Create Transaction No Successful...";
                notify.ShowNotfyInformation();


                var searchProduct = new SearchProducts(txt_transaction.Text);

                //set back grounnd

                searchProduct.Closed += delegate {
                    this.Opacity = 1;

                    //close search form alter add product to cart complete
                    grid_cart.ItemsSource = db.searchCart(txt_transaction.Text);
                    getTotalAmount(txt_transaction.Text);
                };
                if (searchProduct != null)
                {
                    this.Opacity = 0.2;
                    searchProduct.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.GetType().Name + "");
            }
        }