Esempio n. 1
0
    protected Wysylka CreateSend()
    {
        Wysylka wy = new Wysylka();

        wy.IdProdukt = Convert.ToInt16(Literal1.Text);
        wy.KlientId  = User.Identity.GetUserId();
        wy.JakPlaci  = droplistbank.SelectedValue;
        wy.JakWyslac = DropDownList1.SelectedValue;
        wy.Wiadomosc = TextBox6.Text;

        return(wy);
    }
Esempio n. 2
0
    protected void btnZatwierdz_Click(object sender, EventArgs e)
    {
        Wysylka   wy     = CreateSend();
        SendModel model1 = new SendModel();

        lblResult.Text = model1.InsertSend(wy);
        List <Koszyk> carts = (List <Koszyk>)Session[User.Identity.GetUserId()];
        CartModel     model = new CartModel();

        model.MarkOrdersAsPaid(carts);
        Session[User.Identity.GetUserId()] = null;
        Response.Redirect("~/Pages/Zakonczenie.aspx");
    }
Esempio n. 3
0
    protected void ImageButton13_Click(object sender, ImageClickEventArgs e)
    {
        Wysylka   wy     = CreateSend();
        SendModel model1 = new SendModel();

        lblResult.Text = model1.InsertSend(wy);
        List <Koszyk> carts = (List <Koszyk>)Session[User.Identity.GetUserId()];
        CartModel     model = new CartModel();

        model.MarkOrdersAsPaid(carts);
        Session[User.Identity.GetUserId()] = null;
        Response.Redirect("https://www.mbank.pl/indywidualny/");
    }
Esempio n. 4
0
 public string InsertSend(Wysylka wyslij)
 {
     try
     {
         KosmetykiDBEntities db = new KosmetykiDBEntities();
         db.Wysylkas.Add(wyslij);
         db.SaveChanges();
         return("Wysyłka numer" + wyslij.Id + "zostanie jak najszybciej zrealizowana");
     }
     catch (Exception e)
     {
         return("Error: " + e);
     }
 }
Esempio n. 5
0
    protected void ImageButton14_Click(object sender, ImageClickEventArgs e)
    {
        Wysylka   wy     = CreateSend();
        SendModel model1 = new SendModel();

        lblResult.Text = model1.InsertSend(wy);
        List <Koszyk> carts = (List <Koszyk>)Session[User.Identity.GetUserId()];
        CartModel     model = new CartModel();
        Koszyk        id    = new Koszyk();

        Literal1.Text = Convert.ToString(id.ID);
        model.MarkOrdersAsPaid(carts);
        Session[User.Identity.GetUserId()] = null;
        Response.Redirect("https://www.aliorbank.pl/");
    }
        public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId)
        {
            var notification       = new Notification(Resource.Drawable.icon, "Service running in the foreground!");
            var notificationIntent = new Intent(this, typeof(MainActivity));
            var pendingIntent      = PendingIntent.GetActivity(this, 0, notificationIntent, 0);

            notification.SetLatestEventInfo(this, "Foreground Service", "Tap to to to App", pendingIntent);
            Log.Info(TAG, "OnStartCommand: The service is starting.");
            StartForeground((int)NotificationFlags.ForegroundService, notification);
            Task.Run(() => {
                for (int i = 1; i < 999; i++)
                {
                    Wysylka w = new Wysylka();
                    w.Czywyslc();
                    Thread.Sleep(3600000);
                    if (!this.cts.IsCancellationRequested)
                    {
                        this.StopSelf();
                    }
                    i--;
                }
            });
            return(StartCommandResult.Sticky);
        }