public ActionResult Edit(int id) { var ticket = new TicketDao().ViewDetail(id); SetViewDepartment(); return(View(ticket)); }
/// <summary> /// 删除小票信息 /// </summary> /// <param name="param"></param> /// <returns></returns> public object Do_DelTicket(object param) { TicketParam listParam = JsonConvert.DeserializeObject <TicketParam>(param.ToString()); if (listParam == null) { throw new ApiException(CodeMessage.InvalidParam, "InvalidParam"); } #if DEBUG var openId = listParam.token; #endif #if !DEBUG AppBag appBag = AppContainer.GetAppBag(listParam.token); if (appBag == null) { throw new ApiException(CodeMessage.GetUserError, "GetUserError"); } var openId = appBag.Values; #endif TicketDao ticketDao = new TicketDao(); CodeMessage s = ticketDao.deleteTicket(openId, listParam); if (s.ToString() == "deleteTicketSuccess") { return("deleteTicketSuccess"); } else { throw new ApiException(s, s.ToString()); } }
public ActionResult Create(Ticket ticket) { if (ModelState.IsValid) { var dao = new TicketDao(); //lấy id trong session đăng nhập của quản trị lưu vào phiên tạo mới user var session = (UserLogin)Session[CommonConstants.USER_SESSION]; ticket.CreatedBy = session.UserName; ticket.CreatedDate = DateTime.Now; long id = dao.Insert(ticket); if (id > 0) { SetAlert("Thêm chấm công nhân viên thành công", "success"); return(RedirectToAction("Index", "Ticket")); } else { ModelState.AddModelError("", "Thêm chấm nhân viên công không thành công"); } } SetViewDepartment(); SetAlert("Error", "error"); return(RedirectToAction("Index", "Ticket")); }
/// <summary> /// 获取小票列表 /// </summary> /// <param name="param"></param> /// <returns></returns> public object Do_GetTicketList(object param) { ListParam listParam = JsonConvert.DeserializeObject <ListParam>(param.ToString()); if (listParam == null) { throw new ApiException(CodeMessage.InvalidParam, "InvalidParam"); } #if DEBUG var openId = listParam.token; #endif #if !DEBUG AppBag appBag = AppContainer.GetAppBag(listParam.token); if (appBag == null) { throw new ApiException(CodeMessage.GetUserError, "GetUserError"); } var openId = appBag.Values; #endif UserDao userDao = new UserDao(); userDao.insertUser(openId); TicketDao ticketDao = new TicketDao(); ListResult listResult = ticketDao.getListByOpenId(openId); return(listResult); }
public void SetViewTicket(long?selectedId = null) { var session = (UserLogin)Session[CommonConstants.USER_SESSION]; var dao = new TicketDao(); ViewBag.Ticket_ID = new SelectList(dao.ListAll(session.DepartmentID), "ID", "Name", selectedId); }
public HomeController() { _controlDao = new ControlDao(); _ticketDao = new TicketDao(); _userDao = new UserDao(); _environmentDao = new EnvironmentDao(); _ticketCategoryDao = new TicketCategoryDao(); _ticketStatusDao = new TicketStatusDao(); }
public ActionResult Index(string searchString, int page = 1, int pageSize = 10) { var session = (UserLogin)Session[CommonConstants.USER_SESSION]; var dao = new TicketDao(); var model = dao.ListAllPaging(searchString, page, pageSize, session.DepartmentID); ViewBag.SearchString = searchString; return(View(model)); }
public TicketController() { _ticketDao = new TicketDao(); _ticketCategoryDao = new TicketCategoryDao(); _ticketStatusDao = new TicketStatusDao(); _userDao = new UserDao(); _environmentDao = new EnvironmentDao(); _equipmentDao = new EquipmentDao(); _roomDao = new RoomDao(); }
private Models.Ticket TransformDaoToBusinessLogicTicket(TicketDao ticketDao) { var ticketType = _ticketType.GetTicketTypeById(ticketDao.TicketTypeId); return(new Models.Ticket() { Id = ticketDao.Id, TicketType = ticketType, Price = ticketDao.Price, FromDate = ticketDao.FromDate, ToDate = ticketDao.ToDate }); }
public Form1() { InitializeComponent(); airportDao = new AirportDao(); cabinTypeDao = new CabinTypeDao(); dao = new TicketDao(); list = dao.GetAllFlight(); SetView(); flightDetailReturn = new FlightDetail(true, list, this); flightDetailOneWay = new FlightDetail(false, list, this); flightDetailOneWay.btnHandler += FlightDetailOneWay_btnHandler; flightDetailOneWay.Dock = DockStyle.Fill; pnMainLoad.Controls.Add(flightDetailOneWay); }
public FlightDetail(bool isReturn, List <TicketViewModel> list, Form1 form1) { InitializeComponent(); this.form1 = form1; form1.applyHandler += Form1_applyHandler; form1.priceFilter += Form1_priceFilter; dao = new TicketDao(); this.l = list; if (isReturn) { lbName.Text = "Return flight detail"; } else { lbName.Text = "Outbound flight detail"; } SetDataToGrid(l, 1); }
public ActionResult Edit(Ticket ticket) { if (ModelState.IsValid) { var dao = new TicketDao(); var session = (UserLogin)Session[CommonConstants.USER_SESSION]; long id = dao.Update(ticket, session.UserName); if (id > 0) { SetAlert("Sửa thông tin nhân viên thành công", "success"); return(RedirectToAction("Index", "Ticket")); } else { SetAlert("Tài khoản hoặc mã nhân viên đã tồn tại!", "error"); return(RedirectToAction("Index", "Ticket")); } } SetViewDepartment(); SetAlert("Sửa thông tin nhân viên thất bại", "error"); return(RedirectToAction("Index", "Ticket")); }
/// <summary> /// 根据小票编号获取小票信息 /// </summary> /// <param name="param"></param> /// <returns></returns> public object Do_GetTicketItem(object param) { ItemParam itemParam = JsonConvert.DeserializeObject <ItemParam>(param.ToString()); if (itemParam == null) { throw new ApiException(CodeMessage.InvalidParam, "InvalidParam"); } #if DEBUG var openId = itemParam.token; #endif #if !DEBUG AppBag appBag = AppContainer.GetAppBag(itemParam.token); if (appBag == null) { throw new ApiException(CodeMessage.GetUserError, "GetUserError"); } var openId = appBag.Values; #endif TicketDao ticketDao = new TicketDao(); return(ticketDao.getTicketItem(openId, itemParam.ticketNum)); }
public IList <Ticket> Get_MontoPagar(decimal Monto) { return(TicketDao.GetMontoPagar(Monto)); }
public Ticket GetTicketMontoMensual_Porcentaje() { return(TicketDao.GetTicketMontoMensual_Porcentaje()); }
public IList <Ticket> GetTickets(decimal MontoFactura) { return(TicketDao.GetMontoPagar(MontoFactura)); }