protected string basKaTicketKaIzafah(string from, string to, string Sayahat_ki_Tanzeem, string dt, string pp) { BusTicket ticket = new BusTicket(from, to, Sayahat_ki_Tanzeem, dt, pp); string key = ticket.MunfaridKuleed; string result; if (this.Dict.ContainsKey(key)) { result = "Duplicate ticket"; } else { this.Dict.Add(key, ticket); string fromToKey = ticket.FromToKey; this.Dict2.Add(fromToKey, ticket); this.Dict3.Add(ticket.DateAndTime, ticket); result = "Ticket added"; } if (result.Contains("added")) { busTicketsCount++; } return(result); }
public string AddBusTicket(string departureTown, string arrivalTown, string travelCompany, DateTime departureDateAndTime, decimal price) { var ticket = new BusTicket(departureTown, arrivalTown, travelCompany, departureDateAndTime, price); var result = this.AddTicket(ticket); return(result); }
public string AddBusTicket(string from, string to, string busCompany, DateTime dateTime, decimal price) { BusTicket ticket = new BusTicket(from, to, busCompany, dateTime, price); string key = ticket.UniqueKey; string result; if (this.ticketCatalog.ContainsKey(key)) { result = "Duplicated " + ticket.Type.ToString().ToLower(); } else { this.ticketCatalog.Add(key, ticket); string fromToKey = ticket.FromToKey; this.ticketCatalogByFromToKey.Add(fromToKey, ticket); this.ticketCatalogByDateAndTimeKey.Add(ticket.DateAndTime, ticket); result = ticket.Type + " created"; } if (result.Contains("created")) { this.busTicketsCount++; } return(result); }
protected string cbt(string from, string to, string Sayahat_ki_Tanzeem, string dt, string pp) { BusTicket ticket = new BusTicket(from, to, Sayahat_ki_Tanzeem, dt, pp); string key = ticket.property2; string result; if (this.Dict.ContainsKey(key)) { result = "Duplicated " + ticket.Type.ToLower(); } else { this.Dict.Add(key, ticket); string fromToKey = ticket.FromToKey; this.Dict2.Add(fromToKey, ticket); this.Dict3.Add(ticket.DateAndTime, ticket); result = ticket.Type + " created"; } if (result.Contains("created")) { busTicketsCount++; } return(result); }
public string DeleteBusTicket(string departureTown, string arrivalTown, string travelCompany, DateTime departureDateTime) { var ticket = new BusTicket(departureTown, arrivalTown, travelCompany, departureDateTime); string uniqueKey = ticket.TicketKey; var result = this.DeleteTicket(TicketType.Bus, uniqueKey); return(result); }
private string DeleteBusTicket(string from, string to, string travelCompany, string dateAndTime) { BusTicket ticket = new BusTicket(from, to, travelCompany, dateAndTime); string result = this.DeleteTicket(ticket); if (result.Contains(GlobalConstants.Deleted)) { this.busTicketsCount--; } return(result); }
public string AddBusTicket(string from, string to, string travelCompany, DateTime dateTime, decimal price) { BusTicket ticket = new BusTicket(from, to, travelCompany, dateTime, price); string result = this.AddTicket(ticket); if (result.Contains("added")) { this.busTicketsCount++; } return(result); }
public string DeleteBusTicket(string from, string to, string travelCompany, DateTime dateTime) { BusTicket ticket = new BusTicket(from, to, travelCompany, dateTime); string result = this.DeleteTicket(ticket); if (result.Contains("deleted")) { this.busTicketsCount--; } return(result); }
private string DeleteBusTicket(string from, string to, string Sayahat_ki_Tanzeem, string dt) { BusTicket ticket = new BusTicket(from, to, Sayahat_ki_Tanzeem, dt); string result = AddDeleteTicket(ticket, false); if (result.Contains("deleted")) { busTicketsCount--; } return(result); }
public ActionResult Sold(BusTicket form) { // var soldTicket = Database.Session.Load<SoldTicket>(bus_id); //if (soldTicket == null) // return HttpNotFound(); if (form == null) { return(HttpNotFound()); } return(View(form)); }
public string AddBusTicket(string from, string to, string travelCompany, DateTime dateTime, decimal price) { if (!this.busTickets.Any(t => t.From == from && t.To == to && t.TravelComany == travelCompany && t.DepartureDateAndTime == dateTime)) { var ticket = new BusTicket(from, to, travelCompany, dateTime, price); this.busTickets.Add(ticket); return("Ticket added"); } return("Duplicate ticket"); }
public string AddBusTicket(string from, string to, string travelCompany, DateTime dateTime, decimal price) { if (!this.busTickets.Any(t => t.From == from && t.To == to && t.TravelComany == travelCompany && t.DepartureDateAndTime == dateTime)) { var ticket = new BusTicket(from, to, travelCompany, dateTime, price); this.busTickets.Add(ticket); return "Ticket added"; } return "Duplicate ticket"; }
public string AddBusTicket(string from, string to, string travelCompany, string dateTime, string price) { BusTicket ticket = new BusTicket(from, to, travelCompany, dateTime, price); if (this.ticketsByKey.ContainsKey(ticket.Key)) { return "Duplicate ticket"; } this.ticketsByKey.Add(ticket.Key, ticket); string fromToKey = ticket.FromToKey; this.ticketsByFromTo.Add(fromToKey, ticket); this.ticketsByDateTime.Add(ticket.DateAndTime, ticket); this.busTicketsCount++; return "Ticket added"; }
public ActionResult BusSeat(BusTicket form, int id) // How come id parameter does work? when it didnt work for admin form ActionResult's { if (!ModelState.IsValid) { return(View(form)); } SoldTicket ticket; var _bus = Database.Session.Load <BusInfo>(id); if (_bus.KoltukSayisi == 0) { ModelState.AddModelError("KoltukSayisi", "Tum koltuklar dolmustur!"); } _bus.KoltukSayisi -= 1; ticket = new SoldTicket() { RouteID = id, YolcuAd = form.YolcuAd, YolcuSoyad = form.YolcuSoyad, Telefon = form.Telefon, Email = form.Email, KoltukNo = form.KoltukNo, KimlikNo = form.KimlikNo }; form.Bus_ID = id; form.nereden = _bus.KalkisDest; form.nereye = _bus.VarisDest; form.binisSaat = _bus.KalkisTime; form.inisSaat = _bus.VarisTime; form.tarih = _bus.KalkisDate; Database.Session.SaveOrUpdate(ticket); Database.Session.Flush(); Database.Session.SaveOrUpdate(_bus); Database.Session.Flush(); return(View("Sold", form)); }
public string AddBusTicket( string departureTown, string arrivalTown, string travelCompany, DateTime date, decimal price) { BusTicket ticket = new BusTicket( departureTown, arrivalTown, travelCompany, date.ToString("dd.MM.yyyy HH:mm"), price.ToString()); string result = this.AddDeleteTicket(ticket, true); if (result == "Ticket added") { this.busTicketsCount++; } return result; }
protected string AddBusTicket(string from, string to, string travelCompany, string dateTime, string price) { BusTicket ticket = new BusTicket(from, to, travelCompany, dateTime, price); string key = ticket.DataKey; string result; if (this.ticketsByDataKey.ContainsKey(key)) { result = GlobalConstants.Duplicated + ticket.Type.ToString().ToLower(); } else { this.ticketsByDataKey.Add(key, ticket); string fromToKey = ticket.FromToKey; this.ticketsByFromToKey.Add(fromToKey, ticket); this.ticketsByDateAndTime.Add(ticket.DateAndTime, ticket); result = ticket.Type + " " + GlobalConstants.Created; this.busTicketsCount++; } return(result); }
private string DeleteBusTicket(string from, string to, string ccc, string dt) { BusTicket ticket = new BusTicket(from, to, ccc, dt); string result = this.DeleteTicket(ticket); if (result.Contains("deleted")) { this.busTicketsCount--; } return result; }
public string AddBusTicket(string from, string to, string travelCompany, DateTime dateTime, decimal price) { var ticket = new BusTicket(from, to, travelCompany, dateTime, price); var result = this.AddTicket(ticket); return result; }
public string DeleteBusTicket(string departureTown, string arrivalTown, string travelCompany, DateTime dateTime) { BusTicket ticket = new BusTicket(departureTown, arrivalTown, travelCompany, dateTime.ToString("dd.MM.yyyy HH:mm")); string result = this.AddDeleteTicket(ticket, false); if (result.Contains("deleted")) { this.busTicketsCount--; } return result; }
public string DeleteBusTicket(string from, string to, string company, DateTime dt) { var ticket = new BusTicket(from, to, company, dt); var result = this.DeleteTicket(ticket); if (result.Contains("deleted")) { this.busTicketsCount--; } return result; }
public string DeleteBusTicket(string from, string to, string travelCompany, DateTime dateTime) { var ticket = new BusTicket(from, to, travelCompany, dateTime); var result = this.DeleteTicket(ticket); return result; }
protected string basKaTicketKaIzafah(string from, string to, string Sayahat_ki_Tanzeem, string dt, string pp) { var ticket = new BusTicket(from, to, Sayahat_ki_Tanzeem, dt, pp); var key = ticket.MunfaridKuleed; string result; if (this.Dict.ContainsKey(key)) { result = "Duplicate ticket"; } else { this.Dict.Add(key, ticket); var fromToKey = ticket.FromToKey; this.Dict2.Add(fromToKey, ticket); this.Dict3.Add(ticket.DateAndTime, ticket); result = "Ticket added"; } if (result.Contains("added")) { this.busTicketsCount++; } return result; }
public string AddBusTicket(string from, string to, string company, DateTime dt, decimal price) { var ticket = new BusTicket(from, to, company, dt, price); var key = ticket.TicketKey; string result; if (this.TicketKey_Ticket.ContainsKey(key)) { result = "Duplicated " + ticket.Type; } else { this.TicketKey_Ticket.Add(key, ticket); var fromToKey = ticket.FromToKey; this.FromTo_Tickets.Add(fromToKey, ticket); this.DateTime_Tickets.Add(ticket.DateAndTime, ticket); result = ticket.Type + " created"; } if (result.Contains("created")) { this.busTicketsCount++; } return result; }
private string DeleteBusTicket(string from, string to, string Sayahat_ki_Tanzeem, string dt) { var ticket = new BusTicket(from, to, Sayahat_ki_Tanzeem, dt); var result = this.AddDeleteTicket(ticket, false); if (result.Contains("deleted")) { this.busTicketsCount--; } return result; }
public string DeleteBusTicket( string from, string to, string company, DateTime dateAndTime) { BusTicket ticket = new BusTicket(from, to, company, dateAndTime); string result = this.DeleteTicketByUniqueKey(ticket.UniqueKey); return result; }
public string AddBusTicket( string from, string to, string company, DateTime dateAndTime, decimal price) { BusTicket ticket = new BusTicket(from, to, company, dateAndTime, price); string result = this.AddTicket(ticket); return result; }
protected string AddBusTicket(string from, string to, string companyName, string dt, string pp) { BusTicket ticket = new BusTicket(from, to, companyName, dt, pp); string key = ticket.property2; string result; if (this.ticketsByKey.ContainsKey(key)) { result = "Duplicated " + ticket.Type.ToLower(); } else { this.ticketsByKey.Add(key, ticket); string fromToKey = ticket.FromToKey; this.ticketsByFromTo.Add(fromToKey, ticket); this.ticketsByDateTime.Add(ticket.DateAndTime, ticket); result = ticket.Type + " created"; } if (result.Contains("created")) { this.busTicketsCount++; } return result; }
public string DeleteBusTicket(string from, string to, string travelCompany, string dateTime) { BusTicket ticket = new BusTicket(from, to, travelCompany, dateTime); string result = this.DeleteTicket(ticket); if (result.Contains("deleted")) { this.busTicketsCount--; } return result; }