public ActionResult Edit([Bind(Include = "IdLogin,Email,UserLog,Password,Active,Profile,Name,LastName,UserLogin")] ACCESS aCCESS) { if (ModelState.IsValid) { db.Entry(aCCESS).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aCCESS)); }
public ActionResult Create([Bind(Include = "IdTypeTransfer,DescType")] TypeTransfer typeTransfer) { if (ModelState.IsValid) { db.TypeTransfer.Add(typeTransfer); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(typeTransfer)); }
public ActionResult Create([Bind(Include = "IdCity,City,PriceOne,Pricetwo")] PriceCities priceCities) { if (ModelState.IsValid) { db.PriceCities.Add(priceCities); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(priceCities)); }
public ActionResult Create([Bind(Include = "EventID,Subject,Description,Start,End,ThemeColor,IsFullDay")] Event @event) { if (ModelState.IsValid) { db.Events.Add(@event); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(@event)); }
public ActionResult Create([Bind(Include = "IdMetingPoint,DescMetingPoint")] MetingPoint metingPoint) { if (ModelState.IsValid) { db.MetingPoint.Add(metingPoint); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(metingPoint)); }
public ActionResult Create([Bind(Include = "IdConfigApp,NameApp,AccountPOP3,PortPOP3,AccountSMTP,PortSMTP,account,PasswordAccount")] ConfigApp configApp) { if (ModelState.IsValid) { db.ConfigApp.Add(configApp); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(configApp)); }
public ActionResult Create([Bind(Include = "IdSalesContact,Contact,Address,City,Phone,ThemeColor,PercentPay")] SalesContact salesContact) { if (ModelState.IsValid) { db.SalesContact.Add(salesContact); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(salesContact)); }
public ActionResult Create([Bind(Include = "IdSalesSource,Value,PercentPay,TypePay,Status,Note,IdSalesContact,NumInvoice")] SalesSource salesSource) { if (ModelState.IsValid) { db.SalesSource.Add(salesSource); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdSalesContact = new SelectList(db.SalesContact, "IdSalesContact", "Contact", salesSource.IdSalesContact); return(View(salesSource)); }
public ActionResult Create([Bind(Include = "IdPassenger,Name,Phone,Phone2,Email,IdTypeVisa")] Passenger passenger) { if (ModelState.IsValid) { db.Passenger.Add(passenger); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdTypeVisa = new SelectList(db.TypeVisa, "IdTypeVisa", "DescTypeVisa", passenger.IdTypeVisa); return(View(passenger)); }
public ActionResult Create([Bind(Include = "IdBankInfo,BankAddress,BankPostalCode,BankCity,BankProvince,AccountNumber,SwiftCode,TransitNumber,Customer,IdBank")] BankInfo bankInfo) { if (ModelState.IsValid) { db.BankInfo.Add(bankInfo); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdBank = new SelectList(db.Bank, "IdBank", "Name", bankInfo.IdBank); return(View(bankInfo)); }
public ActionResult Create([Bind(Include = "IdDestination,Name,Address,PostalCode,Phone,Mobile,IdTypeDestination,IdSalesContact,IdCity")] Destination destination) { if (ModelState.IsValid) { db.Destination.Add(destination); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdSalesContact = new SelectList(db.SalesContact, "IdSalesContact", "Contact", destination.IdSalesContact); ViewBag.IdTypeDestination = new SelectList(db.TypeDestination, "IdTypeDestination", "DescTypeDestination", destination.IdTypeDestination); ViewBag.IdCity = new SelectList(db.PriceCities, "IdCity", "City", destination.IdCity); return(View(destination)); }
public JsonResult SaveEvent(Event e) { var status = false; using (atripservicesEntities dc = new atripservicesEntities()) { if (e.EventID > 0) { //Update the event var v = dc.Events.Where(a => a.EventID == e.EventID).FirstOrDefault(); if (v != null) { v.Subject = e.Subject; v.Start = e.Start; v.End = e.End; v.Description = e.Description; v.IsFullDay = e.IsFullDay; v.ThemeColor = e.ThemeColor; } } else { dc.Events.Add(e); } dc.SaveChanges(); status = true; } return(new JsonResult { Data = new { status = status } }); }
public JsonResult SaveEvent2(string EventID, string Subject, string Start, string End, string Description, string ThemeColor, string IsFullDay, string IdTransEst) { var status = false; using (atripservicesEntities dc = new atripservicesEntities()) { if (Convert.ToInt32(EventID) > 0) { //Update the event var v = dc.Events.Where(a => a.EventID == Convert.ToInt32(EventID)).FirstOrDefault(); if (v != null) { v.Subject = Subject; v.Start = Convert.ToDateTime(Start); v.End = Convert.ToDateTime(End); v.Description = Description; v.IsFullDay = Convert.ToBoolean(IsFullDay); v.ThemeColor = ThemeColor; v.IdTransEst = Convert.ToInt32(IdTransEst); dc.Events.AddOrUpdate(v); status = true; } } else { //dc.Events.Add(e); } dc.SaveChanges(); //status1 = true; } //return new JsonResult { Data = new { status = status1 } }; return(Json(new { success = true, status }, JsonRequestBehavior.AllowGet)); }
protected void DeleteLastIdYesterday() { atripservicesEntities DB = new atripservicesEntities(); var dt = DateTime.Now.AddDays(-1); DB.LastIPReservation.RemoveRange(DB.LastIPReservation.Where(p => p.DateReservation < dt)); DB.SaveChanges(); }
//[Authorize(Roles = "Administrador")] public ActionResult AddNew(string TypeDest) { td.DescTypeDestination = TypeDest; db.TypeDestination.Add(td); db.SaveChanges(); return(Json(new { success = true, oldval = TypeDest }, JsonRequestBehavior.AllowGet)); }
public ActionResult Create([Bind(Include = "IdTypeDestination,DescTypeDestination")] TypeDestination typeDestination) { if (ModelState.IsValid) { db.TypeDestination.Add(typeDestination); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(typeDestination)); }
public JsonResult DeleteEvent(int eventID) { var status = false; using (atripservicesEntities dc = new atripservicesEntities()) { var v = dc.Events.Where(a => a.EventID == eventID).FirstOrDefault(); if (v != null) { dc.Events.Remove(v); dc.SaveChanges(); status = true; } } return(new JsonResult { Data = new { status = status } }); }
public ActionResult Create([Bind(Include = "IdLogin,Email,UserLog,Password,Active,Profile,Name,LastName,UserLogin")] ACCESS aCCESS) { if (ModelState.IsValid) { using (atripservicesEntities db = new atripservicesEntities()) { var vLogin = db.ACCESS.Where(p => p.Email.Equals(aCCESS.Email)).FirstOrDefault(); if (vLogin != null) { ModelState.AddModelError("", "Already registered user!!! Please, use other email."); return(View(new ACCESS())); } else { db.ACCESS.Add(aCCESS); db.SaveChanges(); return(RedirectToAction("Index")); } } } return(View(aCCESS)); }
protected void SaveTranferTestimate() { atripservicesEntities DBTrip = new atripservicesEntities(); TransferEstimate te = new TransferEstimate(); Passenger pa = new Passenger(); ReservationRequest rr = new ReservationRequest(); LastIPReservation ip = new LastIPReservation(); DeleteLastIdYesterday(); if (VerifyLastIP(Request.UserHostAddress.ToString()) == false) { Library.DisplayAtertSweet(this, "Você já pediu uma reserva!", "Aguarde seu pedido ser processado, logo lhe enviaremos um email.", Library.MessageType.Info); return; } //Transfer Estimate te.FlightNumber = txtFlightNumber.Text.ToUpper(); if (!String.IsNullOrEmpty(txtDateVoo.Text)) { te.DateFligh = Convert.ToDateTime(txtDateVoo.Text); } else { te.DateFligh = null; } if (!String.IsNullOrEmpty(txtTimeVoo.Text)) { te.TimeFligh = txtTimeVoo.Text; } else { te.TimeFligh = null; } if (!String.IsNullOrEmpty(txtTime.Text)) { te.TimePiDo = txtTime.Text; } else { te.TimePiDo = null; } if (!String.IsNullOrEmpty(txtDateEstimate.Text)) { te.DateTransEst = Convert.ToDateTime(txtDateEstimate.Text); } else { te.DateTransEst = null; } te.DateAprove = null; te.DateRequestEstimate = DateTime.Now; te.Discount = 0; te.IdMetingPoint = 1; te.QtyPassenger = Convert.ToInt32(ddlQtyPassenger.SelectedValue); te.QtyPassengerKids = Convert.ToInt32(ddlQtyKids.SelectedValue); te.QtyMalaGr = Convert.ToInt32(ddlQtyLuggage.SelectedValue); te.QtyMalaPq = Convert.ToInt32(ddlQtyCarryon.SelectedValue); te.CityFromId = 1; te.CityToId = Convert.ToInt32(ddlCityTo.SelectedValue); te.TransferAmount = 0; te.Discount = null; te.FinalPrice = FinalPrice; te.NamePassenger = txtNamePassenger.Text; te.Phone = txtPhonePassenger.Text; te.Phone2 = ""; te.Email = txtEmailPassenger.Text; te.TypeVisa = ddlTypeVisa.SelectedItem.ToString(); te.Note = "Reservation Request"; te.IdAprove = 0; te.IdTypeDestination = Convert.ToInt32(ddlTypeDestination.SelectedValue); te.IdDestination = 1; te.IdSales = 1; te.IdTypeTransfer = Convert.ToInt32(ddlTypeTransfer.SelectedValue); te.IdTypePayment = 0; te.IdStatusPayment = 0; DBTrip.TransferEstimate.Add(te); DBTrip.SaveChanges(); var idte = te.IdTransEst; //Verify IP ip.IP = Request.UserHostAddress.ToString(); ip.DateReservation = DateTime.Now; DBTrip.LastIPReservation.Add(ip); DBTrip.SaveChanges(); //Passenger pa.Name = txtNamePassenger.Text; pa.Phone = txtPhonePassenger.Text; pa.Phone2 = ""; pa.Email = txtEmailPassenger.Text; pa.IdTypeVisa = Convert.ToInt32(ddlTypeVisa.SelectedValue); DBTrip.Passenger.Add(pa); DBTrip.SaveChanges(); var idpa = pa.IdPassenger; //Reservation Request (Destination) rr.NamePD = txtNameDestination.Text; rr.AddressPD = txtAddress.Text; rr.PostalCodePD = txtPostalCode.Text; rr.PhonePD = txtPhoneContact.Text; rr.MobilePD = ""; rr.IdCityPD = Convert.ToInt32(ddlCityTo.SelectedValue); rr.IdTypeDestinationPD = Convert.ToInt32(ddlTypeDestination.SelectedValue); rr.IdPassenger = idpa; rr.IdTransferEst = idte; DBTrip.ReservationRequest.Add(rr); DBTrip.SaveChanges(); ClearReservation(); if (lblSend.Text == "Send") { Library.DisplayAtertSweet(this, "Success!", "Your reservation request was sent successfully! Wait for our contact.", Library.MessageType.Success); } if (lblSend.Text == "Enviar") { Library.DisplayAtertSweet(this, "Pedido Enviado!", "Seu pedido de reserva foi enviado com sucesso! Aguarde nosso contato.", Library.MessageType.Success); } if (lblSend.Text == "Enviar ") { Library.DisplayAtertSweet(this, "Éxito!", "Su solicitud de reserva fue enviada con éxito! Espera nuestro contacto.", Library.MessageType.Success); } ClearReservation(); }