private void btnRegistrer_Click(object sender, EventArgs e) { if (MetroMessageBox.Show(this, Strings.ConfRegister, Strings.Register, MessageBoxButtons.YesNo, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { AccountDAO adao = new AccountDAO(); //Tratamento da Combo Box Tickets TicketDAO tdao = new TicketDAO(); idticket = tdao.FindIdByCb(mcbTicket.Text); Account account = new Account() { ClientId = int.Parse(lblClientId.Text), Status = "Ativo", TicketId = idticket }; adao.Add(account); MetroMessageBox.Show(this, Strings.SuccessRegistered, Strings.Registered, MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); txtEnterAccount.Text = lblClientId.Text; btnSearch_Click(sender, e); panelAddAcc.Visible = false; lblTitle.Visible = true; lblTitle2.Visible = true; lblTitle3.Visible = false; lbltitle4.Visible = false; } }
void AutoCreateTicketsByShowTimes(ShowTimes showTimes) { int result = 0; Cinema cinema = CinemaDAO.GetCinemaByName(showTimes.CinemaName); int Row = cinema.Row; int Column = cinema.SeatInRow; for (int i = 0; i < Row; i++) { int temp = i + 65; char nameRow = (char)(temp); for (int j = 1; j <= Column; j++) { string seatName = nameRow.ToString() + j; result += TicketDAO.InsertTicketByShowTimes(showTimes.ID, seatName); } } if (result == Row * Column) { int ret = ShowTimesDAO.UpdateStatusShowTimes(showTimes.ID, 1); if (ret > 0) { MessageBox.Show("TẠO VÉ TỰ ĐỘNG THÀNH CÔNG!", "THÔNG BÁO"); } } else { MessageBox.Show("TẠO VÉ TỰ ĐỘNG THẤT BẠI!", "THÔNG BÁO"); } }
public MainCT() { trainDAO = new TrainDAO(); ticketDAO = new TicketDAO(); trainDAO = trainDAO.getInstance(); ticketDAO = ticketDAO.getInstance(); }
internal LoggedInAirlineFacade(LoginToken <AirlineCompany> token) { LoginToken = token; _ticketDAO = new TicketDAO(); _flightDAO = new FlightDAO(); _airlineDAO = new AirlineDAO(); }
public TGVService() { tgvDAO = new TGVDAO(); lineService = new LineService(); ticketDAO = new TicketDAO(); holidayPeriodService = new HolidayPeriodService(); }
public ChooseFromList SetConditionCFLWareHouse() { TicketDAO lObjTicketDAO = new TicketDAO(); string lStrWareHouse = lObjTicketDAO.GetWareHouse(DIApplication.Company.UserSignature.ToString()); List <string> lLstWareHouse = lObjTicketDAO.GetWareHousePather(lStrWareHouse).ToList(); SAPbouiCOM.ChooseFromListCollection lObjCFLs = null; ChooseFromList lObjCFL = null; SAPbouiCOM.Conditions lObjCons = new Conditions(); SAPbouiCOM.Condition lObjCon = null; lObjCFL = lObjCFLs.Item("CFL_Ware"); int i = 1; foreach (string lStrWareHousePather in lLstWareHouse) { lObjCon = lObjCons.Add(); lObjCon.Alias = "WhsCode"; lObjCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; lObjCon.CondVal = lStrWareHousePather; if (lLstWareHouse.Count() > i) { lObjCon.Relationship = BoConditionRelationship.cr_OR; } i++; } lObjCFL.SetConditions(lObjCons); return(lObjCFL); }
/// <summary> /// Agrega un item de venta de pesaje a la matriz /// </summary> public SAPbouiCOM.DBDataSource AddItemService(SAPbouiCOM.DBDataSource mDBDataSourceD) { mDBDataSourceD.Clear(); mDBDataSourceD.InsertRecord(0); QueryManager lObjQueryManager = new QueryManager(); string lSTrItemCode = lObjQueryManager.GetValue("U_Value", "Name", "PL_WEIGHING_SALE", "[@UG_CONFIG]"); mDBDataSourceD.SetValue("ItemCode", 0, lSTrItemCode); //Ponerlo en configuracion TicketDAO lObjTicketDAO = new TicketDAO(); string lStrPrice = lObjTicketDAO.GetPrice(lSTrItemCode); mDBDataSourceD.SetValue("Dscription", 0, "SERVICIO DE BASCULA"); mDBDataSourceD.SetValue("Price", 0, lStrPrice); if (lStrPrice == "0") { mDBDataSourceD.SetValue("Price", 0, "1"); } mDBDataSourceD.SetValue("Quantity", 0, "1"); mDBDataSourceD.SetValue("LineTotal", 0, "0"); return(mDBDataSourceD); }
public async Task <IActionResult> SubmitTicket(NewTicketRequest req) { TicketDAO ticketDAO = new TicketDAO(Constants.SQLConnection); TicketService ticketService = new TicketService(ticketDAO); AuthorizationService authorizationService = new AuthorizationService(); UserDAO userDAO = new UserDAO(Constants.SQLConnection); SessionService sessionService = new SessionService(userDAO, authorizationService); AuthorizationManager authorizationManager = new AuthorizationManager(authorizationService, sessionService); TicketManager ticketManager = new TicketManager(ticketService, authorizationManager); // Make sure we sent a correct category Constants.TicketCategories category; try { category = (Constants.TicketCategories)Enum.Parse(typeof(Constants.TicketCategories), req.category); } catch { return(BadRequest(Constants.TicketImproperCategory)); } Result <bool> success = await ticketManager.SubmitTicket(category, req.description); return(Ok(success)); }
private void frmTau_Load(object sender, EventArgs e) { ticketPrice = Times.TicketPrice; lblInformation.Text = "Thien Boat | " + Times.CinemaName + " | " + Times.thienboatName; lblTime.Text = Times.Time.ToShortDateString() + " | " + Times.Time.ToShortTimeString() + " - " + Times.Time.AddMinutes(thienboat.Time).ToShortTimeString(); if (thienboat.Poster != null) { picFilm.Image = TaudiDAO.byteArrayToImage(thienboat.Poster); } rdoAdult.Checked = true; chkCustomer.Enabled = false; grpLoaiVe.Enabled = false; LoadDataCinema(Times.CinemaName); ShowOrHideLablePoint(); listSeat = TicketDAO.GetListTicketsByShowTimes(Times.ID); LoadSeats(listSeat); }
/// <summary> /// 获取活动票务列表 /// </summary> /// <param name="entity">参数:实体</param> /// <param name="pageIndex">参数:当前页</param> /// <param name="pageSize">参数:分页个数</param> /// <param name="rowCount">参数:数据集的总数</param> /// <returns></returns> public TicketEntity[] GetList(TicketEntity entity, int pageIndex, int pageSize, out int rowCount) { List <IWhereCondition> wheres = new List <IWhereCondition>(); if (entity != null && !string.IsNullOrEmpty(entity.EventID)) { wheres.Add(new EqualsCondition() { FieldName = "T.EventID", Value = entity.EventID }); } if (entity != null && !string.IsNullOrEmpty(entity.TicketName)) { wheres.Add(new LikeCondition() { FieldName = "T.TicketName", HasLeftFuzzMatching = true, HasRightFuzzMathing = true, Value = entity.TicketName }); } List <OrderBy> orderbys = new List <OrderBy>(); orderbys.Add(new OrderBy() { FieldName = "TicketID", Direction = OrderByDirections.Asc }); PagedQueryResult <TicketEntity> pEntity = new TicketDAO(this.CurrentUserInfo).GetList(wheres.ToArray(), orderbys.ToArray(), pageIndex, pageSize); rowCount = pEntity.RowCount; return(pEntity.Entities); }
private void remove_Click(object sender, EventArgs e) { AskAdminID admin = new AskAdminID(); admin.ShowDialog(); int admin_id = admin.id; if (actions != null && ticket.admin_id == admin_id) { Boolean removed = false; if (this.admin.id == admin_id) { removed = TicketDAO.removeTicket(database, ticket.code); } if (removed) { MessageBox.Show("Ticket successfully removed"); OnTicketChanged(EventArgs.Empty); Close(); } else { MessageBox.Show("Error"); } } else { MessageBox.Show("Error"); } }
private void frmTheatre_Load(object sender, EventArgs e) { ticketPrice = Times.TicketPrice; lblInformation.Text = "Team4H Cinema - Nhà văn hóa sinh viên | " + Times.CinemaName + " | " + Times.MovieName; lblTime.Text = Times.Time.ToShortDateString() + " | " + Times.Time.ToShortTimeString() + " - " + Times.Time.AddMinutes(Movie.Time).ToShortTimeString(); if (Movie.Poster != null) { picFilm.Image = MovieDAO.byteArrayToImage(Movie.Poster); } rdoAdult.Checked = true; chkCustomer.Enabled = false; grpLoaiVe.Enabled = false; LoadDataCinema(Times.CinemaName); ShowOrHideLablePoint(); listSeat = TicketDAO.GetListTicketsByShowTimes(Times.ID); LoadSeats(listSeat); }
public async Task <IActionResult> GetTicketsAsync(TicketSearchRequest req) { StringValues jwtToken; try { Request.Headers.TryGetValue(Constants.JWTTokenHeader, out jwtToken); } catch { // Forbidden return(Forbid(Constants.UnauthorizedRequest)); } TicketDAO ticketDAO = new TicketDAO(Constants.SQLConnection); TicketService ticketService = new TicketService(ticketDAO); AuthorizationService authorizationService = new AuthorizationService(); UserDAO userDAO = new UserDAO(Constants.SQLConnection); SessionService sessionService = new SessionService(userDAO, authorizationService); AuthorizationManager authorizationManager = new AuthorizationManager(authorizationService, sessionService); TicketManager ticketManager = new TicketManager(ticketService, authorizationManager); Result <List <TicketRecord> > tickets = await ticketManager.GetTicketsAsync(jwtToken, req.filterParams); return(Ok(tickets)); }
// construtor public Facade() { this.servicoDAO = new ServicoDAO(); this.userDAO = new UserDAO(); this.historicoDAO = new HistoricoDAO(); this.estatisticaDAO = new EstatisticaDAO(); this.ticketDAO = new TicketDAO(); }
public ControllerClass(CinemaContext db) { hallDAO = new HallDAO(db); movieDAO = new MovieDAO(db); seanceDAO = new SeanceDAO(db); ticketDAO = new TicketDAO(db); view = new ViewClass(hallDAO.GetHalls(), hallDAO.GetSeats()); }
public List <Ticket> ViewListBl() { tdao = new TicketDAO(); List <Ticket> tickets = new List <Ticket>(); tickets = tdao.FindAll(); return(tickets); }
public TicketService() { ticketDAO = new TicketDAO(); vakDAO = new VakDAO(); VakTypeDAO = new VakTypeDAO(); wedstrijdDAO = new WedstrijdDAO(); shoppingCartDataDAO = new ShoppingCartDataDAO(); }
private void LesTransactions_Load(object sender, EventArgs e) { TicketDAO td = new TicketDAO(); foreach (metiers.Ticket SaleDetails in td.FindAll()) { dataGridView1.Rows.Add(SaleDetails.Id, SaleDetails.DateTicket, SaleDetails.IdEmploye.NomUtilisateur, SaleDetails.Total, "View Products"); } }
public void AddTicketBl(int noTickets, String title, int row, int seat, DateTime date) { tdao = new TicketDAO(); fdao = new FilmDAO(); Film existentfilm = new Film(fdao.GetFilm(title).title, fdao.GetFilm(title).production, fdao.GetFilm(title).distribution, fdao.GetFilm(title).premiereDate, fdao.GetFilm(title).scheduledHour, fdao.GetFilm(title).deadline, fdao.GetFilm(title).noOfTickets); fdao.UpdateFilm(existentfilm.title, existentfilm.production, existentfilm.distribution, existentfilm.premiereDate, existentfilm.scheduledHour, existentfilm.deadline, existentfilm.noOfTickets + noTickets); tdao.InsertTicket(noTickets, title, row, seat, date); }
public ControllerClass() { hallDAO = new HallDAO(); movieDAO = new MovieDAO(); seanceDAO = new SeanceDAO(); ticketDAO = new TicketDAO(); fullTextSearch = new FullTextSearch(); view = new ViewClass(hallDAO.GetHalls(), hallDAO.GetSeats()); }
public ActionResult Tickets() { if (ValidarSesion()) { TicketDAO uTkt = new TicketDAO(); return(View(uTkt.GetAllTicketsDAO())); } return(RedirectToAction("Index", "Login")); }
private void CreateSeat() { List <Ticket> t = new List <Ticket>(); TicketDAO tDAO = new TicketDAO(); t = tDAO.GetAllTicket(Sche_id); //load by id lich chieu Point[] p = new Point[t.Count]; //vi tri x,y cua 1 nut Button[] btn = new Button[t.Count]; //so luong nut int row = t[0].R_Row; //so hang int col = t[0].R_Col; //so cot tempprice = t[0].T_Price; pnlSeat.Size = new Size(55 * (col + 1), 40 * (row + 1)); //dai,rong //tim gia tri lon nhat for (int i = 0; i < t.Count; i++) { if (t[i].T_Price > tempprice) { tempprice = t[i].T_Price; } } for (int j = 0; j < row; j++) { for (int z = 0; z < col; z++) { int price = t[j * col + z].T_Price; btn[j * col + z] = new Button(); btn[j * col + z].Height = 35; btn[j * col + z].Width = 50; btn[j * col + z].Text = t[j * col + z].T_Name;; btn[j * col + z].Name = "" + (t[j * col + z].id_T); p[j * col + z] = new Point(); p[j * col + z].X = j * col + z * 90; p[j * col + z].Y = 0; if (price == tempprice) { btn[j * col + z].BackColor = Color.Red;//ghe co gia dac biet } if (t[j * col + z].Status == 0) { btn[j * col + z].BackColor = Color.Gray; //ghe da duoc chon btn[j * col + z].Enabled = false; //ghe da duoc chon } //log += p.ToString() + "\n"; btn[j * col + z].PointToClient(p[j * col + z]); //tinh toan toa do voi cac may khac nhau btn[j * col + z].Show(); //hien thi cho nguoi dung btn[j * col + z].Click += new EventHandler(this.btn_Click); } } pnlSeat.Controls.AddRange(btn);//add vao panel cac button }
private void btnSearch2_Click(object sender, EventArgs e) { nameevent = txtEvent.Text; TicketDAO tdao = new TicketDAO(); var ticket = tdao.FindTicketByEvent(nameevent); foreach (var t in ticket) { mcbTicket.Items.Add(t.Id + "-" + t.Name); } }
public void btn_Click(object sender, EventArgs e) { //Bat su kien click nut Button btn = sender as Button; string str = ""; if (strl.FindIndex(x => x.Equals(btn.Text)) == -1) { if (dem < 8) { strl.Add(btn.Text); ticketID.Add(btn.Name); btn.BackColor = Color.Yellow;//da chon ghe //pbNext.Enabled = true; dem++; if (dem > 0) { pbNext.Visible = true; } } else { MessageBox.Show("You can only choose up to 8 seats", "Error !", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { int getprice = new TicketDAO().GetMaxValue(Convert.ToInt32(btn.Name)); if (getprice == tempprice) { btn.BackColor = Color.Red;//chua chon ghe dac biet } else { btn.BackColor = Color.White;//chua chon } //pbNext.Enabled = false; dem--; strl.Remove(btn.Text); ticketID.Remove(btn.Name); if (dem == 0) { pbNext.Visible = false; } } strl.ForEach(item => { str += item + " "; }); txtShowSeat.Text = str; }
private void btnConfirme_Click(object sender, EventArgs e) { EmployerDAO empd = new EmployerDAO(); Employer emp2 = empd.Find(user); DateTime auj = DateTime.Now.Date; string d = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); DateTime auj2 = DateTime.Parse(d); // Employer emp = new Employer(0,"","","","","","","","","", auj,auj,null); decimal total, don, ret; total = Convert.ToDecimal(txtTotal.Text); don = Convert.ToDecimal(txtmtdonne.Text); ret = Convert.ToDecimal(txtmtretourne.Text); metiers.Ticket m = new metiers.Ticket(idTick, emp2, total, don, ret, auj2); //metiers.Ticket m2 = new metiers.Ticket(emp2, total, don, ret, auj); TicketDAO bd = new TicketDAO(); bd.Add(m); // bd.Add2(m2); metiers.Ticket m2 = bd.Find(Convert.ToInt32(txtnumtick.Text)); foreach (DataGridViewRow Row in dgvProd.Rows) { try { LigneTicketDAO ltb = new LigneTicketDAO(); int ProductId = Convert.ToInt32(Row.Cells["id"].Value); string ProductName = Row.Cells["Nomproduit"].Value.ToString(); decimal ProductPrice = Convert.ToDecimal(Row.Cells["prix"].Value); int ProductQuantity = Convert.ToInt32(Row.Cells["qte"].Value); decimal ProductTotal = Convert.ToDecimal(Row.Cells["totalProduit"].Value); ProduitDAO pb = new ProduitDAO(); Produit p = pb.Find(ProductId); LigneTicket l = new LigneTicket(0, p, m2, ProductName, ProductQuantity, ProductPrice, ProductTotal); ltb.Add(l); } catch { //means Rows are ended } } new Ticket(txtTotal.Text, txtmtdonne.Text, txtmtretourne.Text).ShowDialog(); this.Hide(); UIEmployer f1 = new UIEmployer(user); f1.Show(); }
//TICKET EDIT public ActionResult TicketEdit(long id) { if (IsLoggedIn()) { var s = TicketDAO.GetTicket(id); if (s != null) { return(View(s)); } return(RedirectToAction("OrderDetails")); } return(RedirectToAction("Index")); }
public UIEmployer(int user) { InitializeComponent(); this.user = user; EmployerDAO edao = new EmployerDAO(); nomUtilisateur = edao.FindNameByid(user); // label4.Text = user.ToString(); label4.Text = nomUtilisateur; TicketDAO T = new TicketDAO(); i = T.lastVal(); txtnumtick.Text = (i + 1).ToString(); }
private void btn_Salvar_Click(object sender, EventArgs e) { if (verifica()) { var ticket = new Ticket(); ticket.usuario = txb_Usuario.Text; var arrayData = txb_Date.Text.Split('/'); string data = (arrayData[2] + "-" + arrayData[1] + "-" + arrayData[0]); ticket.data = Convert.ToDateTime(data); ticket.categoria = txb_Categoria.Text; ticket.software = txb_Software.Text; ticket.prioridade = txb_Prazo.Text; ticket.descricao = txb_Descricao.Text; ticket.departamento = txb_Setor.Text; ticket.msgErro = txb_Erro.Text; ticket.status = txb_Status.Text; var ticketDAO = new TicketDAO(); try { if (editaTicket == null) { ticketDAO.create(ticket); MessageBox.Show("Ticket salvo com sucesso"); } else { ticket.ticketId = editaTicket.ticketId; ticketDAO.edit(ticket); frmVerTicket.atualizaTabela(); frmVerTicket.Show(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { this.Dispose(); } } else { MessageBox.Show("Preencha corretamente todas os Campos"); } }
public ActionResult TicketEdit(Ticket updateT) { if (ModelState.IsValid) { if (TicketDAO.UpdateTicket(updateT)) { return(RedirectToAction("OrderDetails", new { id = updateT.OrderID })); } else { ModelState.AddModelError("", "Error updating this ticket! Please refresh and try again."); } } return(View(updateT)); }
private void btnPayment_Click(object sender, EventArgs e) { if (listSeatSelected.Count == 0) { MessageBox.Show("Vui lòng chọn vé trước khi thanh toán!"); return; } string message = "Bạn có chắc chắn mua những vé: \n"; foreach (Button btn in listSeatSelected) { message += "[" + btn.Text + "] "; } message += "\nKhông?"; DialogResult result = MessageBox.Show(message, "Hỏi Mua", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (result == DialogResult.OK) { int ret = 0; if (chkCustomer.Checked == true) { foreach (Button btn in listSeatSelected) { Ticket ticket = btn.Tag as Ticket; ret += TicketDAO.BuyTicket(ticket.ID, ticket.Type, customer.ID, ticket.Price); } customer.Point += plusPoint; CustomerDAO.UpdatePointCustomer(customer.ID, customer.Point); } else { foreach (Button btn in listSeatSelected) { Ticket ticket = btn.Tag as Ticket; ret += TicketDAO.BuyTicket(ticket.ID, ticket.Type, ticket.Price); } } if (ret == listSeatSelected.Count) { MessageBox.Show("Bạn đã mua vé thành công!"); } } RestoreDefault(); this.OnLoad(new EventArgs()); }
public int addTicket(TicketData t) { DAO = new TicketDAO(); return DAO.addTicket(t); }
public void AnnuleerTicket(int TicketID) { DAO = new TicketDAO(); DAO.VerwijderPersonen(TicketID); DAO.AnnuleerTicket(TicketID); }
public DataTable getAllTickets() { DAO = new TicketDAO(); return DAO.getAllTickets().Tables[0]; }
public DataTable getDatum(int TicketID) { DAO = new TicketDAO(); return DAO.getDatum(TicketID).Tables[0]; }
public DataTable getPersonenPerTicket(int tr) { DAO = new TicketDAO(); return DAO.getPersonenPerTicket(tr).Tables[0]; }
public DataTable getTicket(TicketData t) { DAO = new TicketDAO(); return DAO.getTicket(t).Tables[0]; }
public DataTable getTicketById(int tr) { DAO = new TicketDAO(); return DAO.getTicketById(tr).Tables[0]; }