public ActionResult DeleteConfirmed(int id) { Paying payStudent = db.Paying.Find(id); db.Paying.Remove(payStudent); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
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); } }
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)); }
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)); }
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(); }
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(); }
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); } }