示例#1
0
        int IManagerReviewedRequests.GetRequestCount(decimal managerId, string searchKey, DateTime fromDate, DateTime toDate)
        {
            RequestRepository requestRep = new RequestRepository(false);
            //var ids = from o in quickSearchUnderMnagment
            //          select o.ID;
            //int result = requestRep.GetAllManagerReviewdCount(fromDate, toDate, RequestState.UnKnown, managerId, ids.ToArray());
            //return result;
            IList <decimal>    managerList    = new List <decimal>();
            BSubstitute        subBus         = new BSubstitute();
            IList <Substitute> substituteList = subBus.GetSubstitute(BUser.CurrentUser.Person.ID);

            if (substituteList.Count > 0)
            {
                managerList = subBus.GetSubstituteManagerList(BUser.CurrentUser.Person.ID);
            }
            managerList.Add(managerId);

            IList <InfoRequest> requests = requestRep.GetAllReviewdKartablItems(fromDate, toDate, RequestState.UnKnown, managerList, KartablOrderBy.RequestDate);

            requests = this.AppllySubstituteAccess(managerId, requests, substituteList);

            if (!Utility.IsEmpty(searchKey))
            {
                requests = this.AppllyQuickSearch(searchKey, requests);
            }
            return(requests.Count);
        }
示例#2
0
        /// <summary>
        /// جستجو بر اساس
        /// نام شخص
        /// شماره پرسنلی
        /// پیشکارت
        /// تاریخ ثبت ,شروع ,پایان
        /// توضیح درخواست
        /// </summary>
        /// <param name="managerId"></param>
        /// <param name="searchKey"></param>
        /// <param name="fromDate"></param>
        /// <param name="toDate"></param>
        /// <returns></returns>
        int IManagerKartabl.GetRequestCount(decimal managerId, string searchKey, DateTime fromDate, DateTime toDate)
        {
            //int result = requestRep.GetAllManagerKartablCount(fromDate, toDate, RequestType.None, managerId, ids.ToArray());
            IList <decimal>    managerList    = new List <decimal>();
            BSubstitute        subBus         = new BSubstitute();
            IList <Substitute> substituteList = subBus.GetSubstitute(BUser.CurrentUser.Person.ID);

            if (substituteList.Count > 0)
            {
                managerList = subBus.GetSubstituteManagerList(BUser.CurrentUser.Person.ID);
            }
            managerList.Add(managerId);

            RequestRepository requestRep = new RequestRepository(false);

            IList <InfoRequest> requests = requestRep.GetAllKartablItems(fromDate, toDate, RequestType.None, managerList, KartablOrderBy.None);

            requests = this.AppllySubstituteAccess(managerId, requests, substituteList);

            if (!Utility.IsEmpty(searchKey))
            {
                requests = this.AppllyQuickSearch(searchKey, requests);
            }

            return(requests.Count);
        }
示例#3
0
/*
 *      int ISubstituteKartabl.GetRequestCount(decimal managerId, decimal personId, IList<Person> quickSearchUnderMnagment, DateTime fromDate, DateTime toDate)
 *      {
 *          RequestRepository requestRep = new RequestRepository(false);
 *          var ids = from o in quickSearchUnderMnagment
 *                    select o.ID;
 *          int result = requestRep.GetAllSubstituteKartablCount(fromDate, toDate, RequestType.None, managerId, personId, ids.ToArray());
 *          return result;
 *      }
 *
 *      IList<InfoRequest> ISubstituteKartabl.GetAllRequests(decimal managerId, decimal personId, IList<Person> quickSearchUnderMnagment, DateTime fromDate, DateTime toDate, int pageIndex, int pageSize, KartablOrderBy orderby)
 *      {
 *          RequestRepository requestRep = new RequestRepository(false);
 *          var ids = from o in quickSearchUnderMnagment
 *                    select o.ID;
 *          IList<InfoRequest> result = requestRep.GetAllSubstituteKartabl(fromDate, toDate, RequestType.None, managerId, personId, pageIndex, pageSize, ids.ToArray(), orderby);
 *          return result;
 *      }
 *
 *      IList<InfoRequest> ISubstituteKartabl.GetAllRequests(decimal managerId, decimal personId, RequestType requestType, DateTime fromDate, DateTime toDate, int pageIndex, int pageSize, KartablOrderBy orderby)
 *      {
 *          RequestRepository requestRep = new RequestRepository(false);
 *          IList<InfoRequest> result = requestRep.GetAllSubstituteKartabl(fromDate, toDate, requestType, managerId, personId, pageIndex, pageSize, null, orderby);
 *          return result;
 *      }
 *
 *      IList<InfoRequest> ISubstituteKartabl.GetAllRequests(decimal managerId, decimal personId)
 *      {
 *          RequestRepository requestRep = new RequestRepository(false);
 *          IList<InfoRequest> result = requestRep.GetAllSubstituteKartabl(managerId, personId, KartablOrderBy.PersonCode);
 *          return result;
 *      }
 *
 *      int ISubstituteKartabl.GetRequestCountByFilter(decimal managerId, decimal personId, RequestType requestType, DateTime fromDate, DateTime toDate, IList<RequestFliterProxy> fliters)
 *      {
 *          throw new NotImplementedException();
 *      }
 *
 *      IList<InfoRequest> ISubstituteKartabl.GetAllRequestsByFilter(decimal managerId, decimal personId, RequestType requestType, DateTime fromDate, DateTime toDate, int pageIndex, int pageSize, IList<RequestFliterProxy> fliters, KartablOrderBy orderby)
 *      {
 *          throw new NotImplementedException();
 *      }*/

        #endregion

        #region IManagerKartabl Members

        int IManagerKartabl.GetRequestCount(decimal managerId, RequestType requestType, DateTime fromDate, DateTime toDate)
        {
            RequestRepository requestRep = new RequestRepository(false);
            //int result = requestRep.GetAllManagerKartablCount(fromDate, toDate, requestType, managerId, null);
            //return result;

            //int result1 = requestRep.GetAllManagerKartablItemsCount(fromDate, toDate, requestType, managerId);
            //int result2 = requestRep.GetAllSubstituteKartablItemsCount(fromDate, toDate, requestType, BUser.CurrentUser.Person.ID);
            //return result1 + result2;

            IList <decimal>    managerList    = new List <decimal>();
            BSubstitute        subBus         = new BSubstitute();
            IList <Substitute> substituteList = subBus.GetSubstitute(BUser.CurrentUser.Person.ID);

            if (substituteList.Count > 0)
            {
                managerList = subBus.GetSubstituteManagerList(BUser.CurrentUser.Person.ID);
            }
            managerList.Add(managerId);

            IList <InfoRequest> requests = requestRep.GetAllKartablItems(fromDate, toDate, RequestType.None, managerList, KartablOrderBy.None);

            requests = this.AppllySubstituteAccess(managerId, requests, substituteList);

            return(requests.Count);
        }
示例#4
0
        IList <InfoRequest> IManagerKartabl.GetAllRequests(decimal managerId, string searchKey, DateTime fromDate, DateTime toDate, int pageIndex, int pageSize, KartablOrderBy orderby)
        {
            RequestRepository requestRep = new RequestRepository(false);
            //var ids = from o in quickSearchUnderMnagment
            //          select o.ID;
            //IList<InfoRequest> result = requestRep.GetAllManagerKartabl(fromDate, toDate, RequestType.None, managerId, pageIndex, pageSize, ids.ToArray(), orderby);

            IList <decimal>    managerList    = new List <decimal>();
            BSubstitute        subBus         = new BSubstitute();
            IList <Substitute> substituteList = subBus.GetSubstitute(BUser.CurrentUser.Person.ID);

            if (substituteList.Count > 0)
            {
                managerList = subBus.GetSubstituteManagerList(BUser.CurrentUser.Person.ID);
            }
            managerList.Add(managerId);

            IList <InfoRequest> requests = requestRep.GetAllKartablItems(fromDate, toDate, RequestType.None, managerList, orderby);

            requests = this.AppllySubstituteAccess(managerId, requests, substituteList);

            foreach (InfoRequest req in requests)
            {
                if (BLanguage.CurrentSystemLanguage == LanguagesName.Parsi)
                {
                    req.RegistrationDate = Utility.ToPersianDate(req.RegisterDate);
                    req.TheFromDate      = Utility.ToPersianDate(req.FromDate) + " " + Utility.GetDayName(req.FromDate, LanguagesName.Parsi);
                    req.TheToDate        = Utility.ToPersianDate(req.ToDate) + " " + Utility.GetDayName(req.ToDate, LanguagesName.Parsi);
                }
                else
                {
                    req.RegistrationDate = Utility.ToString(req.RegisterDate);
                    req.TheFromDate      = Utility.ToString(req.FromDate) + " " + Utility.GetDayName(req.FromDate, LanguagesName.English);
                    req.TheToDate        = Utility.ToString(req.ToDate) + " " + Utility.GetDayName(req.ToDate, LanguagesName.English);
                }
            }

            if (!Utility.IsEmpty(searchKey))
            {
                requests = this.AppllyQuickSearch(searchKey, requests);
            }
            return(requests.Skip(pageIndex * pageSize).Take(pageSize).ToList());
        }
示例#5
0
        IList <InfoRequest> IManagerKartabl.GetAllRequests(decimal managerId, RequestType requestType, DateTime fromDate, DateTime toDate, int pageIndex, int pageSize, KartablOrderBy orderby)
        {
            //IList<InfoRequest> result = requestRep.GetAllManagerKartabl(fromDate, toDate, requestType, managerId, pageIndex, pageSize, null, orderby);

            IList <decimal>    managerList    = new List <decimal>();
            BSubstitute        subBus         = new BSubstitute();
            IList <Substitute> substituteList = subBus.GetSubstitute(BUser.CurrentUser.Person.ID);

            if (substituteList.Count > 0)
            {
                managerList = subBus.GetSubstituteManagerList(BUser.CurrentUser.Person.ID);
            }
            managerList.Add(managerId);

            RequestRepository   requestRep = new RequestRepository(false);
            IList <InfoRequest> requests   = requestRep.GetAllKartablItems(fromDate, toDate, requestType, managerList, orderby);

            requests = this.AppllySubstituteAccess(managerId, requests, substituteList);
            return(requests.Skip(pageIndex * pageSize).Take(pageSize).ToList());
        }