// GET: Share/Delete/5 public ActionResult Delete(int id) { share s = shse.GetById(id); shse.DeleteShare(s); return(RedirectToAction("Index")); }
public bool Connect(String reader, share ShareMode, protocol PreferredProtocols) { protocol activeProtocol; uint ris = SCardConnect(context, reader, ShareMode, PreferredProtocols, out cardHandle, out activeProtocol); if (ris != 0) { return(false); } return(true); }
public ActionResult Create(share c) { if (ModelState.IsValid) { shse.AddShare(c); ViewBag.idBroker = new SelectList(dir.GetAllBrokers(), "idBroker", "title", c.idBroker); int idc = c.idshare; SendMail(idc); return(RedirectToAction("Index")); } else { return(View()); } }
// GET: Sponsor/SendMail/5 public ActionResult SendMail(int id) { share share = shse.GetById(id); string mailshare = share.email; using (MailMessage mail = new MailMessage("*****@*****.**", mailshare)) { mail.Subject = "Confirmation d achat daction"; mail.Body = "Hello, you just bought a share from our bank broker, good luck with that!"; mail.IsBodyHtml = false; SmtpClient smtp = new SmtpClient("smtp.gmail.com"); smtp.Host = "smtp.gmail.com"; smtp.EnableSsl = true; NetworkCredential networkCredential = new NetworkCredential("*****@*****.**", "yesmine_slim"); smtp.UseDefaultCredentials = true; smtp.Credentials = networkCredential; smtp.Port = 25; //smtp.Send(mail); ViewBag.Message = "Sent"; return(RedirectToAction("Index")); } }
public ActionResult Edit(int id, FormCollection collection) { share a = shse.GetById(id); a.amountInvested = float.Parse(collection["amountInvested"]); a.idBroker = int.Parse(collection["idBroker"]); // Convert.ChangeType(collection["broker"], typeof(broker)); a.currency1 = collection["currency1"]; a.currency2 = collection["currency2"]; a.dateOfPurchase = Convert.ToDateTime(collection["dateOfPurchase"]); a.dateOfSale = Convert.ToDateTime(collection["dateOfSale"]); a.gain = float.Parse(collection["gain"]); shse.UpdateShare(a); try { return(RedirectToAction("Index")); } catch { return(View(a)); } }
void Start() { share = new share(); }
public bool Connect(String reader, share ShareMode, protocol PreferredProtocols) { protocol activeProtocol; uint ris = SCardConnect(context, reader, ShareMode, PreferredProtocols, out cardHandle, out activeProtocol); if (ris != 0) return false; return true; }
static extern uint SCardConnect(IntPtr context, String reader, share ShareMode, protocol PreferredProtocols, out IntPtr cardHandle, out protocol ActiveProtocol);
static extern uint SCardConnect(IntPtr context, String reader, share ShareMode, protocol PreferredProtocols, out IntPtr cardHandle, out protocol ActiveProtocol);
public void UpdateShare(share s) { ut.ShareRepository.Update(s); ut.Commit(); }
public void DeleteShare(share s) { ut.ShareRepository.Delete(s); ut.Commit(); }
//public ShareService():base(ut) //{ //} public void AddShare(share s) { ut.ShareRepository.Add(s); ut.Commit(); }