コード例 #1
0
        public ActionResult GetTicketCategoryList(int PageIndex, string Name, string SortColumn, string SortOrder)
        {
            try
            {
                SpRepository _sp = new SpRepository();
                var          dt  = _sp.SpGetTicketingCategory(PageIndex, Name, SortColumn, SortOrder);

                List <TicketCategoryViewList> _list = new List <TicketCategoryViewList>();
                _list = General.DTtoList <TicketCategoryViewList>(dt);

                Dictionary <string, object> d = new Dictionary <string, object>();

                if (_list.Count() > 0)
                {
                    d.Add("Items", _list);
                    d.Add("PageNumber", _list[0].PageNo);
                    d.Add("PageCount", _list[0].T_Pages);
                    //d.Add("PageSize", _list[0].PageSize);
                }
                return(Json(d, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                //LogHelper.CreateLog(ex);
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #2
0
        public object GetMyEmployeesForOrganogram(string id)
        {
            SpRepository spRepository = new SpRepository();
            var          data         = spRepository.GetEmployeeByReportToId(id);

            return(data);
        }
コード例 #3
0
        public object GetEmployeeNumberForJobDescription()
        {
            SpRepository repository = new SpRepository();
            var          data       = repository.GetJobObjectiveDataForChart();

            return(data);
        }
コード例 #4
0
        public HttpResponseMessage GetCoupons(string sEventName, string packageName, string sCouponCode, int Pageindex, int Pagesize, string sortColumn, string sortOrder)
        {
            try
            {
                GenericRepository <TicketingEventsNew> _TicketingEventRepo = new GenericRepository <TicketingEventsNew>(_unitOfWork);
                GenericRepository <TourDate>           _TourDateRepo       = new GenericRepository <TourDate>(_unitOfWork);

                DataSet      ds  = new DataSet();
                SpRepository _sp = new SpRepository();
                ds = _sp.GetCouponsList();
                var _list = General.DTtoList <CouponsModel>(ds.Tables[0]);

                _list = _list.GroupBy(x => x.CouponCode, (key, group) => group.First()).OrderBy(p => p.ExpiryDate).ToList();

                //Pagination
                var _list2 = _list.ToPagedList(Pageindex - 1, Pagesize);

                Dictionary <string, object> d = new Dictionary <string, object>();
                if (_list2.Count() > 0)
                {
                    d.Add("Items", _list2);
                    d.Add("PageCount", _list2.PageCount);
                    d.Add("PageNumber", _list2.PageNumber);
                    d.Add("PageSize", Pagesize);

                    return(Request.CreateResponse(HttpStatusCode.OK, d));
                }
                else
                {
                    d.Add("Items", new List <ViewArtistlst>());
                    d.Add("PageCount", 0);
                    d.Add("PageNumber", 0);
                    d.Add("PageSize", 0);
                    return(Request.CreateResponse(HttpStatusCode.OK, d));
                }
            }
            catch (Exception ex)
            {
                //LogHelper.CreateLog(ex);
                return(Request.CreateResponse(HttpStatusCode.OK, ex.Message));
            }
        }