コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Paying payStudent = db.Paying.Find(id);

            db.Paying.Remove(payStudent);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "PayingId,ServicePayment,DatePayment,StusentId")] Paying payStudent)
 {
     if (ModelState.IsValid)
     {
         db.Entry(payStudent).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(payStudent));
 }
コード例 #3
0
ファイル: Payment.cs プロジェクト: biletnam/StangradCRM
 protected override void prepareSaveData(HTTPManager.HTTPRequest http)
 {
     http.addParameter("paying", Paying.ToString().Replace(',', '.'));
     http.addParameter("id_bid", Id_bid);
     http.addParameter("id_manager", Id_manager);
     http.addParameter("payment_date", Payment_date.ToString("yyyy-MM-dd"));
     if (Id != 0)
     {
         http.addParameter("id", Id);
     }
 }
コード例 #4
0
        public ActionResult Create([Bind(Include = "PayingId,StudentsId,ServicePayment,DatePayment")] Paying payStudent)
        {
            if (ModelState.IsValid)
            {
                db.Paying.Add(payStudent);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(payStudent));
        }
コード例 #5
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Paying payStudent = db.Paying.Find(id);

            if (payStudent == null)
            {
                return(HttpNotFound());
            }
            return(View(payStudent));
        }
コード例 #6
0
        public void BuyWithAuthentification(string sex, string name, string surname, string email, string password, string date,
                                            string company, string vat, string adress, string storage, string zipcod, string city, string phone)
        {
            SearchPage sp = mainPage.ClickOnT();

            sp.ClickOn();
            Thread.Sleep(2000);
            Cart        ct = sp.AddToCart();
            PrivateData pd = ct.ClickOnDiv();
            LogIn       lg = pd.LogIn();

            lg.EnterEmail(email).EnterPassword(password).ContinueBuying();
            ShippingMethod SM = lg.SM();

            SM.Coment();
            Paying pay = SM.Pay();

            pay.SwichPay();
        }
コード例 #7
0
        public void ShoppiningTest(string sex, string name, string surname, string email, string password, string date,
                                   string company, string vat, string adress, string storage, string zipcod, string city, string phone)
        {
            SearchPage sp = mainPage.ClickOnT();

            sp.ClickOn();
            Thread.Sleep(2000);
            Cart        ct = sp.AddToCart();
            PrivateData pd = ct.ClickOnDiv();

            pd.Sex(sex).FirstName(name).LastName(surname).Email(email).Password(password).Brithday(date).Agree();
            Adress aadress = pd.ClickOnContinue();

            aadress.Company(company).PDV(vat)._Adress(adress).Storage(storage).PostCode(zipcod).City(city).Phone(phone);
            ShippingMethod SM = aadress.SM();

            SM.Coment();
            Paying pay = SM.Pay();

            pay.SwichPay();
        }
コード例 #8
0
ファイル: PayingController.cs プロジェクト: ysxmz/Ticket0
        public async Task <string> Post([FromBody] Paying paying)
        {
            var paymentItem = await _context.PaymentItems.FindAsync(paying.Id);

            if (paymentItem == null)
            {
                return("there is no payment id:" + paying.Id);
            }

            if (paying.opertion.Equals("pay"))
            {
                if (!paymentItem.State.Equals("unpaid"))
                {
                    return("payment id " + paying.Id + " is not unpaid");
                }
                paymentItem.State   = "paid";
                paymentItem.PayDate = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
                _context.Entry(paymentItem).State = EntityState.Modified;
                await _context.SaveChangesAsync();

                //发布一个信息,告诉Ticket去更新票的状态
                TicketMessage ticketMessage = new TicketMessage
                {
                    TicketId = paymentItem.TicketId,
                    State    = 1
                };
                await _bus.PublishAsync(ticketMessage);

                string mess = "payment id " + paying.Id + " is paid and ticket " + paymentItem.TicketId + " is sold now";
                return(mess);
            }
            else if (paying.opertion.Equals("cancel"))
            {
                if (!paymentItem.State.Equals("unpaid"))
                {
                    return("payment id " + paying.Id + " is not unpaid");
                }
                paymentItem.State = "cancelled";
                _context.Entry(paymentItem).State = EntityState.Modified;
                await _context.SaveChangesAsync();

                //发布一个信息,告诉Ticket去更新票的状态
                TicketMessage ticketMessage = new TicketMessage
                {
                    TicketId = paymentItem.TicketId,
                    State    = 2
                };
                await _bus.PublishAsync(ticketMessage);

                string mess = "payment id " + paying.Id + " is cancelled and ticket " + paymentItem.TicketId + " is available now";
                return(mess);
            }
            else if (paying.opertion.Equals("refund"))
            {
                if (!paymentItem.State.Equals("paid"))
                {
                    return("payment id " + paying.Id + " is not paid");
                }

                paymentItem.State = "refund";
                _context.Entry(paymentItem).State = EntityState.Modified;
                await _context.SaveChangesAsync();

                //发布一个信息,告诉Ticket去更新票的状态
                TicketMessage ticketMessage = new TicketMessage
                {
                    TicketId = paymentItem.TicketId,
                    State    = 2
                };
                await _bus.PublishAsync(ticketMessage);

                string mess = "payment id " + paying.Id + " is refund and ticket " + paymentItem.TicketId + " is available now";
                return(mess);
            }
            else
            {
                string mess = "opertion should be pay, cancel or refund ";
                return(mess);
            }
        }