Esempio n. 1
0
        public ActionResult Edit(int id)
        {
            var ticket = new TicketDao().ViewDetail(id);

            SetViewDepartment();
            return(View(ticket));
        }
Esempio n. 2
0
        /// <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());
            }
        }
Esempio n. 3
0
        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"));
        }
Esempio n. 4
0
        /// <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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 public HomeController()
 {
     _controlDao        = new ControlDao();
     _ticketDao         = new TicketDao();
     _userDao           = new UserDao();
     _environmentDao    = new EnvironmentDao();
     _ticketCategoryDao = new TicketCategoryDao();
     _ticketStatusDao   = new TicketStatusDao();
 }
Esempio n. 7
0
        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));
        }
Esempio n. 8
0
 public TicketController()
 {
     _ticketDao         = new TicketDao();
     _ticketCategoryDao = new TicketCategoryDao();
     _ticketStatusDao   = new TicketStatusDao();
     _userDao           = new UserDao();
     _environmentDao    = new EnvironmentDao();
     _equipmentDao      = new EquipmentDao();
     _roomDao           = new RoomDao();
 }
Esempio n. 9
0
        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
            });
        }
Esempio n. 10
0
        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);
        }
Esempio n. 11
0
 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);
 }
Esempio n. 12
0
        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"));
        }
Esempio n. 13
0
        /// <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));
        }
Esempio n. 14
0
 public IList <Ticket> Get_MontoPagar(decimal Monto)
 {
     return(TicketDao.GetMontoPagar(Monto));
 }
Esempio n. 15
0
 public Ticket GetTicketMontoMensual_Porcentaje()
 {
     return(TicketDao.GetTicketMontoMensual_Porcentaje());
 }
Esempio n. 16
0
 public IList <Ticket> GetTickets(decimal MontoFactura)
 {
     return(TicketDao.GetMontoPagar(MontoFactura));
 }